融合注意力机制的个体猪脸识别

    Individual pig face recognition combined with attention mechanism

    • 摘要: 随着机器视觉技术的发展,猪脸识别作为猪只个体识别方法之一受到广泛关注。为了探索非接触式的猪只个体精准识别,该研究通过深度学习模型DenseNet融合CBAM(Convolutional Block Attention Module),建立改进的DenseNet-CBAM模型对猪脸进行识别。将DenseNet121模型进行精简,然后将CBAM注意力模块嵌入到精简的DenseNet121分类网络之前,以加强对关键特征的提取,实现猪脸图像的分类。以随机采集的1 195张猪脸图像作为数据集对本文模型进行测试。结果表明,DenseNet-CBAM模型对个体猪脸识别的准确率达到99.25%,模型参数量仅为DenseNet121的1/10;与ResNet50、GoogLeNet和MobileNet模型相比,DenseNet-CBAM的识别准确率分别提高了2.18、3.60和23.94个百分点。研究结果可为智能化养殖过程非接触式个体识别提供参考。

       

      Abstract: An invasive Radio Frequency Identification (RFID) technology has been widely used for pig identification at present. However, some stress has been exerted on pigs under the examination, particularly easy to drop off during operation. Therefore, it is a high demand for low-cost and non-invasive individual identification using image or video approach. Among them, pig face recognition has received extensive attention with the development of machine vision. Deep neural networks can be expected with great porential to improve the accuracy of the identification models, although there are still some challenges, like the massive parameters, time consuming, and higher hardware dependency. Many attempts have been made to build the Convolutional Neural Network (CNN) models with high performances in animal farm production. However, only a few studies focused on the deep neural networks to classify the pigs using facial images. Fortunately, the structure of DenseNet can be characterized by continuously passing the previous features backwards, leading to the reused features for a higher accuracy of image classification than before. At the same time, the attention mechanism can be selected to effectively reduce the interference of the extra information. DenseNet can be widely expected to combine with the attention mechanism to achieve individual identification. In this study, a pig face recognition model with the integrated DenseNet and attention mechanism was proposed, named DenseNet-CBAM. The CBAM attention module was embedded before a simplified model of DenseNet121 was used to strengthen the extraction of key features of pig face images. The dataset was taken randomly from the video of eight pig faces, where a total of 5 958 images were extracted. Training set, validation set and test set were divided according to the ratio of 6:2:2. Among them, 3 570 images and 1 193 images were used for the model training and verifying, respectively, and 1 195 images were used for the model testing. In addition, the class activation heatmaps on the pig face image directly generated the visual effects on classification and feature extraction for an optimal model selection. A novelty quantitative standard was established to calculate the thermal red area, which was the key feature during the identification. The percentage called coverage (cr) of the red area in the heatmap covering the pig face was used to measure the performance of the attention module in different feature extraction models. The results showed that the average accuracy, average recall, and average precision of the DenseNet-CBAM model for the pig face recognition were 99.25%, 99.20%, and 99.20%, respectively. Notably, the parameter amount of the model was only one-tenth of DenseNet121. The accuracy of pig face recognition increased by 2.18, 3.60 and 23.94 percentage points, respectively, compared with the conventional deep neural networks like ResNet50, GoogLeNet, and MobileNet. In the CBAM attention module, the deep learning network greatly contributed to focusing on the important information which was useful for classification, further improvving the overall performance of the pig face recognition model. The interested region of the classification was mainly concentrated on the pig nose for the distribution of high-temperature regions in the class activation maps when the pig face images were used for the individual identification. Therefore, the CBAM-DenseNet can be used as a pig face recognition model to achieve the purpose of classifying pig individuals. The finding can provide a strong reference for the non-invasive individual recognition in pig farm production.

       

    /

    返回文章
    返回