Publications
Sort:
Issue
Automatic Measurement Method of Beef Cattle Body Size Based on Multimodal Image Information and Improved Instance Segmentation Network
Smart Agriculture 2024, 6(4): 64-75
Published: 30 July 2024
Abstract PDF (79.1 MB) Collect
Downloads:56
Objective

The body size parameter of cattle is a key indicator reflecting the physical development of cattle, and is also a key factor in the cattle selection and breeding process. In order to solve the demand of measuring body size of beef cattle in the complex environment of large-scale beef cattle ranch, an image acquisition device and an automatic measurement algorithm of body size were designed.

Methods

Firstly, the walking channel of the beef cattle was established, and when the beef cattle entered the restraining device through the channel, the RGB and depth maps of the image on the right side of the beef cattle were acquired using the Inter RealSense D455 camera. Secondly, in order to avoid the influence of the complex environmental background, an improved instance segmentation network based on Mask2former was proposed, adding CBAM module and CA module, respectively, to improve the model's ability to extract key features from different perspectives, extracting the foreground contour from the 2D image of the cattle, partitioning the contour, and comparing it with other segmentation algorithms, and using curvature calculation and other mathematical methods to find the required body size measurement points. Thirdly, in the processing of 3D data, in order to solve the problem that the pixel point to be measured in the 2D RGB image was null when it was projected to the corresponding pixel coordinates in the depth-valued image, resulting in the inability to calculate the 3D coordinates of the point, a series of processing was performed on the point cloud data, and a suitable point cloud filtering and point cloud segmentation algorithm was selected to effectively retain the point cloud data of the region of the cattle's body to be measured, and then the depth map was 16. Then the depth map was filled with nulls in the field to retain the integrity of the point cloud in the cattle body region, so that the required measurement points could be found and the 2D data could be returned. Finally, an extraction algorithm was designed to combine 2D and 3D data to project the extracted 2D pixel points into a 3D point cloud, and the camera parameters were used to calculate the world coordinates of the projected points, thus automatically calculating the body measurements of the beef cattle.

Results and Discussions

Firstly, in the part of instance segmentation, compared with the classical Mask R-CNN and the recent instance segmentation networks PointRend and Queryinst, the improved network could extract higher precision and smoother foreground images of cattles in terms of segmentation accuracy and segmentation effect, no matter it was for the case of occlusion or for the case of multiple cattles. Secondly, in three-dimensional data processing, the method proposed in the study could effectively extract the three-dimensional data of the target area. Thirdly, the measurement error of body size was analysed, among the four body size measurement parameters, the smallest average relative error was the height of the cross section, which was due to the more prominent position of the cross section, and the different standing positions of the cattle have less influence on the position of the cross section, and the largest average relative error was the pipe circumference, which was due to the influence of the greater overlap of the two front legs, and the higher requirements for the standing position. Finally, automatic body measurements were carried out on 137 beef cattle in the ranch, and the automatic measurements of the four body measurements parameters were compared with the manual measurements, and the results showed that the average relative errors of body height, cross section height, body slant length, and tube girth were 4.32%, 3.71%, 5.58% and 6.25%, respectively, which met the needs of the ranch. The shortcomings were that fewer body-size parameters were measured, and the error of measuring circumference-type body-size parameters was relatively large. Later studies could use a multi-view approach to increase the number of body rule parameters to be measured and improve the accuracy of the parameters in the circumference category.

Conclusions

The article designed an automatic measurement method based on two-dimensional and three-dimensional contactless body measurements of beef cattle. Moreover, the innovatively proposed method of measuring tube girth has higher accuracy and better implementation compared with the current research on body measurements in beef cattle. The relative average errors of the four body tape parameters meet the needs of pasture measurements and provide theoretical and practical guidance for the automatic measurement of body tape in beef cattle.

Issue
CSD-YOLOv8s: Dense Sheep Small Target Detection Model Based on UAV Images
Smart Agriculture 2024, 6(4): 42-52
Published: 30 July 2024
Abstract PDF (6.2 MB) Collect
Downloads:104
Objective

The monitoring of livestock grazing in natural pastures is a key aspect of the transformation and upgrading of large-scale breeding farms. In order to meet the demand for large-scale farms to achieve accurate real-time detection of a large number of sheep, a high-precision and easy-to-deploy small-target detection model: CSD-YOLOv8s was proposed to realize the real-time detection of small-targeted individual sheep under the high-altitude view of the unmanned aerial vehicle (UAV).

Methods

Firstly, a UAV was used to acquire video data of sheep in natural grassland pastures with different backgrounds and lighting conditions, and together with some public datasets downloaded formed the original image data. The sheep detection dataset was generated through data cleaning and labeling. Secondly, in order to solve the difficult problem of sheep detection caused by dense flocks and mutual occlusion, the SPPFCSPC module was constructed with cross-stage local connection based on the you only look once (YOLO) v8 model, which combined the original features with the output features of the fast spatial pyramid pooling network, fully retained the feature information at different stages of the model, and effectively solved the problem of small targets and serious occlusion of the sheep, and improved the detection performance of the model for small sheep targets. In the Neck part of the model, the convolutional block attention module (CBAM) convolutional attention module was introduced to enhance the feature information capture based on both spatial and channel aspects, suppressing the background information spatially and focusing on the sheep target in the channel, enhancing the network's anti-jamming ability from both channel and spatial dimensions, and improving the model's detection performance of multi-scale sheep under complex backgrounds and different illumination conditions. Finally, in order to improve the real-time and deploy ability of the model, the standard convolution of the Neck network was changed to a lightweight convolutional C2f_DS module with a changeable kernel, which was able to adaptively select the corresponding convolutional kernel for feature extraction according to the input features, and solved the problem of input scale change in the process of sheep detection in a more flexible way, and at the same time, the number of parameters of the model was reduced and the speed of the model was improved.

Results and Discussions

The improved CSD-YOLOv8s model exhibited excellent performance in the sheep detection task. Compared with YOLO, Faster R-CNN and other classical network models, the improved CSD-YOLOv8s model had higher detection accuracy and frames per second (FPS) of 87 f/s in the flock detection task with comparable detection speed and model size. Compared with the YOLOv8s model, Precision was improved from 93.0% to 95.2%, mAP was improved from 91.2% to 93.1%, and it had strong robustness to sheep targets with different degree of occlusion and different scales, which effectively solved the serious problems of missed and misdetection of sheep in the grassland pasture UAV-on-ground sheep detection task due to the small sheep targets, large background noise, and high degree of densification. misdetection serious problems. Validated by the PASCAL VOC 2007 open dataset, the CSD-YOLOv8s model proposed in this study improved the detection accuracy of 20 different objects, including transportation vehicles, animals, etc., especially in sheep detection, the detection accuracy was improved by 9.7%.

Conclusions

This study establishes a sheep dataset based on drone images and proposes a model called CSD-YOLOv8s for detecting grazing sheep in natural grasslands. The model addresses the serious issues of missed detections and false alarms in sheep detection under complex backgrounds and lighting conditions, enabling more accurate detection of grazing livestock in drone images. It achieves precise detection of targets with varying degrees of clustering and occlusion and possesses good real-time performance. This model provides an effective detection method for detecting sheep herds from the perspective of drones in natural pastures and offers technical support for large-scale livestock detection in breeding farms, with wide-ranging potential applications.

Total 2