Skip to content

unknown7751/DogBreedDetector

Repository files navigation

🐕 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.

🌟 Features

  • 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

🐶 Supported Dog Breeds

The model can predict the following 10 dog breeds:

  • Beagle
  • Boxer
  • Bulldog
  • Dachshund
  • German Shepherd
  • Golden Retriever
  • Labrador Retriever
  • Poodle
  • Rottweiler
  • Yorkshire Terrier

🛠️ Technologies Used

  • Python 3.x
  • TensorFlow/Keras: Deep learning framework for the CNN model
  • Streamlit: Web application framework
  • Pillow (PIL): Image processing
  • NumPy: Numerical computations

📋 Prerequisites

  • Python 3.8 or higher
  • pip package manager

🚀 Installation

  1. Clone the repository

    git clone https://github.com/unknown7751/DogBreedDetector.git
    cd DogBreedDetector
  2. Create a virtual environment (recommended)

    python -m venv venv
  3. Activate the virtual environment

    • On Windows:
      .\venv\Scripts\Activate.ps1
    • On macOS/Linux:
      source venv/bin/activate
  4. Install dependencies

    pip install -r requirements.txt

💻 Usage

  1. Start the Streamlit application

    streamlit run main.py
  2. Open your browser

    • The app will automatically open at http://localhost:8501
    • If it doesn't open automatically, navigate to the URL manually
  3. 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

📁 Project Structure

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)

🧠 Model Details

  • Architecture: Convolutional Neural Network (CNN)
  • Input Size: 150x150 pixels
  • Output: 10 classes (dog breeds)
  • Format: Keras H5 model file

The model preprocesses images by:

  1. Resizing to 150x150 pixels
  2. Normalizing pixel values (0-1 range)
  3. Expanding dimensions for batch processing

📊 Model Training

The model was trained using the notebook Dog_Breed_Prediction.ipynb. To retrain or fine-tune the model:

  1. Open the Jupyter notebook
  2. Follow the training steps
  3. Save the new model as dog_breed_classifier_model.h5

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 Future Enhancements

  • 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

👨‍💻 Author

unknown7751

🙏 Acknowledgments

  • 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!

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors