DSS for Irrigation
Development and comparative evaluation of Fuzzy Logic (Mamdani) and Neuro-Adaptive (ANFIS) decision support systems for agriculture.
Efficient water management in agriculture requires balancing two conflicting goals: minimizing water usage and maximizing crop health. This project developed and validated an Irrigation Decision Support System (IDSS) for vineyards in the Trentino region (Italy), evolving from an expert-based rule system to an adaptive machine learning approach.
Objectives
- Design an interpretable Mamdani Fuzzy Inference System based on agronomic expert knowledge.
- Develop a data-driven ANFIS (Adaptive Neuro-Fuzzy Inference System) to automate rule learning.
- Quantify the trade-offs between the two approaches regarding water savings vs. crop stress mitigation.
My role
- Designed the fuzzy inference engines and the rule bases.
- Implemented Bayesian Optimization to tune membership functions against expert surveys.
- Developed a counterfactual simulation engine to stress-test algorithms on historical data.
- Conducted statistical bootstrapping to validate performance metrics.
Tech Stack
| Language | Python 3.11+ |
|---|---|
| Fuzzy Logic | Scikit-Fuzzy, PyTorch (S-ANFIS) |
| Optimization | Scikit-Optimize (Bayesian) |
| Analysis | NumPy, Pandas, Matplotlib |
| DevOps | uv (package manager), Jupyter |
Repository Structure
The project is modularized to separate logic from evaluation:
dataContains all datasets (CSV, XLSX) used for trainingnotebooksFor research, demonstration, and evaluationscriptsUsed for training models and running the main applicationpackageCore package containing the logic for different DSSs
The Architecture: Expert Knowledge vs. Machine Learning
The core challenge was translating complex environmental data into actionable irrigation commands (e.g., “Single Turn”, “Double Turn”). The system processes four key inputs:
- Current Soil Moisture (Tensiometer)
- Predicted Soil Moisture (LSTM Forecast)
- Predicted Rainfall
- Predicted Temperature
Two architectures were implemented and compared:
- Mamdani IDSS: Relies on 21 explicit “IF-THEN” rules defined by agronomists. It prioritizes interpretability.
- Takagi-Sugeno ANFIS: Uses a neural network structure to learn the optimal fuzzy rules and membership functions directly from field data, prioritizing adaptability.
Methodology: Simulation & Optimization
To ensure the systems were field-ready, a rigorous tuning and testing pipeline was established:
- Bayesian Optimization: The membership functions (the curves defining what counts as “High” or “Low” moisture) were fine-tuned to minimize the error between the algorithm’s suggestions and human expert decisions.
- Counterfactual Simulation: A “What-If” analysis engine was built to reconstruct the entire growing season. It simulated how the soil moisture would have evolved if the IDSS recommendations had been followed instead of the actual farmer’s actions.
Results: The Trade-off
The comparative analysis revealed distinct behavioral profiles for the two systems. Both significantly outperformed the baseline (manual irrigation) by stabilizing soil moisture within the optimal agronomic range.
- Mamdani (The “Safe” Choice): Excellent at stress mitigation. It reduced the number of “Critical Dry Days” significantly, prioritizing plant health.
- ANFIS (The “Efficient” Choice): Excellent at water conservation. It achieved >50% water savings compared to traditional practices by adopting a more conservative irrigation schedule.
The study concluded that while ANFIS is superior for resource-scarce environments, Mamdani remains the preferred choice for high-value crops where stress avoidance is paramount.
Full Documentation
This project resulted in two scientific publications covering the design of the Mamdani system and the subsequent comparative analysis with ANFIS:
Read Comparative Paper (Sensors) Read Mamdani Paper (CoDIT) View Presentation Slides (CoDIT)