Check out the code for this project here
Building a Bird Species Identifier
After I finished my AI courses on Kaggle (check them out on the qualifications tab) I wanted to put what I had learned in the tutorials into practice. I decided to try and make a deep learning model that would be able to identify bird species. The motivation for this was to try and practice what I had just learned to help me consolidate the skills. The reason that I chose birds is partly because there was a good dataset on Kaggle I could use but also because I think they are cool and there are a lot of different bird species.
Bird watching and identification is also something that is popular among humans as a hobby. So I wanted to see if a computer could match the bird-spotting ability of people who had been doing it as a hobby for a long time. This project also demonstrates to me the real power of neural networks. Many of these bird images it was trained on look very similar showing that the AI is picking up on very nuanced details, which I think is very impressive.
(credit)
The Dataset and Tech Stack
I used the subset of the massive iNaturalist dataset on Kaggle which contained around 200,000 images of various bird species.
The python libraries I used for this project were:
- TensorFlow & Keras
- Pandas & NumPy
I chose these as they are very popular and also this is what I had learned to use throughout the Kaggle courses I had done.
How the project is structured
Firstly I structured the data with one-hot encoding where I would have a column for each bird species where it would have a 1 if that row was for that species and a 0 if not. Then I split the dataset into a training and testing set by 80% an 20% respectively. Then I further split the training set by 20% to get a validation set.
Then I normalised the images so I changed the pixels from being between 0 and 255 to being between 0 and 1 as the neural network handles this much better. Then I resized all the images so they were the same size of 244 by 244 pixels. Then I transformed the data into batches and shuffled the training data.
Then I used the MobileNetV2 base model from tensorflow then I added a global average pooling layer to condense the features. Then I also added a dropout layer to help prevent overfitting. Then I added a final dense normal neural net layer with a softmax activation function. I then rand the training and visualised the loss curves.
What's Next?
If I were to go back to this project here are some ways I would improve and add to it:
- Data Augmentation: I would add data augmentation where I would randomly rotate images, zoom in and out and adjust the brightness. This would give the model more generalisation and make it more robust. Particularly when working with actual images taken by bird watchers which can be fuzzy or low quality.
- Deployment as a Web App: I would deploy this as a user friendly webapp so that hobbyist bird watchers could easily upload photos and identify birds. This would allow them to easily check if they are correct in an identification and also would give me an opportunity to practice webs development further.
This project was great fun and really allowed me to consolidate the skills I had learned over the various Kaggle AI courses I had done.