An advanced computer vision system for detecting and counting pineapple blooms in drone-captured imagery. This application combines YOLOv8 object detection with explainable AI techniques to provide insights into the model's decision-making process through an intuitive Streamlit interface.
- 🖼️ Image Processing: Upload and preprocess drone images for optimal detection
- 🔍 Bloom Detection: Utilize YOLOv8 to accurately identify and count pineapple blooms
- 🧠 Explainable AI (XAI): Visualize and understand the model's decisions with heatmaps and feature importance
- 📊 Performance Monitoring: Track and visualize model performance metrics over time
- 🌐 Interactive Interface: User-friendly Streamlit interface for all functionalities
PineCount-AI/
├── src/
│ ├── main.py # Main Streamlit application
│ ├── model.py # Functions to load, preprocess, and run the model
│ ├── xai.py # Functions to generate model explanations (XAI)
│ └── monitoring.py # Functions to log and visualize performance metrics
│
├── weights/
│ └── weights.pt # Pre-trained YOLOv8 model weights
│
├── logs/ # Directory for performance logs (created at runtime)
│
├── assets/ # Images and other static assets
│ └── pinecount-logo.svg # Project logo
│
├── requirements.txt # List of necessary libraries
└── README.md # This file
-
Clone this repository:
git clone https://github.com/AndresACV/PineCount-AI.git cd PineCount-AI -
Create and activate a virtual environment:
# On Windows python -m venv venv venv\Scripts\activate # On macOS/Linux python -m venv venv source venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Start the Streamlit application:
streamlit run src/main.py
-
Use the web interface to:
- Upload drone images of pineapple fields
- Run the detection model to count pineapple blooms
- View visualizations of detected blooms
- Generate and explore model explanations
- Monitor model performance metrics
The pineapple bloom detection model is implemented using YOLOv8, a state-of-the-art object detection framework. The pre-trained weights are stored in the weights/weights.pt file.
The XAI features include:
- Confidence score visualization for each detected bloom
- Attention heatmaps showing which parts of the image the model focuses on
- Detailed statistics about detections including confidence levels and size distributions
Performance metrics tracked include:
- Inference time
- Bloom count distribution
- Confidence levels
- Summary statistics
- Python 3.9+
- PyTorch 2.0+
- Ultralytics (YOLOv8)
- Streamlit
- OpenCV
- SHAP
- Other dependencies listed in
requirements.txt
This project is licensed under the MIT License - see the LICENSE file for details.
Andrés Calvo - GitHub Profile
- Ultralytics for the YOLOv8 implementation
- Streamlit for the web application framework
- SHAP for model explainability tools
