Embedded vision prototype for livestock weight monitoring
Barkom Ltd. is a Ukrainian agricultural company that specializes in growing pigs and cattle and selling self-produced food products.
Weight is an important indicator of a pig’s health, which makes regular weight monitoring vital to pig farming. But manual weighing is labor-intense, especially on large farms; it takes multiple people and many hours to weigh animals one by one — not to mention doing it daily.
This issue prompted Barkom to find a solution for automated, remote, and daily pig weight monitoring.
Our team of data scientists and embedded engineers have designed and built a computer vision prototype for automated weight monitoring in farm pigs.
Based on a complex of non-iterative neural networks and an innovative image recognition algorithm, our prototype allows visual estimation of the animal weight. To train the algorithm, we’ve also designed a custom hardware system for training data collection and preprocessing.
This prototype is the first-of-a-kind system, which means that we didn’t have many market references and acquired most of the necessary knowledge through trial and error.
The main challenge we came against was a complete absence of training data. That’s why our first step was to build a hardware data collection system to place on the farm. The system includes a regular scale with two stereo cameras attached above.
Our vision was that when a pig steps on the scale, the cameras above it would take an image of the pig’s back. Then, the weight from the scale would be automatically assigned to the image, and we would have an image-weight record in the database. With enough records of this kind, we would be able to build a weight recognition algorithm.
While working on the hardware, we discovered more challenges, like pigs sleeping on the scale, multiple pigs stepping on the scale at the same time, feces that cover the scale floor reflecting light into the cameras and distorting images, etc. All these challenges made the hardware building process iterative and forced us to change its design multiple times. It took us several months to get the first good image.
Once the hardware was ready, our data scientists started working on the weight recognition algorithm. We tried several approaches, including neural networks and mathematical modeling, and in the end, settled on a complex of non-iterative neural networks combined with a custom image recognition algorithm. This approach provides a near-2% recognition accuracy on manually cleaned and pre-processed data.
Our next steps are to automate data cleaning and processing, which would allow us to start real-time training the algorithm on raw data.