Dol-sensors, a Danish company developing sensors for agriculture, is launching a 3D camera to monitor the weight of pigs. Powered by tailor-made Machine Learning software the camera allows the pig farmer to determine the exact time to ship the animals. Data Respons Solutions has contributed a robust single board computer to the new pig weighing technology, while TechPeople added Linux skills to the mix.

A specially developed and trained Machine Learning algorithm enables the iDOL 65 camera to determine the weight of an animal with 2,7 per cent accuracy. This impressive precision has been achieved by training the system on 3.7 mill. images.

– We are the first to achieve that degree of precision, although the idea to determine the weight of a pig with a camera has been around for about 20 years. But the training part has been the Achilles heel of other attempts to develop similar systems, says Kartheeban Nagenthiraja, Director of dol-sensors, a company with 40+ years of experience in the agricultural sensor industry, producing more than 250.000 sensors a year.

According to Kartheeban Nagenthiraja a vision system can make a significant difference for the pig farmer, both in deciding what compound feed to use, and to predict when the animals have gained the correct weight to be shipped to the slaughterhouse.

RFID ear mark

But getting enough data to train the algorithm to perform well – that has been the main challenge. It’s fairly easy to get visual data from for instance 15 animals, but that will get you nowhere. So, when we began working on the software part of the camera about three years ago, we put a lot of thought into how to provide the right data. Not only do you need a lot of images. You also need to know the exact weight of the animal, and attach it to the right image, Kartheeban Nagenthiraja explains.

The dol-sensors development team came up with a solution: Putting an ear mark with an RFID chip on a large number of pigs, and placing a camera and an RFID reader close to the pig feeding system. Furthermore they installed a scale with another RFID reader to determine the weight of each animal. This setup allowed them to perform an automatic data collection of both visual and weight data and connect the both.

Our goal was to achieve 3 per cent precision, meaning that the system should be able to assess a 100 kg animal to weigh between 97 and 103 kg. We achieved that goal. Currently our precision is 2,7 per cent and we are working on fine-tuning our algorithm to make it even more precise. We have designed the camera so that we can update it remotely with new versions of the software.

The iDOL 65 camera 

Encapsulated hardware

Just like the software part of the system, the hardware wasn’t straightforward either. Firstly, the camera had to be designed to withstand the environment in a pigsty, with dust and ammonia etc., requiring the electronics to be thoroughly encapsulated. Secondly, as an average pig farmer would need 30 to 40 cameras the device itself had to low-price, while still being made of industrial-grade components.

We started out with an Intel camera and a Firefly single board computer bought from Alibaba, development engineer and project manager Martin Svalgaard explains.

We kept most of the camera, but we soon realized we needed a better board. Data Respons Solutions was able to provide us with the right item at the right price. The iDOL 65 runs an ARM single board computer, an IMX8-based NXP system with an Intel based camera solution, and with sufficient headroom for future upgrades. Data Respons did a good job, and we’re very satisfied to work with them. 

Furthermore, the development team worked closely together with a TechPeople software engineer and Linux specialist to connect the hardware drivers to the application layer, and to integrate the Linux layer into the version control system. The device uses NXP’s configuration of a Linux distribution. Also, the TechPeople software engineer built a strong encryption layer around the unique iDOL 65 image recognition software, to prevent competitors from gaining unauthorized access to the software. Secure booting and encrypted software image technologies were used to secure the file systems on the Linux machine, including security measures were put in place to ensure correct authorisation in regards to software updates.

Unexpected problems

Developing the device the dol-sensors engineers had to solve a few unexpected problems. For instance fly droppings. Flies are attracted to warm places, and as the device heats up while operating the tiny black dots coming from fly droppings reduce the performance of the camera.

Henrik Kai, TechPeople consultant and Linux specialist

We changed placement of electronics, camera, heatsinks and mainly mechanical design using heat simulations, Martin Svalgaard explains.

The mechanical design is made to spread the heat on the front, and to minimize the heat coming from the camera lens. This reduces the attraction of flies to the camera lens.

According to dol-sensors, a pig farmer using the full potential of the iDOL 65 camera system will be able to make an additional profit of 70 dkr. (9 euros) per pig.

The additional profit comes from both being able to ship livestock at the optimal time and weight, and from optimizing various processes, for instance determining how and when to adjust compound feed.

In the future the dol-sensors development team is planning to look into using the collected data for not only determining a pig’s weight, but also to determine its wellbeing, for instance by analysing movement patterns and other parameters.

Dol-sensors foresee that the introduction of the camera will ramp-up over the next 5 years, and it will be incorporated into dol-sensors’ own farm management system, and sold as an OEM product for other integrators in the farm management industry.