This project is a Flask-based application designed to integrate multiple components for handling imagery data, classifying animals, and providing detailed information about them through a custom QnA chatbot. The system uses MongoDB for storage, OpenCV for image classification, and a custom RAG (Retrieval-Augmented Generation) model for answering questions about animals based on a custom dataset.
-
Image Classification:
- Users can upload images of animals.
- OpenCV processes the image, and a machine learning model classifies the animal.
-
Custom QnA Chatbot:
- Uses a custom-trained RAG model to answer user queries about animals.
- Knowledge base includes books, datasets, and additional resources.
-
MongoDB Integration:
- Imagery data and metadata are stored in MongoDB for efficient retrieval.
-
Frontend Integration:
- Flask connects to a ReactJS/HTML-based frontend for user interaction.
- Users can upload images and chat with the chatbot through a single interface.
-
Modular Design:
- Supports multiple chatbots integrated into a single platform.
-
Frontend:
- ReactJS/HTML for user interface.
- Features include image upload and chatbot interaction.
-
Backend (Flask):
- REST API endpoints for:
- Image upload and classification.
- Chatbot communication.
- Modular architecture to manage multiple chatbots.
- REST API endpoints for:
-
Image Processing:
- OpenCV used for preprocessing and classification.
- Model trained on labeled animal datasets using TensorFlow/PyTorch.
-
Chatbot (RAG Model):
- Retrieval-Augmented Generation model trained on a custom animal dataset.
- Combines a retriever for finding relevant knowledge and a generator for answering queries.
-
Database:
- MongoDB for storing:
- Images and metadata.
- User queries and session history.
- MongoDB for storing:
- Python 3.8+
- MongoDB
- Node.js (for frontend)
- OpenCV
- TensorFlow/PyTorch
- Flask
-
Clone the Repository:
git clone https://github.com/username/animal-classification-chatbot.git cd animal-classification-chatbot
-
Set Up Backend:
- Install Python dependencies:
pip install -r requirements.txt
- Run the Flask server:
python app.py
- Install Python dependencies:
-
Set Up Frontend:
- Navigate to the frontend directory:
cd frontend
- Install dependencies and start the frontend:
npm install npm start
- Navigate to the frontend directory:
-
Run MongoDB:
- Ensure MongoDB is running locally or use a cloud-based MongoDB instance.
-
Upload Image:
- Navigate to the frontend.
- Upload an animal image.
- The backend processes the image and returns the classification result.
-
Interact with Chatbot:
- Ask questions about animals (e.g., "Tell me about lions").
- The chatbot fetches relevant information from the custom knowledge base and provides detailed answers.
- POST
/classify
- Input: Image file
- Output: Classified animal name and confidence score.
- POST
/chatbot
- Input: User query
- Output: Chatbot response.
- Frontend: ReactJS, HTML, CSS
- Backend: Flask, OpenCV, TensorFlow/PyTorch
- Database: MongoDB
- Chatbot: Custom RAG model
- Add live camera feed processing for real-time animal classification.
- Enhance chatbot with multilingual support.
- Deploy the system on cloud platforms like AWS/GCP for scalability.
- Integrate user authentication for personalized experiences.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License. See LICENSE
for more details.
Kuch aur customize karna ho toh bolna, bhai! 😊