'
Orynbek A.G.
DEVELOPMENT OF CATTLE RECOGNITION SYSTEM USING DEEP NEURAL NETWORK *
Аннотация:
meat and food consumption trends are showing drastic rise in recent years. Nowadays, consumption of cattle products is three times more than it was fifty years ago. To fulfill the need for such resources, farms must increase production rate and product quality. One of the aspects of farming that needs development is cattle identification. Current technology is applied by using tags and tattoos on cows to distinguish them from one another. This process requires a lot of time to complete and also may harm the animals while applying physical actions on them. Farmers need a quick way of identifying cows to store medical data about them, so products are guaranteed to be high-quality. We propose usage of cattle biometrics for identification. Luckily, cow muzzles have unique patterns just like human fingerprints. By scanning them we can identify every cow and store all the information about it in the database. Result of this research will be a neural network that can identify cattle using images of their muzzles.
Ключевые слова:
YOLOv5, Cattle, Neural Network, Classification
DOI 10.24412/2712-8849-2024-473-378-384
Introduction. People rely on livestock for a large portion of their food source. In 2014, the average person consumed 43 kilograms of meat, and the world today produces more than three times the amount of meat it did fifty years ago. In 2018, roughly 340 million tonnes were produced. In addition, the globe currently produces over 800 million tonnes of milk each year, which is more than double the amount produced fifty years ago [1]. On the other hand, there is enormous pressure to grow larger numbers of cattle in shorter periods of time in order to fulfill an increase in worldwide demand for animal products. High levels of animal care are also required by consumer desire and statutory regulations. The health of cattle is ultimately linked to the quality of the products produced from them. Farmers may find it difficult to isolate a single cow in a large herd in order to assess its health status since distinguishing cows with similar colored fur is very hard.Currently, farmers use chipping, tattooing, marking, tagging, painting, and collars to identify cattle [2]. The most popular means of animal identification were ear tagging (53%) and hot iron branding (42%) marks (47%) [3]. All of these methods require mechanical tools and human presence to be applied. Even if the techniques are easy, their usage consumes a lot of time, considering that farms will have many animals. This is not the only drawback of the current methods, tags might be ripped off from the body causing injuries and pain to cattle, also appliance of these identification tools may cause harm to animals too.Ali Shojaeipour proposed using animal biometrics for live- stock recognition as one of his techniques [4]. The proposed method recommends using cow muzzles to identify the live- stock. Each cow’s muzzle has ridges and beads that are unique to them. We can distinguish one cow from another by utilizing deep learning to detect the muzzles. In the above-mentioned project, the use of YOLOv3 is demonstrated. The darknet- 53 convolutional layer is used for both object classes and bounding box predictions in this architecture. To ensure that the feature size in each continuous layer decreases, the model works without feature pooling. Yolov3 framework divides the images into grids and conducts predictions in those grids for muzzle and bounding box identification. After that, the model calculates the confidence score for each grid cell and predicts how likely the object exists in the current grid.Another method for identifying livestock is to employ iris recognition. Iris recognition can be done using 2-D focus assessment [5]. Since the animals’ eyes are also unique, this technique can be applied for the identification of cattle [6] and horses too [7]. Not only livestock but also wild animals can be identified using computer vision. Cameras with motion sensors installed in animal habitats can identify the impalas with an accuracy of 90% [8]For the training stage 2320 photos of cow faces were used. The original image size is (4000 ? 6000 ?3 pixels). These dimensions were too high for computations,so they were resized to (608 ? 832 ? 3 pixels).In this research we will use YOLOv5. The updates in YOLOv5 were initially applied to YOLOv4, when the usage of darknet framework was presented, in order to escape the version collision the updated YOLOv4 was renamed to YOLOv5.Methods and Materials. YOLO was designed to extract the features from the input images or videos and feed those features to the prediction system to classify the objects in an image and draw bounding boxes around them. YOLO is built from 3 pieces: Backbone, Neck and Head. CSP(Cross Stage Partial) Bottleneck is used to extract features from images. The CSP models are used in a combination with DenseNet. The purpose of the densenet is to mitigate the problem of gradient loss. By dealing with this problem, the model improves the feature propagation and forces the network to reuse the features causing the reduction of network parameters number. This approach is conducted by separating the feature map of the base layer into two copies. One copy is sent to the dense block of the neural network and the second copy is sent to the next stage untouched. The chart below presents the work of CSP DenseNet. Mosaic data augmentation is in use in yolov5. This method of data augmentation is useful when the small object problem occurs. By combining four images with random sizes into one tile, the model receives new images which may now contain different numbers of classes altogether. Here is the example of mosaic data augmentation for a dataset containing cow faces.Fig. 1. Mosaic augmentation example.Since each image in the dataset has only one cow presented, one tile in mosaic augmentation can contain up to 4 different cows in one tile.Results and discussion. We trained the model for 25 cows, with a dataset that has 159 train images and 27 test images. The model was trained using the batch size of 16 and 100 epochs. As a result the precision reached 0.884 and recall was 1. Below we provided the ground truth images and predictions of the YOLOv5 that was trained by custom data. The images were originally without bounding boxes. We labeled each cow’s muzzle bounding box using the online tool called “makesense.ai”. After that, we froze the backbone of the neural network (first 10 layers) and used 300 epochs. The precision reached 0.929 and recall reached 0.984. As it usually happens, the rise in precision caused a decrease in recall. As for not critical systems, we consider it as great results. Drawback of the system is that it requires many epochs to get precise, as can be seen from results of 100 and 300 epochs. But at some point, the rise in precision was not so notable, so we stopped on 300 epochs. Predictions and parameters evolution can be found below.Fig. 2. Truth and PredictionFig. 3. Evolution of metrics.Conclusion. To conclude, this work was done to improve the agricultural sphere in Kazakhstan. Nowadays keeping statistics of cattle and meat consumption in general, people use different types of methods, such as chipping, tagging, etc. Because they negatively affect the quality of meat and, mostly, the health of livestock, the main objective of this project is to develop and modify the existing algorithm for cattle face recognition. To achieve this goal we used YOLOv5 and trained the model with cow muzzle images.The results turned out to be high, accuracy precision reached 0.929, which means that our model identifies almost every cow correctly.In the future we plan to optimize the work of the neural network. For now the training process for the 300 epochs and 200 photos require about 5 hours of computations. This can be solved by freezing the layers of the YOLO or decreasing the amount of layers. Also, we are considering using our project in Kazakhstan farms to develop agriculture by optimizing livestock identification. Also, we want to develop an app which will use our model and work as an interface for farmers.
Номер журнала Вестник науки №4 (73) том 3
Ссылка для цитирования:
Orynbek A.G. DEVELOPMENT OF CATTLE RECOGNITION SYSTEM USING DEEP NEURAL NETWORK // Вестник науки №4 (73) том 3. С. 378 - 384. 2024 г. ISSN 2712-8849 // Электронный ресурс: https://www.вестник-науки.рф/article/13966 (дата обращения: 06.12.2024 г.)
Вестник науки СМИ ЭЛ № ФС 77 - 84401 © 2024. 16+
*