Skip to content

Latest commit

 

History

58 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Water Quality Irrigation Suitability Prediction using Machine Learning and Deep Learning

Project Overview

This project develops a comprehensive environmental artificial intelligence framework for predicting irrigation water suitability using machine learning and deep learning techniques.

The study is based on a citizen-science environmental water-quality monitoring dataset containing physicochemical, environmental, temporal, and geospatial attributes such as pH, dissolved oxygen, electrical conductivity, air temperature, weather conditions, altitude, and location-based measurements.

The project follows a complete end-to-end data science and artificial intelligence workflow including exploratory data analysis (EDA), statistical analysis, preprocessing, feature engineering, machine learning, deep learning, explainable AI, and environmental interpretation of findings.


Group Members (GROUP 3 – DAY CLASS)

  1. Kigozi Allan – 2400725792
  2. Keith Paul Kato – 2400726593
  3. Mugole Joel – 2400707060
  4. Nalubega Shadiah – 2400708715
  5. Ageno Elizabeth – 2400725850

Course Information

  • Course: Introduction to Machine Learning (CSC 2201)
  • Lecturer: Dr. Lillian Muyama
  • Semester: Semester Two – Year Two
  • Submission Date: 30th April 2026

Problem Statement

Poor irrigation water quality can negatively affect crop productivity, soil health, and long-term agricultural sustainability. Traditional laboratory-based water assessment approaches may be expensive, slow, and inaccessible in many regions. Additionally, environmental water-quality conditions vary across locations and environmental conditions, making manual interpretation difficult.

This project applies machine learning and deep learning techniques to analyze environmental water-quality monitoring data and predict irrigation suitability using physicochemical and environmental parameters such as pH, dissolved oxygen, conductivity, temperature, weather conditions, and geographical attributes.


Objectives

General Objective

To develop interpretable machine learning and deep learning models for irrigation water suitability prediction using environmental water-quality monitoring data.

Specific Objectives

  • Perform exploratory and statistical analysis on environmental water-quality data
  • Clean and preprocess environmental monitoring data
  • Handle missing values and outliers appropriately
  • Engineer meaningful environmental and temporal features
  • Implement multiple machine learning classification algorithms
  • Develop deep learning models for predictive analysis
  • Compare the performance of machine learning and deep learning approaches
  • Interpret model predictions using explainable AI techniques
  • Identify the most influential environmental factors affecting irrigation suitability

Dataset Description

The dataset contains citizen-science environmental water-quality monitoring observations collected from multiple biosphere reserves, rivers, and environmental monitoring sites.

The data includes physicochemical, environmental, temporal, and geospatial attributes relevant to irrigation suitability assessment.

Key Features

  • pH
  • Dissolved Oxygen Concentration
  • Dissolved Oxygen Percentage
  • Electrical Conductivity
  • Air Temperature
  • Weather Conditions
  • River Information
  • Site Information
  • Latitude and Longitude
  • Altitude
  • Local Time Information

Dataset Characteristics

  • Multivariate environmental dataset
  • Structured tabular dataset
  • Binary classification problem
  • Environmental monitoring observations

Target Variable

  • Irrigation Suitability

    • 1 → Suitable for irrigation
    • 0 → Not suitable for irrigation

Machine Learning Workflow

  1. Data Collection
  2. Exploratory Data Analysis (EDA)
  3. Statistical Analysis
  4. Data Cleaning & Preprocessing
  5. Missing Value Handling
  6. Outlier Detection & Treatment
  7. Feature Engineering
  8. Model Training
  9. Hyperparameter Optimization
  10. Model Evaluation
  11. Explainable AI Analysis
  12. Comparative Performance Analysis

Models Implemented

🔹 Machine Learning Models

  • Logistic Regression
  • K-Nearest Neighbors (KNN)
  • Naive Bayes
  • Decision Tree
  • Random Forest
  • Support Vector Machine (SVM)
  • Gradient Boosting / XGBoost
  • Ensemble Learning Methods

🔹 Deep Learning Models

  • Artificial Neural Networks (ANNs)
  • Multi-Layer Perceptrons (MLPs)
  • Deep Feedforward Neural Networks

Evaluation Metrics

The models are evaluated using multiple performance metrics including:

  • Accuracy
  • Precision
  • Recall
  • F1-score
  • Confusion Matrix
  • ROC-AUC
  • Cross-Validation Scores

Deep learning models are additionally evaluated using:

  • Training and Validation Loss
  • Learning Curves
  • Overfitting Analysis

Explainable AI

Explainable AI techniques such as feature importance analysis and SHAP (SHapley Additive exPlanations) are used to interpret model predictions and identify the most influential environmental parameters affecting irrigation suitability.


Key Challenges Addressed

  • Missing environmental measurements
  • Sensor-related outliers and noisy observations
  • Environmental variability across monitoring locations
  • Feature scaling and transformation
  • Model generalization and overfitting
  • Interpretability of environmental prediction models

Project Structure

  • data/ → raw and processed environmental data
  • notebooks/ → EDA and model development
  • src/ → reusable preprocessing and training modules
  • models/ → saved machine learning and deep learning models
  • results/ → evaluation outputs and metrics
  • reports/ → figures, analysis, and project reports
  • figures/ → visualizations and plots

Significance of the Study

This project addresses real-world environmental and agricultural challenges by applying machine learning and deep learning techniques to water-quality monitoring data. The findings can support sustainable irrigation practices, environmental monitoring initiatives, agricultural decision-making, and intelligent water resource management.

Additionally, the study demonstrates how artificial intelligence can be applied to environmental sustainability and water-resource assessment using citizen-science monitoring data.


Expected Outcomes

The project is expected to:

  • Develop accurate predictive models for irrigation suitability assessment
  • Identify critical environmental factors affecting irrigation water quality
  • Compare the strengths and limitations of machine learning and deep learning approaches
  • Provide interpretable environmental AI insights using explainable AI techniques
  • Support sustainable agricultural water management strategies

Future Work

Potential future improvements include:

  • Real-time IoT water-quality monitoring integration
  • Environmental anomaly detection systems
  • Geospatial environmental visualization
  • Streamlit-based deployment
  • Automated irrigation advisory systems
  • Advanced deep learning architectures

Real-World Application

Beyond a coursework deliverable, the framework targets concrete operational use cases.

Farmer Decision Support

Extension officers and smallholders can use a phone-friendly version of the model to obtain an instant suitability verdict plus a SHAP-style explanation ("this sample was flagged because EC is 4.1 mS/cm — above the FAO safe range"). This converts an opaque ML output into an actionable farming decision.

Sustainable Irrigation Management

Water-user associations can run the classifier as a batch quality filter over weekly sensor uploads, prioritising lab follow-up only on the samples the model flags as borderline. This reduces lab cost without losing safety margin.

Water Conservation

By distinguishing unsuitable sources early, communities can divert poor-quality water to livestock, non-edible crops, or recharge ponds instead of discarding it — extending the usable water budget in dry seasons.

Smart-Agriculture Integration

The model is small enough to be deployed at the edge (on a Raspberry Pi or low-cost gateway) co-located with the sensor cluster. This enables offline operation in areas with intermittent connectivity and minimises data-egress costs.

Policy & Regulatory Insight

Aggregated model outputs — paired with the geospatial analysis in section 3.11 — give regulators a near-real-time map of which biospheres are degrading, supporting evidence-based water-quality interventions.

Conclusion

This project demonstrates how machine learning and deep learning techniques can be applied to environmental water-quality monitoring and irrigation suitability prediction. Through statistical analysis, feature engineering, predictive modelling, explainable AI, and environmental interpretation, the study provides an intelligent framework for sustainable agricultural water management and environmental decision-making.


About

Machine learning and deep learning-based prediction of irrigation water suitability using citizen-science environmental water-quality data containing physicochemical, temporal, and geospatial attributes.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages