🐕 Dog Breed Detector 🔗link
A machine learning web application that predicts dog breeds from images using deep learning. Built with TensorFlow and Streamlit for an interactive user experience.
- Real-time Prediction: Upload an image and get instant breed predictions
- 10 Dog Breeds Supported: Accurately identifies popular dog breeds
- Confidence Score: Shows prediction confidence percentage
- User-Friendly Interface: Clean, intuitive Streamlit web interface
- Fast Processing: Optimized model loading with caching
The model can predict the following 10 dog breeds:
- Beagle
- Boxer
- Bulldog
- Dachshund
- German Shepherd
- Golden Retriever
- Labrador Retriever
- Poodle
- Rottweiler
- Yorkshire Terrier
- Python 3.x
- TensorFlow/Keras: Deep learning framework for the CNN model
- Streamlit: Web application framework
- Pillow (PIL): Image processing
- NumPy: Numerical computations
- Python 3.8 or higher
- pip package manager
-
Clone the repository
git clone https://github.com/unknown7751/DogBreedDetector.git cd DogBreedDetector -
Create a virtual environment (recommended)
python -m venv venv
-
Activate the virtual environment
- On Windows:
.\venv\Scripts\Activate.ps1
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install dependencies
pip install -r requirements.txt
-
Start the Streamlit application
streamlit run main.py
-
Open your browser
- The app will automatically open at
http://localhost:8501 - If it doesn't open automatically, navigate to the URL manually
- The app will automatically open at
-
Upload and Predict
- Click on "Choose an image..." to upload a dog image
- Supported formats: JPG, JPEG, PNG
- Click the "Predict" button to get the breed prediction
- View the predicted breed and confidence score
DogBreedDetector/
│
├── main.py # Streamlit web application
├── dog_breed_classifier_model.h5 # Pre-trained model file
├── Dog_Breed_Prediction.ipynb # Jupyter notebook for model training
├── requirements.txt # Python dependencies
├── README.md # Project documentation
└── venv/ # Virtual environment (not in repo)
- Architecture: Convolutional Neural Network (CNN)
- Input Size: 150x150 pixels
- Output: 10 classes (dog breeds)
- Format: Keras H5 model file
The model preprocesses images by:
- Resizing to 150x150 pixels
- Normalizing pixel values (0-1 range)
- Expanding dimensions for batch processing
The model was trained using the notebook Dog_Breed_Prediction.ipynb. To retrain or fine-tune the model:
- Open the Jupyter notebook
- Follow the training steps
- Save the new model as
dog_breed_classifier_model.h5
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Add support for more dog breeds
- Implement batch image processing
- Add model accuracy metrics display
- Include example images for testing
- Deploy to cloud platform (Streamlit Cloud, Heroku, etc.)
- Add data augmentation for improved accuracy
unknown7751
- GitHub: @unknown7751
- Repository: DogBreedDetector
- TensorFlow and Keras teams for the deep learning framework
- Streamlit team for the excellent web framework
- Dog breed dataset Kaggle
⭐ If you found this project helpful, please consider giving it a star!