This project develops AI tools to optimize lettuce growth in vertical farming environments. It leverages computer vision and machine learning for disease detection, growth stage classification, yield prediction, and health status classification using image data.
- Disease Detection: Identify common diseases on lettuce leaves using object detection (YOLOv8).
- Growth Stage Classification: Classify lettuce plants into growth stages with deep learning.
- Yield Prediction: Estimate expected lettuce yield from environmental and growth features.
- Health Status Classification: Classify lettuce as healthy or unhealthy using deep learning models trained on Kaggle and Roboflow datasets.
- Downloads and prepares lettuce image datasets from Kaggle and Roboflow.
- Preserves original folder structures and ignores unsupported file types.
- Trains a YOLOv8 model to detect diseases on lettuce leaves.
- Runs inference and saves output visualizations.
- Fine-tunes a ResNet18 model on labeled growth stage images.
- Classifies images into growth stages.
- Trains a Random Forest regression model on tabular data to predict lettuce yield.
- Reports Mean Absolute Error (MAE).
- Trains a MobileNetV2-based classifier to distinguish healthy vs. unhealthy lettuce using images from nested folders.
- Supports custom folder structures.
- Evaluates the trained model on new datasets (e.g., Roboflow) and outputs predictions and scores to a CSV file.
- Script to train the YOLOv8 model with configurable parameters.
-
Clone the repository
git clone <repository_url> cd <repository_folder>
-
Setup Python environment
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate` pip install -r requirements.txt
-
Run dataset setup
python kaggle_scripts/kaggle_dataset_setup.py python roboflow_scripts/roboflow_dataset_setup.py
-
Train models and run inference
- Disease detection:
python detect_disease.py
- Growth stage classification:
python stage_classifier.py
- Yield prediction:
python yield_prediction.py
- Health status classification:
python kaggle_scripts/kaggle_detect_status.py
- Test health classifier on new images:
python test.py
- Disease detection:
- Python 3.8+
- TensorFlow
- PyTorch
- torchvision
- ultralytics (for YOLOv8)
- scikit-learn
- OpenCV
- matplotlib
- Roboflow Python package
- kagglehub
- Improve dataset quality and size.
- Integrate environmental sensor data for more accurate yield prediction.
- Real-time monitoring with camera feeds.
- Explore additional ML models and hyperparameter tuning.
- Deploy models to edge devices for on-site vertical farm monitoring.
For questions or contributions, please contact [joshuajones272000@gmail.com]