Plant Health Intelligence & Smart Intervention System
By Team Outliers — AI/ML Fellowship Project
Plant Health Intelligence & Smart Intervention System
By Team Outliers — AI/ML Fellowship Project

Modern agriculture and plant monitoring systems generate large amounts of environmental, soil, and biological data every day. Understanding plant health from this data is a complex task because it depends on many interacting factors such as temperature, humidity, soil moisture, nutrient levels, and biological signals. Predicting plant health accurately in such a dynamic environment is challenging, but with the advancement of machine learning techniques, it is now possible to identify meaningful patterns from this data. This project presents a structured, end-to-end approach to developing a Plant Health Intelligence System, covering data preprocessing, model training, evaluation, and the development of an interactive web interface for prediction and visualization.
1. Introduction
This project was developed by Team Outliers as part of a two-week AI/ML Fellowship, focusing on building a real-world, deployable plant monitoring solution. It is about building a smart system that can predict plant health using machine learning. The system uses environmental data, soil information, and biological signals to understand the condition of a plant. Based on this data, the system predicts whether a plant is healthy or not and also tells if watering is required.
The primary objective was not limited to building a predictive model. The project aimed to design an end-to-end intelligent system that could preprocess raw plant data, train and compare multiple machine learning models, extract meaningful insights through analysis, and deploy the final solution in the form of an interactive web-based application. Emphasis was placed on comparing baseline and ensemble models, ensuring reliable decision-making through hybrid logic, and transforming theoretical machine learning concepts into a functional real-world system.
By the end of the two-week period, the goal was to deliver a structured, deployable, and practically reliable plant health monitoring application that integrates data processing, model evaluation, and user interaction within a unified architecture.
2. Problem Statement
The foundation of every data science project begins with a clearly defined problem. In this project, the central challenge was the difficulty of manually monitoring plant health. Plant conditions change rapidly due to fluctuations in environmental and soil parameters such as temperature, humidity, moisture, and nutrient levels. Manual observation often leads to delayed responses, inaccurate assessments, or improper irrigation practices.
The objective was to design a machine learning–based system capable of predicting plant health status and determining irrigation requirements using structured environmental and biological data. The goal extended beyond prediction accuracy; the system needed to be reliable, interpretable, and deployable in a real-world setting within a strict two-week timeframe.
The problem addressed in this project is the development of an intelligent system capable of automatically analyzing plant-related data and predicting:
- The health status of the plant
- Whether irrigation is required
The system is designed to transform raw environmental and soil data into actionable insights using machine learning techniques.
3. Project Objectives
The main objectives of this project are:
- To predict plant health status using machine learning.
- To determine whether watering is required.
- To train and compare multiple machine learning models.
- To show clear insights about plant health factors.
To develop an interactive web-based system for users.
4. Dataset Overview
The dataset contains information collected from different plants over time. It includes:
- Environmental data such as temperature, humidity, and light.
- Soil information such as moisture level, pH value, and nutrients.
- Biological signals such as chlorophyll content.
- A target column that shows plant health status.
Plant Health Dataset — Kaggle / Custom Dataset: https://www.kaggle.com/code/sulaniishara/plant-health-prediction-with-ml/input
This dataset was explored to understand patterns and relationships between features.

Figure 1: Raw Dataset Snapshot Displaying Input Features and Target Variable
5. Project Workflow and System Architecture
The development of the Plant Health Intelligence System followed a structured data science workflow, ensuring logical progression from raw data to deployment. The process began with dataset inspection and preprocessing, where the data was cleaned, validated, and transformed into a structured format suitable for model training. Feature scaling and train-test splitting were carefully implemented to maintain evaluation integrity.
Following preprocessing, multiple classification models were trained, including Logistic Regression as a baseline model and ensemble methods such as Random Forest and XGBoost. Comparative evaluation was conducted to determine performance differences and identify the most reliable predictive approach.
The deployment phase involved integrating trained models into a Streamlit-based web application. The system architecture was designed to operate sequentially: user inputs are collected through the frontend interface, passed to the preprocessing pipeline, evaluated by trained models, processed through hybrid decision logic (including rule-based overrides), and finally displayed as real-time predictions.
This layered architecture ensured consistency between training and deployment environments while maintaining modular separation between data processing, model inference, and user interaction components. The workflow emphasized reliability, reproducibility, and integration efficiency within a limited development timeframe.
The final system was deployed using Streamlit to create an interactive web-based interface.

Figure 2: The system follows a structured pipeline starting from user input, followed by preprocessing, feature scaling, model prediction, and hybrid decision logic combining machine learning outputs with rule-based overrides. This ensures both accuracy and practical reliability.
Frontend Interface
The interface allows users to input all 18 plant-related features and receive real-time predictions. Visualization components were integrated to display dataset insights and health distributions.
Backend Integration
Trained models were saved using joblib and loaded within the Streamlit application. User inputs were mapped precisely to model features, ensuring compatibility with trained pipelines.
The final system workflow operates as:
User Input → Data Processing → Model Prediction → Decision Logic → Result Display
The deployment phase ensured that the predictive model transitioned from experimentation to a usable application.
6. Folder Structure
SMART-PLANT-CARETAKER/ │ ├── app/ │ ├── app.py │ └── views/ │ ├── init.py │ ├── about.py │ ├── dashboard.py │ ├── dataset_visualization.py │ ├── model_comparison.py │ ├── predict.py │ └── settings.py │ ├── data/ │ ├── processed/ │ │ ├── cleaned_data.csv │ │ ├── X_train.csv │ │ ├── X_test.csv │ │ ├── y_train.csv │ │ └── y_test.csv │ │ │ └── raw/ │ └── original_dataset.csv │ ├── models/ │ ├── saved_models/ │ │ └── logistic_model.pkl │ │ │ ├── scaler/ │ │ ├── label_encoder.pkl │ │ └── scaler.pkl │ │ │ ├── random_forest_model.pkl │ ├── random_forest_v1.pkl │ └── xgboost_v1.pkl │ ├── notebooks/ │ ├── 01_data_exploration.ipynb │ └── 02_model_experiments.ipynb │ ├── plots/ │ ├── confusion_matrix.png │ ├── confusion_matrix_logistic.png │ ├── confusion_matrix_rf.png │ ├── feature_importance.png │ └── feature_importance_rf.png │ ├── reports/ │ ├── figures/ │ │ └── model_comparison/ │ │ │ ├── logistic_metrics.txt │ ├── rf_metrics.txt │ ├── model_comparison_metrics.json │ ├── model_comparison_report.md │ └── model_comparison_summary.txt │ ├── src/ │ ├── backend/ │ │ ├── init.py │ │ └── predict.py │ │ │ ├── data/ │ │ ├── init.py │ │ └── preprocess.py │ │ │ ├── inference/ │ │ ├── init.py │ │ └── decision_logic.py │ │ │ ├── models/ │ │ ├── init.py │ │ ├── compare_models.py │ │ ├── train_logistic.py │ │ ├── train_rf.py │ │ └── train_xgb.py │ │ │ └── utils/ │ ├── init.py │ ├── config.py │ └── helpers.py │ ├── .gitignore ├── LICENSE ├── README.md └── requirements.txt
7. Data Preprocessing and Feature Engineering
Data preparation followed a systematic pipeline aligned with standard ML workflow practices.
7.1 Dataset Inspection
The dataset was initially inspected to verify feature consistency, data types, and completeness. Each feature was analyzed to ensure correct formatting and logical ranges.
7.2 Data Quality Assessment
Data cleaning involved handling missing values, removing duplicate entries, and correcting inconsistent or unrealistic environmental values. Particular attention was given to maintaining logical thresholds for temperature, humidity, soil moisture, and pH levels to ensure model reliability.
This preprocessing stage established a structured and reliable dataset for model training.
7.3 Train-Test Splitting
The dataset was divided into 80% training data and 20% testing data using a structured split. This ensured that model evaluation would reflect performance on unseen plant conditions.
7.4 Feature Scaling
Since certain features (such as chlorophyll content) had larger numerical ranges than others (such as pH), feature scaling was applied using StandardScaler. This prevented numerical dominance and ensured balanced model learning, particularly for linear algorithms.
7.5 Feature Alignment
Special care was taken to maintain consistent feature ordering across all models. This avoided mismatches between scaled inputs and trained model expectations during deployment.
8. Exploratory Data Analysis (EDA)
Exploratory Data Analysis was conducted to understand relationships between features and the target variable.
Distribution patterns of environmental and soil attributes were examined to observe variability and trends. Correlation analysis provided insight into how features such as soil moisture, temperature, and chlorophyll content influenced plant health status.
Visualization techniques were used to identify patterns and dependencies within the dataset. This step not only informed model selection but also guided the design of meaningful visual components within the final web application.
EDA revealed that plant health is influenced by complex, interdependent environmental signals rather than a single dominant factor. This insight justified the inclusion of ensemble models capable of capturing non-linear relationships.

Figure 4: Distribution of Plant Health Status

Figure 5: Correlation Matrix of Environmental and Soil Features

Figure 6: Relationship Between Soil Moisture and Temperature
9. Model Development
Three machine learning models were implemented and evaluated:
- Logistic Regression
- Random Forest
- XGBoost
9.1 Baseline Model: Logistic Regression
Logistic Regression was implemented as a baseline classifier to understand linear relationships between environmental factors and plant health. This model provided interpretability and served as a performance benchmark.
9.2 Ensemble Models
Random Forest and XGBoost were trained to capture complex non-linear relationships within biological and environmental signals. These models demonstrated improved adaptability to interaction effects between features.
10. Model Evaluation and Comparative Analysis
Model performance was assessed using Accuracy, Precision, Recall, and F1-Score.
Comparative benchmarking revealed that while Logistic Regression offered stable and interpretable results, ensemble methods demonstrated stronger performance in handling non-linear biological dependencies.
To further improve reliability, a hybrid decision framework was introduced.
10.1 Rule-Based Safety Overrides
To ensure practical robustness, irrigation decision rules were incorporated:
- Extremely low soil moisture triggered a “Needs Water” status
- Extremely high soil moisture triggered an “Overwatered” status
This hybrid architecture combined:
- Ensemble majority voting
- Rule-based overrides
- Machine learning predictions
The integration significantly enhanced system stability and real-world reliability

Figure 7: Class-Wise Probability Distribution Across Test Samples

Figure 8: Model Accuracy and Inference Time Comparison

Figure 9: Precision, Recall, F1-Score Comparison and Per-Class F1 Heatmap
11. Web Application Demo (Streamlit)
A user-friendly Streamlit web interface was developed to allow users to input plant conditions and receive real-time predictions.
The interface includes:
- Input fields for environmental and soil features
- Real-time prediction display
- Health status and irrigation suggestions

Figure 3: Streamlit-Based Web Application Dashboard for Plant Health Prediction
12. Reflection and Future Scope
The project successfully demonstrated the complete lifecycle of a data science workflow within a two-week period. The system achieved reliable prediction performance while maintaining interpretability and real-world applicability.
From a broader perspective, this project highlighted the importance of structured preprocessing, baseline benchmarking, and iterative refinement. It reinforced the understanding that deployment readiness requires more than model accuracy; it demands integration, testing, and logical safeguards.
Future improvements may include expanding the dataset, integrating real-time sensor APIs, experimenting with deep learning approaches, and deploying the system on cloud infrastructure for scalability.
13. Challenges and Key Learning Outcomes
During the development of the Plant Health Intelligence System, several technical and coordination challenges were encountered. One major issue involved feature mismatches between the preprocessing pipeline and model inputs. Since multiple models were trained and later integrated into a single application, maintaining consistent feature ordering and scaling was critical. Even small inconsistencies led to prediction errors, which required careful debugging and validation of the data pipeline.
Model loading and version compatibility also created integration difficulties during deployment. Ensuring that serialized models worked correctly within the Streamlit environment required controlled testing and environment consistency. Additionally, mapping all 18 input features from the frontend to the backend prediction engine demanded precise alignment to avoid runtime errors.
Working within a strict two-week timeline further required structured coordination and parallel task execution. These challenges reinforced the importance of clean preprocessing, baseline benchmarking before advanced modeling, and maintaining consistency across the entire ML workflow. The experience also highlighted that real-world systems benefit from hybrid approaches that combine machine learning predictions with rule-based logic to ensure reliability.
Overall, the project strengthened both technical problem-solving abilities and collaborative system-level thinking.
14. Project Timeline

Figure 10: Two-Week Development Timeline Showing Data Preparation, Model Development, and System Deployment Phases
15. Github Repo
Final Source Code, Scripts, Readme and all the configuration and dataset for models are on this github repo.
Plant Health Montioring System
16. Team Contributions
Team Outliers
- Meher Ali — Project Lead & Coordination Orchestrated GitHub: https://github.com/magic-meer Medium: https://medium.com/@meherali.meer The project roadmap, managed development timelines, authored the central documentation, and oversaw the backend integration of the three ML models to ensure a cohesive final system.
- Maryam Fatima — Frontend & Data Visualization GitHub: https://github.com/maryam-ca Medium: https://medium.com/@mminhas1405 Designed and developed the Streamlit user in terface, creating an intuitive layout and generating the dynamic data visualizations (distribution graphs, feature plots) to make the ML outputs easily understandable for end-users.
- **Ayesha — Data Engineering & Full-Stack Integration** GitHub: https://github.com/Ayesha0000000 Medium: https://medium.com/@gmayesha2004 Led data cleaning, handled outlier management, and built the critical bridge between the Streamlit frontend and the Python backend, ensuring seamless real-time user inputs and model execution.
- **Rameesha Siddique— Advanced Modeling & Backend Logic** GitHub: [link] Medium: https://medium.com/@rameeshasiddique2005 Trained the XGBoost classification model and engineered the backend prediction logic, including the highly effective rule-based irrigation safety overrides and the ensemble majority-voting mechanism.
- **Hammad Ali — Baseline Modeling & Feature Engineering** GitHub: https://github.com/hammadali155 Medium: https://medium.com/@hammad_ali_gdgoc Engineered the data processing pipeline, performed essential feature scaling, implemented the baseline Logistic Regression model, and conducted the comprehensive statistical comparative analysis across all models.
17. ACKNOWLEDGEMENT
This project was developed as part of the AI/ML Fellowship program. We would like to thank our mentors and organizers for their guidance and support throughout the project.
메타데이터
- post_id
- b688732cbea2
- slug
- plant-health-intelligence-smart-intervention-system-b688732cbea2
- url
- https://medium.com/@mminhas1405/plant-health-intelligence-smart-intervention-system-b688732cbea2
- canonical_url
- https://medium.com/@mminhas1405/plant-health-intelligence-smart-intervention-system-b688732cbea2
- author_url
- https://medium.com/@mminhas1405
- status
- ok
- fetched_at
- 2026-07-13 06:23:13