This project aims to detect bird species using a Convolutional Neural Network (CNN). The model was trained on six categories, including five bird species and one category for 'no bird detected'. The project includes resources for training the model and using it for detection with two different implementations:
- Using a webcam as a source: This implementation is suitable for testing the model in a controlled environment.
- Using an ESP32 camera as a source: The ESP32 camera can be integrated with a Raspberry Pi (or a computer) to enable remote bird detection using its WiFi functionality.
bird-species-detection/
│
├── model_training/
│ ├── train/ (to be downloaded from kaggle, link below)
│ ├── test/ (to be downloaded from kaggle, link below)
│ ├── val/ (to be downloaded from kaggle, link below)
│ ├── train_model.ipynb
│
├── esp32_cam-setup/
│ ├── esp-cam-setup.ino/
│
├── src/
│ ├── models/
│ │ ├── birdclassifier95.keras (to be downloaded, see instructions below)
│ ├── bird_detected_webcam.csv
│ ├── bird_detected_esp.csv
│ ├── detect_with_webcam.py
│ ├── detect_with_esp32.py
│
├── README.md
├── LICENSE
- Code editor for Python (to execute Jupyter Notebooks and python scripts)
- Arduino IDE (needed for ESP32 setup)
- Python 3.x
- TensorFlow
- OpenCV
- Numpy
- Time
- CSV
- Requests
- Matplotlib
- Scikit Learn
- OS
- Libraries for ESP32 Cam:
- Download the dataset from Kaggle: Kaggle Dataset Link
- Place the downloaded images into the respective folders (
train
,test
,val
) inside themodel_training
directory. This allows you to run the Jupyter notebook with the dataset.
- Open the
train_model.ipynb
notebook in themodel_training
directory. - Ensure the dataset is properly placed as described above.
- Run the notebook to train the CNN model.
To use the pre-trained model:
- Download the pre-trained model from Google Drive: Download birdclassifier95.keras
- Place the downloaded model file in the
models
folder inside thesrc
directory.
- Ensure you have the required dependencies installed.
- Navigate to the
src
directory. - Run the following command:
python detect_with_webcam.py
- Setup the ESP32 cam module (using 'esp32_cam-setup' directory and Arduino IDE)
- Ensure the libraries for esp32 are imported to IDE
- Modify the Wi-fi credentials in 'esp-cam-setup.ino' file as needed
- Upload 'esp-cam-setup.ino' to esp32 cam from computer
- Once the connection with wifi is sucessful, get the link for esp32 cam stream from serial monitor
- Modify the link (line 35 in the python script 'detect_with_esp32.py' : url = 'http://192.168.17.149/cam-mid.jpg')
- Navigate to the
src
directory. - Run the following command:
python detect_with_esp32.py
- Dataset: Kaggle Dataset
- CNN Model Training: Youtube
- ESP32 Cam Setup: Youtube