基于边界脊线识别的群养猪黏连图像分割方法

    Group-housed pigs image segmentation method by recognizing watershed ridge lines on boundary

    • 摘要: 猪体图像的前景分割和黏连猪体的分离是实现群养猪数量自动盘点和猪只个体行为智能识别的关键。为实现群养猪黏连图像的自动分割,该文采用决策树分割算法提取视频图像帧的猪体前景区域,计算各连通区域的复杂度,根据复杂度确定黏连猪体区域,利用标记符控制的分水岭分割算法处理黏连猪体图像,检测待选的边界脊线,通过检验待选边界脊线的分割效果和形状特征(包括线性度和Harris拐点数目),识别出猪体黏连分割线,实现黏连猪体的分离。结果表明,决策树分割算法(decision-tree-based segmentation model,DTSM)能够有效地去除复杂背景,前景分割效果良好。黏连猪体分离结果显示,基于边界脊线识别的黏连猪体分离准确率达到了89.4%,并较好地保留了猪体轮廓。通过计算分割后猪体连通区域的中心点,并对中心点进行德洛内剖分,初步实现了猪只的定位和栏内分布的可视化。6 min的监控视频处理结果显示,该文方法各帧图像的盘点平均误差为0.58,盘点准确率为98.33%,能够正确统计出栏内猪只数量。该研究可为实现基于监控视频的群养猪自动盘点和个体行为识别提供新的技术手段。

       

      Abstract: With increasing awareness and strict regulation of environmental protection, swine production management is becoming more and more intensified. The development of large-scale farming has brought new challenges to breeding managers. Manual pig counting and recognition of pigs' abnormal behaviors are becoming difficult in larger-scale farm. Automatic counting and pig behavior recognition can save manpower and greatly improve management efficiency. Image segmentation and splitting of touching pigs is the key to realize automatic counting and behavior recognition in group-housed pigs. In this study, the methods of pig image segmentation based on decision trees and splitting of touching pigs by recognizing watershed ridge lines on the boundary were proposed. The experiments were carried out in a commercial pig breeding farm belongs to one partner of Chengdu Ruixu Electronic Technology Co. Ltd.. A Hikvision camera was set above a pen at the height of 3 m relative to the ground. Six min video of group-housed pigs was recorded on August 16th, 2018. Frame rate was 25 frame/s. Image frames extracted from the video were processed in a computer (configured with Intel Core i7-4790 CPU (central processing unit), 3.6 GHz) with Matlab R2017a. The image processing mainly included foreground pigs segmentation and splitting of touching pigs. The foreground pigs were segmented by using Decision-Tree-based Segmentation Model (DTSM). After foreground pigs segmentation, the images were used for splitting of touching pigs. Firstly, touching pigs' connected regions were extracted by evaluating the complexity of each connected region. Secondly, the candidates of segmentation lines were detected by marker-controlled watershed segmentation. Thirdly, segmentation lines were determined by their segmentation performance and shape descriptors, including linearity and total number of Harris corners. Finally, selected segmentation lines were used to split the touching pigs and automatic counting was conducted. To evaluate the segmentation performance of DTSM, the segmentation results of DTSM were compared with the results of Otsu and Maximum entropy methods. Twenty five image frames with touching pigs were analyzed to evaluate the performance of segmentation lines recognition. To evaluate the performance of automatic counting, 60 image frames extracted from the video in a 6 s time interval were processed. The result of foreground pigs segmentation indicated that DTSM could remove the complex background effectively and achieved better segmentation performance than Otsu and Maximum entropy methods. The segmentation accuracy (SR) of watershed ridge lines recognition was 89.4%. The contours of separated touching pigs were well saved. The segmentation missing rate (SMR) was 30%, Because pig bodies were heavily overlapped by others in three image frames, this made the recognition of segmentation lines become difficult. SMR was 5.3% if the three image frames were removed from the total 25 images frames used for the recognition of segmentation lines. Location and distribution in pens of group-housed pigs can be obtained by calculating the centroid of connected area and Delaunay triangulation method. Counting mean error (CME) was 0.58, root mean square error (RMSE) was 0.89, average counting time (ACT) was 0.39 s and counting accuracy (CA) was 98.33%. The results showed that this method could be used to automatically count the total number of pigs in pens which was valuable information for breeders and managers in large-scale farming. By locating an individual pig in a pen continuously, trajectory can be plotted and its behaviors can be recognized. This study provides a new method to realize automatic counting and behavior recognition in group-housed pigs.

       

    /

    返回文章
    返回