- Introduction
- Features
- Dataset
- Methodology
- Installation
- Usage
- Results
- Future Work
- Technologies Used
- Contributing
- License
- Contact
PlantPedia is an AI-powered system designed for classifying plant species using Vision Transformers (ViTs) combined with transfer learning. The project aims to automate plant species identification by analyzing leaf images, significantly reducing manual efforts, and enhancing ecological and agricultural research. The system includes an AI chatbot powered by Google Generative AI (Gemini Pro) for interactive information retrieval on identified plants.
- Automated Plant Leaf Classification using Vision Transformers
- Real-time chatbot for detailed plant information powered by Google Gen-AI
- Interactive GUI developed using Streamlit
- High accuracy of 95.97% with precision, recall, and F1-score each at 0.96
- Swedish Leaf Dataset: 1,125 images of 15 plant species
- Extended Dataset: Added 10 additional plant species, bringing the total to 1,875 images across 25 classes
-
Image Preprocessing:
- Resizing to
224x224
pixels - Normalization using ImageNet statistics
- Data augmentation (rotations, flips, shifts) for better generalization
- Resizing to
-
Feature Extraction:
- Leveraged pre-trained Vision Transformers to extract high-level features
- Added a custom classifier:
Linear layer (512 units) → ReLU → Dropout (0.5) → Output layer
-
Transfer Learning & Fine-Tuning:
- Freezed initial ViT layers and fine-tuned the final layers
- Used an Adam optimizer with learning rate scheduling and early stopping
-
Model Testing:
- Evaluated on the test dataset using metrics like accuracy, precision, recall, F1-score, and a confusion matrix
- Clone the Repository:
git clone https://github.com/manish92596/PlantPedia.git
cd PlantPedia
- Set Up a Virtual Environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install Dependencies:
pip install -r requirements.txt
- Run the Streamlit Application:
streamlit run app.py
- Upload a Plant Leaf Image:
- Get species classification and interact with the chatbot for more information
- Model Accuracy: 95.97%
- Precision: 0.96
- Recall: 0.96
- F1 Score: 0.96
- Confusion Matrix: Visualizes model performance across all 25 classes
- Multilingual Support: Extend the chatbot's capabilities to support multiple languages
- Disease Detection: Add functionality to detect plant diseases from leaf images
- Scalability: Expand the dataset to include more plant species for broader classification
- Framework: PyTorch with Hugging Face Transformers
- Python Version: 3.11.5
- Libraries:
- torch
- torchvision
- transformers
- scikit-learn
- matplotlib
- seaborn
- Generative AI:
- langchain-google-genai
- langchain[openai,all]
- langchain-community
- sentence-transformers
- GUI: Streamlit
- Hardware: NVIDIA A100 GPUs with CUDA support
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a new branch:
git checkout -b feature-branch
- Commit your changes:
git commit -m 'Add feature'
- Push to the branch:
git push origin feature-branch
- Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to reach out for collaboration or queries:
Enjoy using PlantPedia! 🌱🌿🌳