Austen Frostad of IntelliTect was searching for the perfect gift for his mom for Mother’s Day this year and decided that it might be nice to personally make her something that would be useful in her everyday life. As we all know, nothing says “I love you” to a mother more than a well-trained machine learning model. And as it turns out, Frostad’s mom has a much-loved garden, and also some much-loved chickens, but the two do not make a great pair. When the chickens get near the garden they scratch and peck, leaving a path of destruction in their wake.
Frostad got the idea to build a machine learning-powered device that would be able to detect chickens. By sounding an alarm when a chicken was in an off-limits area, Frostad’s mom would be able to chase the chickens off and save the garden. Such a solution would save her from having to constantly keep watch over the chickens every time they were let out of their enclosure.
It was important to Frostad that the project not take too much time, so his first thought was to use a Raspberry Pi for the hardware platform. But since all of his Raspberry Pi computers were already being used for other projects, he chose to use an older Android phone instead. Not having much previous experience with machine learning tools, he decided to try Microsoft’s Custom Vision platform to simplify building an object detection model.
After taking about 150 sample photos of chickens in his mom’s yard and training an object detection model, the device was up and running. The phone simply ran a loop in which it captured an image, sent it to a Custom Vision API endpoint, then decided whether or not to sound an alarm based on the result returned (i.e. chicken or no chicken). This solution performed well, but was not without its issues.
The main problems were that Custom Vision is not free to use, and the home where the device was installed did not have a reliable internet connection, which was needed for communication with Custom Vision. These factors led Frostad to use TensorFlow Lite so that a model would be able to run locally on the phone, without the need for an internet connection, and without a bill from Microsoft every month. Since he was not familiar with the tools, however, this took a lot of time and effort (as well as frustration) to get up and running. In the end his efforts did pay off in the form of a perfectly working chicken detector and a very happy mother.
Next, Frostad is considering ways to automatically deter chickens from staying in the forbidden zone after an alarm has occurred. For now, a low-tech solution is in place — the family dogs have learned to associate the device’s alarm with chickens, and they make sport of chasing the chickens off when they hear it. Not a bad outcome at all… machines and dogs both trained with TensorFlow Lite.
The project write-up has some additional tidbits that you may find useful. And if you just happen to be in the market for a chicken detector, Frostad has made the source code of his project available at GitHub.