Abstract Thermal visualization of Holstein dairy cattle skin can be indicative of the pregnancy state (cyclic or pregnant) of the cow by observing the size and shape of skin thermal patterns. However, visual assessment of skin thermal patterns can be subjective and laborious. Further, infrared thermography implementation on-farm requires automated analysis to be feasible for dairy producers. The objectives of this study were to implement a machine learning convolutional neural network (CNN) to detect features in thermal images associated with pregnant (Pregnant) and non-pregnant (Cyclic) and to evaluate the accuracy of pregnancy diagnosis in dairy cows. A total of 938 images from 18 Pregnant cows and 982 images from 18 Cyclic were used to build the CNN model, and 120 images from Pregnant (60 images) and Cyclic (60 images) dairy cows were used to validate the model. Pregnant cows were confirmed to be pregnant 90 d after insemination via transrectal ultrasonography. Cyclic cows were confirmed to be non-pregnant using follicular dynamics and corpora lutea presence via transrectal ultrasonography. Images were recorded using a T620s infrared camera at 640 × 480 (307,200) to train the CNN model and images from an E40 FLIR camera at 320 x 240 (76,800 pixels) were used for the validation test. The CNN model was created using TensorFlow in Google Colab to binary classify images into Pregnant or Cyclic using a single output neuron (1: Pregnant and 0: Cyclic) with different Epochs (10, 25, and 100). The diagnosis accuracy (acc) was 0.72 with a validation accuracy (val_acc) of 0.41 for 10 Epochs, acc 0.76 with val_acc 0.37 for 25 Epochs, and acc 0.80 with val_acc 0.63. The acc and val_acc of the training model and validation test were optimized when using images from the T620s exclusively (Epochs 10: acc = 0.70 and val_acc = 0.64; Epoch 25: acc = 0.74 and val_acc = 0.70; Epoch 100: acc = 0.81 and val_acc = 0.80). Greater resolution of thermal images was proven to increase the accuracy of pregnancy diagnosis (307,200 compared with 76,800 pixels) and the greater number of Epoch used to train the model. Machine learning algorithms can diagnose pregnancy using thermal images with an acceptable evaluation accuracy (> 0.70).
Read full abstract