https://github.com/azad77/modeling-and-predicting-crop-health-using-rs-data-and-neural-networks

https://github.com/azad77/modeling-and-predicting-crop-health-using-rs-data-and-neural-networks

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: Azad77
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Size: 31.3 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 2 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License

README.md

Modeling and Predicting Crop Health Using Remote Sensing Data and Neural Networks

Author: Azad Rasul

Contact: azad.rasul@soran.edu.iq

Introduction

This project focuses on using remote sensing data to analyze and assess vegetation health. By leveraging raster and vector data, the project computes vegetation indices like NDVI (Normalized Difference Vegetation Index) and classifies plots based on their vegetation health. The classification model is implemented using a neural network built with TensorFlow, and various metrics are computed to evaluate its performance.

Key Features

  • Data Handling: Loads and processes raster data, including DEMs (Digital Elevation Models), orthophotos, and DTMs (Digital Terrain Models).
  • Vegetation Indices: Computes NDVI to assess vegetation health.
  • Data Masking: Masks invalid data for elevation and thermal values.
  • Zonal Statistics: Computes mean NDVI, thermal, elevation, and DTM values for each plot.
  • Neural Network Classification: Implements a neural network model using TensorFlow to classify plots based on vegetation health.
  • Performance Evaluation: Evaluates the model's performance using accuracy, precision, recall, F1 score, and ROC-AUC score.

Data Download

The dataset used in this project can be downloaded from the DroneMapper Crop Analysis Data. Extract the data into the data/ directory in your working environment.

Installation and Setup

Clone the repository:

bash git clone https://github.com/yourusername/your-repo-name.git cd your-repo-name

Usage

Load and Preprocess Data:

  • Load DEM, orthophoto, and DTM data using rasterio.
  • Mask invalid elevation and thermal values.
  • Compute NDVI for vegetation health assessment.

Compute Zonal Statistics:

  • Calculate mean NDVI, thermal, elevation, and DTM values for each plot using the compute_zonal_stats() function.

Prepare Data for Model Training:

  • Create a feature matrix and a synthetic target variable focusing on healthy crops.
  • Handle data imbalance by undersampling the majority class.

Train the Neural Network Model:

  • Split the data into training and testing sets.
  • Standardize the features.
  • Define and train the neural network model using TensorFlow.

Evaluate Model Performance:

  • Use accuracy, precision, recall, F1 score, and ROC-AUC score to assess the model's performance.

Example

Below is an example of how to load data and train the model: ```bash import rasterio import geopandas as gpd from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Dropout

Load and preprocess raster data

dem = rasterio.open('data/dem.tif') ortho = rasterio.open('data/ortho.tif') dtm = rasterio.open('data/dtm.tif')

Compute NDVI

ndvi = (ortho.read(4) - ortho.read(1)) / (ortho.read(4) + ortho.read(1))

Calculate zonal statistics

plots1 = gpd.readfile('data/plots1.shp') plots1['NDVImean'] = computezonalstats(plots1, ndvi, dem.transform)['mean']

Train the model

model = Sequential([ Dense(128, activation='relu', input_shape=(4,)), Dropout(0.3), Dense(64, activation='relu'), Dropout(0.3), Dense(1, activation='sigmoid') ])

model.compile(optimizer='adam', loss='binarycrossentropy', metrics=['accuracy']) model.fit(Xtrain, ytrain, epochs=100, validationsplit=0.2, batch_size=32) ```

Results

The model is trained for 100 epochs, with validation accuracy consistently improving across epochs. The final model is able to classify vegetation health with high accuracy.

Future Work

Experiment with different vegetation indices and additional remote sensing data. Optimize the neural network architecture for better performance. Apply the model to different crop types and geographical regions.

License

This project is licensed under the MIT License.

Owner

  • Name: Dr Azad Rasul
  • Login: Azad77
  • Kind: user
  • Company: Soran University

As a geographer, I use remote sensing and GIS methods and techniques to study LST, urban environment, earth observation and natural disasters.

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels