CoolFace
Apppublic

Abdalllah/crop-irrigation-mlflow

sourceHugging Facemitupdated 10mo agoView on Hugging Face
0likes
App README

๐ŸŒพ Intelligent Crop Irrigation Advisor - MLflow Dashboard

![GitHub](https://github.com/Iabdallllah/Intelligent-Crop-Irrigation-Advisor) ![License](LICENSE) ![MLflow](https://mlflow.org)

Live ML Experiment Tracking & Model Registry for Smart Agriculture ๐Ÿšœ


๐Ÿ“Š Dashboard Overview

This MLflow server provides real-time tracking for 3 production-ready ML models that power an intelligent crop irrigation system:

๐ŸŽฏ Models Tracked

1๏ธโƒฃ Crop Recommendation Model
Algorithm: Random Forest Classifier
Accuracy:  99.32%
Precision: 99.37%
Purpose:   Predict optimal crop for soil conditions
Features:  NPK levels, pH, Temperature, Humidity, Rainfall
Classes:   22 different crops
2๏ธโƒฃ Irrigation Optimization Model
Algorithm: CatBoost Regressor  
Rยฒ Score:  0.974
MAE:       0.683 mm
RMSE:      2.603 mm
Purpose:   Calculate precise water amount needed
Features:  30+ engineered features (soil, weather, crop data)
3๏ธโƒฃ Smart Irrigation Classifier
Algorithm: CatBoost + Optuna Hyperparameter Tuning
Accuracy:  83.61%
F1 Score:  83.57%
Purpose:   Binary classification - irrigate or not
Trials:    10 Optuna optimization runs tracked

๐Ÿš€ How to Use This Dashboard

Navigate Through:

  • โ€”๐Ÿ“ Experiments โ†’ View all training runs with metrics & parameters
  • โ€”๐Ÿ“Š Compare โ†’ Side-by-side comparison of multiple runs
  • โ€”๐Ÿ† Models โ†’ Model Registry with versioning
  • โ€”CropRecommendationModel (v2)
  • โ€”IrrigationOptimizationModel (v1)
  • โ€”SmartIrrigationClassifierModel (v1)

Quick Start:

  1. 1.View Experiments: Click on any experiment name to see runs
  2. 2.Compare Runs: Select multiple runs โ†’ Click "Compare"
  3. 3.Download Models: Go to "Models" tab โ†’ Download .pkl files
  4. 4.Visualize Metrics: Charts auto-generated for all logged metrics

๏ฟฝ Key Features

โœ… Real-time Tracking - Live experiment monitoring โœ… Parameter Comparison - Compare hyperparameters across runs โœ… Metric Visualization - Interactive charts for accuracy, loss, Rยฒ โœ… Model Registry - Versioned model storage with lineage โœ… Artifact Storage - Models, plots, and reports โœ… Optuna Integration - Hyperparameter optimization trials


๐Ÿ“ˆ Metrics Dashboard

Tracked Metrics:

  • โ€”Classification: Accuracy, Precision, Recall, F1 Score
  • โ€”Regression: Rยฒ Score, MAE, RMSE, Adjusted Rยฒ
  • โ€”Feature Importance: Top features for each model
  • โ€”Training Time: Duration per run

Logged Parameters:

  • โ€”Model hyperparameters (learning_rate, depth, iterations)
  • โ€”Data split ratios (testsamples, trainsamples)
  • โ€”Feature engineering settings
  • โ€”Random seeds for reproducibility

๐Ÿ”— Related Links

  • โ€”๐Ÿ“š GitHub Repository: Intelligent-Crop-Irrigation-Advisor
  • โ€”๐Ÿ“– Documentation: Full project docs in repo
  • โ€”๐ŸŒฑ Dataset: Agricultural data with soil & weather features
  • โ€”๐Ÿ”ง MLflow Guide: Setup instructions in MLFLOW_SETUP.md

๏ฟฝ Tech Stack

TechnologyVersionPurpose
MLflow3.6.0Experiment tracking & model registry
CatBoostLatestGradient boosting models
Scikit-learnLatestRandom Forest classifier
Optuna4.6.0Hyperparameter optimization
Python3.11Runtime environment
DockerLatestContainerization

๐Ÿ“Š Model Performance Summary

ModelTypeBest MetricFeatures Used
Crop RecommendationClassification99.32% Acc7 (NPK, pH, climate)
Irrigation OptimizationRegression0.974 Rยฒ30+ (engineered)
Smart ClassifierClassification83.61% Acc23 (selected)

๐ŸŒ Use Cases

  • โ€”๐ŸŒพ Precision Agriculture: Optimize crop selection & water usage
  • โ€”๐Ÿ’ง Water Conservation: Reduce water waste by 20-30%
  • โ€”๐Ÿ“Š Farm Management: Data-driven irrigation decisions
  • โ€”๐Ÿ”ฌ Agricultural Research: Analyze model performance over time

๐Ÿ› ๏ธ Local Development

Want to run this locally? Clone the repo:

bash
git clone https://github.com/Iabdallllah/Intelligent-Crop-Irrigation-Advisor.git
cd Intelligent-Crop-Irrigation-Advisor
pip install -r requirements.txt
python mlflow_tools/launch_mlflow.py

Open: http://localhost:5000


๐Ÿ“ License

MIT License - See LICENSE for details


๐Ÿ‘จโ€๐Ÿ’ป Author

Abdallah - Agricultural AI Solutions ๐Ÿ”— GitHub Profile


๐Ÿ™ Acknowledgments

Built with passion for sustainable agriculture and smart farming ๐ŸŒฑ

Using AI to grow more with less ๐Ÿ’š


โšก This Space is powered by Hugging Face Spaces + Docker + MLflow