Detection of Dairy Cow Mastitis From Thermal Images by Data Enhancement and Improved ResNet34
ZHANG Qian1, YANG Ying1*, LIU Gang1, 2, 3, WU Xiao1, NING Yuan-lin1
1. College of Information and Electrical Engineering, China Agricultural University, Beijing 100083, China
2. Key Laboratory of Modern Precision Agriculture System Integration Research, Ministry of Education, Beijing 100083, China
3. Key Laboratory of Agricultural Information Acquisition Technology, Ministry of Agriculture, Beijing 100083, China
Abstract:Mastitis is one of the most serious diseases in dairy production and breeding. The early detection of cow mastitis can provide the basis for follow-up treatment to improve the efficiency of disease treatment and reduce the risk of breeding. In order to realize fast and high-precision “one-step” mastitis disease detection for naturally walking dairy cows, a dairy cow mastitis disease detection method based on the thermal infrared image, data enhancement and improved ResNet34 is proposed in this paper. Compared with the existing “multi-step” dairy cow infrared image mastitis detection method, this method does not need the positioning of key parts of dairy cows, such as breast and eyes and temperature extraction, which can effectively avoid the error accumulation caused by “multi-step”, to achieve more efficient mastitis detection. Firstly, this method horizontally splices the local pictures containing the key parts of the cow into an overall picture with complete information and expands the training samples combined with the RandAugment data enhancement method; Secondly, the ResNet34 residual network is used as the basic network of the experiment, and the model is improved as follows according to the characteristics of thermal infrared image: (1) simplify the redundant internal layer of the network to make the model lighter; (2) Auxiliary classifiersare added in the middle layer to make up for the feature loss caused by model simplification; (3) The improved multi fusion pool layer is used to replace the original single pool layer, which makes the content of feature extraction richer. Finally, 3 298 thermal infrared images (66 cows) were randomly selected as the experimental objects, and multiple groups of comparative experiments were set. The results showed that compared with the traditional ResNet34, the classification accuracy of the improved ResNet34 model was improved by 3.4%, the model verification accuracy based on the improved ResNet34 combined with transfer learning and data enhancement was 90.3%, the test accuracy was 88.4%, and the classification time was only 3.39×10-3 seconds. In addition, to ensure theindependence of the experimental data set, this paper further divides it into the training set, verification set and test set according to the number of dairy cows in 3∶1∶1. The test accuracy of the model was 80.3%, which proves that the proposed model has good robustness. According to the test results, it is calculated that the precision rate, recall rate and F1 score of the model are 91.2%, 91.6% and 91.4%. Compared with previous experiments, the accuracy is improved by 5.1% and the specificity is improved by 5.3%. In conclusion, this research method can provide a reference for screening and medical diagnosis of breast diseases in early dairy cows.
Key words:Transfer learning; ResNet34; Data enhancement; Thermal infrared image; Detection of mastitis in dairy cows
张 倩,杨 颖,刘 刚,吴 潇,宁远霖. 融合数据增强与改进ResNet34的奶牛热红外图像乳腺炎检测[J]. 光谱学与光谱分析, 2023, 43(01): 280-288.
ZHANG Qian, YANG Ying, LIU Gang, WU Xiao, NING Yuan-lin. Detection of Dairy Cow Mastitis From Thermal Images by Data Enhancement and Improved ResNet34. SPECTROSCOPY AND SPECTRAL ANALYSIS, 2023, 43(01): 280-288.
[1] PAN Yu-jing(潘宇静). Food Industry(食品界), 2021,(8): 2.
[2] CHEN Hui-jun, QI Zhi-li, DING Fang(陈慧君,齐智利,丁 芳). China Dairy Cattle(中国奶牛), 2021 (4): 31.
[3] DUAN Ju-gang(段巨刚). Graziery Veterinary Sciences: Electronic Version(畜牧兽医科学), 2020,(15): 51.
[4] GAO Xue-hu(高学虎). The Chinese Livestock and Poultry Breeding(中国畜禽种业), 2021, 17(3): 191.
[5] HUANG Fu-ting(黄福庭). Modern Animal Husbandry Science & Technology(现代畜牧科技), 2021,(1): 159.
[6] ZHOU Ya-ping, LIU Qin, SHI Kai-ping, et al(周亚平,刘 琴,施开平,等). China Dairy Cattle(中国奶牛), 2011,(4): 3.
[7] Caroline Viguier, Sushrut Arora, Niamh Gilmartin, et al. Trends in Biotechnology, 2009, 27(8): 486.
[8] Kucukonder, Hande, Uckardes, et al. Pakistan Veterinary Journal, 2015, 35(4): 441.
[9] Berry R J, Kennedy A D, Scott S L, et al. Canadian Journal of Animal Science, 2003, 83(4): 687.
[10] Mauro Zaninelli, Veronica Redaelli, Fabio Luzi, et al. Sensors, 2018, 18(3): 862.
[11] Bartolomé M J, Sánchez. Animal, 2013, 7(12): 2044.
[12] Sathiyabarathi M, Jeyakumar, et al. Indian Journal of Animal Sciences, 2018, 88(6): 694.
[13] Metzner M, Sauter-Louis C, Seemueller A, et al. The Veterinary Journal, 2014, 199(1): 57.
[14] ZHANG Xu-dong, KANG Xi, MA Li, et al(张旭东,康 熙,马 丽,等). Transactions of the Chinese Society for Agricultural Machinery(农业机械学报), 2019, 50(B07): 9.
[15] ZHOU Fei-yan, JIN Lin-peng, DONG Jun(周飞燕,金林鹏,董 军). Chinese Journal of Computers(计算机学报), 2017, 40(6): 1229.
[16] Xudong, Xi, Ningning, et al. Computers and Electronics in Agriculture, 2020, 178: 105754.
[17] WANG Yan-chao, KANG Xi, LI Meng-fei, et al(王彦超,康 熙,李孟飞,等). Transactions of the Chinese Society for Agricultural Machinery(农业机械学报), 2021, 52(S1): 27.
[18] ZHUANG Fu-zhen, LUO Ping, HE Qing, et al(庄福振,罗 平,何 清,等). Journal of Software(软件学报), 2015, 26(1): 26.
[19] LI Guan-dong, ZHANG Chun-ju, WANG Ming-kai, et al(李冠东,张春菊,王铭恺,等). Science of Surveying and Mapping(测绘科学), 2019, 44(4): 9.
[20] ZHAO Zhi-cheng, LUO Ze, WANG Peng-yan, et al(赵志成,罗 泽,王鹏彦,等). Computer Systems & Applications(计算机系统应用), 2020, 29(1): 14.