Sheep Detection

Sheep Detection
Photo by Süha Eryaşar on Dribbble

The main use of this application is to do sheep detection from the image, which can then be used for many purposes like counting sheep and keeping track of the sheep in the yard.
It will help farms to maintain a proper record of there sheep too.

So, Lets get started

Dataset:

https://www.kaggle.com/intelecai/sheep-detection

This dataset contains 203 images of sheep. Mainly, Sheep images with bounding box annotations in Pascal VOC format

Now lets have a look at the necessary imports

Data Augmentation

Since we are not having many images we need to apply data augmentation

Data augmentation helps us by duplicating images while applying tilt, rotations and other methods which does not tamper with the main object but changes it a bit thereby keeping the main goal intact.

Lets have a look at the samples

Samples
Samples

Model

Resulting Model

Resulting Model
Resulting Model

This model is then trained using binary cross entropy using Adam with the learning rate of 0.0001. Also callbacks are used to introduce early stopping. With the help of early stopping we stop the model from further training by monitoring defined parameters.

Result

As you can see you the model has reached more than 90% accuracy allowing us to predict whether the sheep is in the image on not.

Model Accuracy
Model Accuracy

Predictions

Lets have a look at the predictions

Predicted: Yes
Predicted: Yes

Notebook Link : Here

Credit: vishal yadav

Also Read: Road Crack Detection