Ecole 42 machine learning project for plant disease detection and leaf analysis using computer vision and deep learning techniques.
Leaffliction is designed to identify and classify plant diseases through leaf image analysis. The project implements advanced machine learning models with preprocessing, augmentation, and embedding techniques to achieve accurate disease detection.
Timur Çakmakoğlu |
Alp A. Yalman |
Leaffliction/
├── assets/ # Project assets and documentation
│ └── en.subject.pdf
├── src/ # Source code
│ ├── analysis/ # Data analysis modules
│ │ └── Distribution.py # Distribution analysis
│ ├── model/ # Machine learning models
│ │ ├── dataset.py # Dataset handling
│ │ ├── hnsw_model.py # HNSW (Hierarchical Navigable Small World) model
│ │ ├── network.py # Neural network architecture
│ │ ├── predict.py # Prediction pipeline
│ │ └── train.py # Training pipeline
│ └── preprocessing/ # Data preprocessing
│ ├── Augmentation.py # Data augmentation techniques
│ ├── Embedding.py # Feature embedding
│ └── Transformation.py # Image transformations
├── model_webapp.py # Web application interface
├── requirements.txt # Python dependencies
├── Makefile # Build and deployment commands
└── README.md # Project documentation
- Plant Disease Detection: Automated identification of various plant diseases from leaf images
- Data Preprocessing: Comprehensive image preprocessing pipeline including augmentation and transformations
- Machine Learning Models: Implementation of neural networks and HNSW algorithms for efficient classification
- Web Application: User-friendly web interface for disease prediction
- Embedding Analysis: Advanced feature extraction and embedding techniques
- Distribution Analysis: Statistical analysis of dataset distributions
- Clone the repository:
git clone https://github.com/alpardayalman/Leaffliction.git
cd Leaffliction
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
The project includes a Makefile for convenient setup and deployment:
# Install dependencies
make install
# Run tests
make test
# Start the application
make run
# Clean build artifacts
make clean
To train the disease detection model:
python src/model/train.py
For single image prediction:
python src/model/predict.py --image path/to/leaf/image.jpg
Launch the web interface:
python model_webapp.py
Then open your browser and navigate to http://localhost:5000
to use the web interface.
To preprocess your dataset:
python src/preprocessing/Transformation.py --input data/ --output processed_data/
The project implements several key components:
- Neural Network: Custom architecture optimized for leaf image classification
- HNSW Model: Hierarchical Navigable Small World algorithm for efficient similarity search
- Data Augmentation: Techniques to expand training data and improve model robustness
- Feature Embedding: Advanced representation learning for better classification performance
- Input Format: RGB images of plant leaves
- Supported Formats: JPG, PNG, BMP
- Recommended Resolution: 224x224 pixels (images will be automatically resized)
- Dataset Structure: Organized by disease class in separate directories
Key configuration parameters can be adjusted in the respective Python files:
- Model hyperparameters in
src/model/network.py
- Training settings in
src/model/train.py
- Preprocessing options in
src/preprocessing/
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature
) - Commit your changes (
git commit -am 'Add new feature'
) - Push to the branch (
git push origin feature/new-feature
) - Create a Pull Request
- Analysis: Statistical and exploratory data analysis
- Model: Core machine learning algorithms and architectures
- Preprocessing: Data preparation and augmentation pipelines
Run the test suite:
python -m pytest tests/
Note: This is an Ecole 42 project, designed for educational and research purposes in plant pathology and computer vision.