Cattle image classification method, device, electronic device and storage medium
Through the cattle image classification method, the feature extraction and classification of cattle images is solved by using the cattle classification model, which is a problem that the existing technology cannot accurately identify the cattle subdivided breeds, and the accurate identification and classification of the cattle subdivided breeds is achieved.
Patent Information
- Application Number
- CN202111234047.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-10-22
AI Technical Summary
The prior art cannot achieve accurate identification of the subdivided beef breeds.
The cattle image classification method is adopted, and the categorical image is extracted through the feature extraction module of the cattle classification model, and the classification module is used to classify the extraction results to obtain the cattle's prediction and subdivision category.
Accurate identification of the subdivided beef breeds is achieved, and the accuracy of cow image classification is improved.
Smart Images

Figure CN113887505B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of deep learning technology, and in particular to a cattle image classification method, device, electronic device and storage medium. Background Art
[0002] In the field of animal husbandry, especially cattle farming, accurate identification of excellent livestock breeds is essential for breeding new breeds, increasing benefits, enhancing the environmental adaptability of livestock, and reducing poverty in rural areas. For example, Pakistan has many world-class buffalo breeds, such as Nili-Ravi, Kundi and other buffalo breeds, which have high tolerance for feed supply and feed quality and can adapt to huge differences in low-input monitoring systems. However, despite the great production capacity of these buffalo breeds, they produce much less buffalo milk at home. This is due to the difficulty in selecting and testing offspring due to the lack of accurate breed identification, which in turn leads to long calving intervals, silent estrus, and late maturity of the raised buffalo breeds.
[0003] In response to the need for accurate identification of vigorous cattle breeds, the traditional identification method is to classify local cattle according to regional differences, but regional differences are not sufficient to distinguish subdivided breeds. Therefore, in order to effectively and meaningfully improve and protect them, detailed characterization and evaluation of the differences between these breeds requires the use of modern technical tools.
[0004] With the development of deep learning and image recognition technology, more and more livestock species are beginning to be identified using image recognition technology. For example, in (Kumar et al., 2018), a deep learning-based method was proposed to identify individual cattle based on the main mouth point image sequence features of cattle. Their proposed method solves the problem of lost or exchanged livestock and insurance claims; for example, in another study (Rauf et al., 2019), an artificial intelligence-driven fish species identification system based on the CNN framework was proposed.
[0005] However, the prior art can realize the identification of the general breeds of various livestock, but cannot realize the accurate identification of the specific breeds of cattle. Summary of the invention
[0006] The purpose of this application is to provide a cattle image classification method, device, electronic device and storage medium to solve the technical problem in the prior art that it is impossible to accurately identify cattle breeds.
[0007] The purpose of this application is achieved by the following technical solutions:
[0008] In a first aspect, the present application provides a cattle image classification method, the method comprising: using a feature extraction module of a cattle classification model to perform feature extraction on an image to be classified to obtain a feature extraction result of the image to be classified, wherein the image to be classified is a cattle image to be classified; using a classification module of the cattle classification model to classify the feature extraction result of the image to be classified to obtain predicted classification information of the image to be classified, wherein the predicted classification information is used to indicate a predicted subdivision category of the cattle.
[0009] The beneficial effect of this technical solution is that features are extracted from cattle images to be classified, and the extracted feature extraction results are classified to obtain predicted classification information indicating the predicted subdivision category of the cattle; the method of first feature extraction and then classification realizes the accurate identification of cattle subdivision breeds.
[0010] In some optional embodiments, the training process of the cattle classification model is as follows: using the feature extraction module of the model to be trained to extract features of the training image to obtain the feature extraction result of the training image, and the training image is a cattle image used for model training; using the classification module of the model to be trained to classify the feature extraction result of the training image to obtain predicted classification information of the training image, and the predicted classification information is used to indicate the predicted subdivision category of the cattle; using the predicted classification information and labeled classification information of the training image, the model to be trained is trained to obtain the cattle classification model, and the labeled classification information is used to indicate the labeled subdivision category of the cattle.
[0011] The beneficial effect of this technical solution is that the model to be trained is trained using cattle images and labeled subdivision categories, firstly, features of the cattle images are extracted, and then the feature extraction results are classified to obtain predicted classification information, and the labeled subdivision categories and the predicted classification information are used to complete the training of the model to be trained; the cattle classification model is obtained by training using cattle images and labeled subdivision categories, so when the cattle classification model is applied to cattle image classification, it can accurately identify the subdivision breed category of cattle.
[0012] In some optional embodiments, the use of a feature extraction module of the model to be trained to extract features from a training image to obtain a feature extraction result of the training image includes: using a first convolution block of the feature extraction module to process the training image to obtain a first processing result of the training image; and obtaining a feature extraction result of the training image based on the first processing result of the training image.
[0013] The beneficial effect of this technical solution is that a first processing result is obtained by processing the training image using a first convolution block, and then a feature extraction result is obtained based on the first processing result. Through the processing of the convolution block, the processing result obtained can better reflect the characteristics of the training image, thereby improving the accuracy of the feature extraction result, and further improving the accuracy of the trained cattle classification model when applied to cattle image classification.
[0014] In some optional embodiments, obtaining a feature extraction result of the training image based on the first processing result of the training image includes: pooling the first processing result of the training image using the first pooling layer of the feature extraction module to obtain the first pooling result of the training image; processing the first pooling result of the training image using the second convolution block of the feature extraction module to obtain the second processing result of the training image; and obtaining the feature extraction result of the training image based on the second processing result of the training image.
[0015] The beneficial effect of this technical solution is that a first pooling layer is added to obtain a first pooling result after pooling the first processing result, and then a second convolution block is added to further process the first pooling result to obtain a second processing result, and then a feature extraction result is obtained based on the second processing result. Through the processing of the added pooling layer and convolution block, the second processing result obtained can better reflect the detailed features of the training image than the first processing result, thereby improving the accuracy of the feature extraction result, and further improving the accuracy of the trained cattle classification model when applied to cattle image classification.
[0016] In some optional embodiments, obtaining the feature extraction result of the training image based on the second processing result of the training image includes: pooling the second processing result of the training image using the second pooling layer of the feature extraction module to obtain the second pooling result of the training image; processing the second pooling result of the training image using the third convolution block of the feature extraction module to obtain the third processing result of the training image; and obtaining the feature extraction result of the training image based on the third processing result of the training image.
[0017] The beneficial effect of this technical solution is that a second pooling layer is added to obtain a second pooling result after pooling the second processing result, and then a third convolution block is added to further process the second pooling result to obtain a third processing result, and then a feature extraction result is obtained based on the third processing result. Through the processing of the added pooling layer and convolution block, the third processing result obtained further reflects the detailed features of the training image compared to the second processing result, thereby improving the accuracy of the feature extraction result, and further improving the accuracy of the trained cattle classification model when applied to cattle image classification.
[0018] In some optional embodiments, obtaining the feature extraction result of the training image based on the third processing result of the training image includes: pooling the third processing result of the training image using the third pooling layer of the feature extraction module to obtain the third pooling result of the training image; processing the third pooling result of the training image using the fourth convolution block of the feature extraction module to obtain the fourth processing result of the training image; and obtaining the feature extraction result of the training image based on the fourth processing result of the training image.
[0019] The beneficial effect of this technical solution is that a third pooling layer is added to obtain a third pooling result after pooling the third processing result, and then a fourth convolution block is added to further process the third pooling result to obtain a fourth processing result, and then a feature extraction result is obtained based on the fourth processing result. Through the processing of the added pooling layer and convolution block, the fourth processing result obtained further reflects the detailed features of the training image compared with the third processing result, thereby improving the accuracy of the feature extraction result, and further improving the accuracy of the trained cattle classification model when applied to cattle image classification.
[0020] In some optional embodiments, obtaining the feature extraction result of the training image based on the fourth processing result of the training image includes: pooling the fourth processing result of the training image using the fourth pooling layer of the feature extraction module to obtain the fourth pooling result of the training image; processing the fourth pooling result of the training image using the fifth convolution block of the feature extraction module to obtain the fifth processing result of the training image; and using the fifth processing result of the training image as the feature extraction result of the training image.
[0021] The beneficial effect of this technical solution is that a fourth pooling layer is added to obtain a fourth pooling result after pooling the fourth processing result, and then a fifth convolution block is added to further process the fourth pooling result to obtain a fifth processing result, and then a feature extraction result is obtained based on the fifth processing result. Through the processing of the added pooling layer and convolution block, the fifth processing result obtained further reflects the detailed features of the training image compared to the fourth processing result, thereby improving the accuracy of the feature extraction result, and further improving the accuracy of the trained cattle classification model when applied to cattle image classification.
[0022] In some optional embodiments, the processing process of each convolution block from the first convolution block to the fifth convolution block is as follows: convolve the input image using the convolution layer of the convolution block to obtain the convolution result of the input image; batch normalize the convolution result of the input image using the batch normalization layer of the convolution block to obtain the batch normalized result of the input image; activate the batch normalized result of the input image using the activation layer of the convolution block to obtain the activation result of the input image as the processing result of the input image.
[0023] The beneficial effect of this technical solution is that the input image is processed in sequence using the convolution layer, the batch normalization layer and the activation layer, and the processing result of the input image is more accurate.
[0024] In some optional embodiments, the method of using the classification module of the model to be trained to classify the feature extraction results of the training image to obtain predicted classification information of the training image includes: using the fully connected layer of the classification module to fully connect the feature extraction results of the training image to obtain the fully connected results of the training image; and using the classifier of the classification module to classify the fully connected results of the training image to obtain predicted classification information of the training image.
[0025] The beneficial effect of this technical solution is that the feature extraction results are fully connected and then classified by a classifier to obtain predicted classification information, so that the predicted classification information can fully reflect the characteristics of the training image. The cattle classification model trained in this way is more accurate when applied to cattle image classification.
[0026] In some optional embodiments, the method of using the predicted classification information and the labeled classification information of the training image to train the model to be trained to obtain the cattle classification model includes: using the predicted classification information and the labeled classification information of the training image to update the parameters of the feature extraction module of the model to be trained to obtain a semi-trained model; inputting the training image into the semi-trained model, and using the fully connected layer of the classification module of the semi-trained model to output multiple feature vectors of the training image; performing feature classification on the multiple feature vectors of the training image to obtain multiple predicted feature categories of the training image; and using the multiple predicted feature categories and the multiple labeled feature categories of the training image to update all parameters of the semi-trained model to obtain the cattle classification model.
[0027] The beneficial effect of the technical solution is that the model training is divided into two stages, first training the semi-trained model, and then further training the semi-trained model, so that the final model can be obtained quickly, less training data is required, and the efficiency is high; the fully connected layer of the semi-classification model is used to output multiple feature vectors, and then the multiple feature vectors are feature classified, and then the predicted feature categories obtained by classification are combined with multiple labeled feature categories to train the semi-trained model, which can improve the accuracy of model training and obtain a cattle classification model that can more accurately identify cattle sub-breeds.
[0028] In some optional embodiments, the cattle subcategories include Khundi, Mix and Nili-Ravi; the multiple predicted feature categories and the multiple labeled feature categories respectively include one or more of pattern categories, eye categories, body color categories, horn categories, tail categories, body categories, neck categories and udder categories.
[0029] The beneficial effect of this technical solution is that it specifically limits the subdivision categories of cattle, and on the basis of being able to accurately identify the subdivision breeds of cattle in specific areas, reduces the amount of data for model training and improves the efficiency of model training; it provides a variety of characteristic categories of cattle, increases the accuracy of cattle image classification, and improves the ability to distinguish detailed differences, especially for the identification of two or more subdivision breeds of cattle with extremely high overall similarity.
[0030] In a second aspect, the present application provides a cattle image classification device, the device comprising: a feature extraction module, used to use the feature extraction module of the cattle classification model to perform feature extraction on the image to be classified, and obtain the feature extraction result of the image to be classified, wherein the image to be classified is a cattle image to be classified; an image classification module, used to classify the feature extraction result of the image to be classified using the classification module of the cattle classification model, and obtain predicted classification information of the image to be classified, and the predicted classification information is used to indicate the predicted subdivision category of the cattle.
[0031] In some optional embodiments, the training process of the cattle classification model is as follows: using the feature extraction module of the model to be trained to extract features of the training image to obtain the feature extraction result of the training image, and the training image is a cattle image used for model training; using the classification module of the model to be trained to classify the feature extraction result of the training image to obtain predicted classification information of the training image, and the predicted classification information is used to indicate the predicted subdivision category of the cattle; using the predicted classification information and labeled classification information of the training image, the model to be trained is trained to obtain the cattle classification model, and the labeled classification information is used to indicate the labeled subdivision category of the cattle.
[0032] In some optional embodiments, the use of a feature extraction module of the model to be trained to extract features from a training image to obtain a feature extraction result of the training image includes: using a first convolution block of the feature extraction module to process the training image to obtain a first processing result of the training image; and obtaining a feature extraction result of the training image based on the first processing result of the training image.
[0033] In some optional embodiments, obtaining a feature extraction result of the training image based on the first processing result of the training image includes: pooling the first processing result of the training image using the first pooling layer of the feature extraction module to obtain the first pooling result of the training image; processing the first pooling result of the training image using the second convolution block of the feature extraction module to obtain the second processing result of the training image; and obtaining the feature extraction result of the training image based on the second processing result of the training image.
[0034] In some optional embodiments, obtaining the feature extraction result of the training image based on the second processing result of the training image includes: pooling the second processing result of the training image using the second pooling layer of the feature extraction module to obtain the second pooling result of the training image; processing the second pooling result of the training image using the third convolution block of the feature extraction module to obtain the third processing result of the training image; and obtaining the feature extraction result of the training image based on the third processing result of the training image.
[0035] In some optional embodiments, obtaining the feature extraction result of the training image based on the third processing result of the training image includes: pooling the third processing result of the training image using the third pooling layer of the feature extraction module to obtain the third pooling result of the training image; processing the third pooling result of the training image using the fourth convolution block of the feature extraction module to obtain the fourth processing result of the training image; and obtaining the feature extraction result of the training image based on the fourth processing result of the training image.
[0036] In some optional embodiments, obtaining the feature extraction result of the training image based on the fourth processing result of the training image includes: pooling the fourth processing result of the training image using the fourth pooling layer of the feature extraction module to obtain the fourth pooling result of the training image; processing the fourth pooling result of the training image using the fifth convolution block of the feature extraction module to obtain the fifth processing result of the training image; and using the fifth processing result of the training image as the feature extraction result of the training image.
[0037] In some optional embodiments, the processing process of each convolution block in the first convolution block to the fifth convolution block is as follows: using the convolution layer of the convolution block to convolve the input image to obtain the convolution result of the input image; using the batch normalization layer of the convolution block to batch normalize the convolution result of the input image;
[0038] Normalizing to obtain a batch normalization result of the input image; activating the batch normalization result of the input image using the activation layer of the convolution block to obtain an activation result of the input image as a processing result of the input image.
[0039] In some optional embodiments, the method of using the classification module of the model to be trained to classify the feature extraction results of the training image to obtain predicted classification information of the training image includes: using the fully connected layer of the classification module to fully connect the feature extraction results of the training image to obtain the fully connected results of the training image; and using the classifier of the classification module to classify the fully connected results of the training image to obtain predicted classification information of the training image.
[0040] In some optional embodiments, the method of using the predicted classification information and the labeled classification information of the training image to train the model to be trained to obtain the cattle classification model includes: using the predicted classification information and the labeled classification information of the training image to update the parameters of the feature extraction module of the model to be trained to obtain a semi-trained model; inputting the training image into the semi-trained model, and using the fully connected layer of the classification module of the semi-trained model to output multiple feature vectors of the training image; performing feature classification on the multiple feature vectors of the training image to obtain multiple predicted feature categories of the training image; and using the multiple predicted feature categories and the multiple labeled feature categories of the training image to update all parameters of the semi-trained model to obtain the cattle classification model.
[0041] In some optional embodiments, the cattle subcategories include Khundi, Mix and Nili-Ravi; the multiple predicted feature categories and the multiple labeled feature categories respectively include one or more of pattern categories, eye categories, body color categories, horn categories, tail categories, body categories, neck categories and udder categories.
[0042] In a third aspect, the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above-mentioned cattle image classification methods when executing the computer program.
[0043] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned cattle image classification methods.
[0044] The above is an overview of the technical solution of the present application. In order to enable those skilled in the art to fully understand the present application, the specific implementation methods of the present application are as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The present application is further described below in conjunction with the accompanying drawings and embodiments.
[0046] Figure 1 It is a flowchart of a cattle image classification method provided in an embodiment of the present application;
[0047] Figure 2 It is a flowchart of a training process of a cattle classification model provided in an embodiment of the present application;
[0048] Figure 3 Schematic diagram of a data augmentation process provided by an embodiment of the present application;
[0049] Figure 4 It is a schematic diagram of a process of extracting features from a training image provided by an embodiment of the present application;
[0050] Figure 5 It is a schematic diagram of a process of obtaining a feature extraction result based on a first processing result provided in an embodiment of the present application;
[0051] Figure 6 It is a schematic diagram of a flow chart of obtaining a feature extraction result based on a second processing result provided in an embodiment of the present application;
[0052] Figure 7 It is a schematic diagram of a flow chart of obtaining a feature extraction result based on a third processing result provided in an embodiment of the present application;
[0053] Figure 8 is a flow chart of obtaining a feature extraction result based on the fourth processing result provided in an embodiment of the present application;
[0054] Fig. 9 It is a flowchart of a processing process of each convolution block provided in an embodiment of the present application;
[0055] Fig.10 It is a schematic diagram of a process for obtaining predicted classification information of a training image provided by an embodiment of the present application;
[0056] Fig.11 This is a flow chart of training a model to be trained to obtain a cattle classification model provided by an embodiment of the present application;
[0057] Fig.12 This is a schematic diagram of the overall framework of a cattle image classification method provided in an embodiment of the present application;
[0058] Fig.13 It is a schematic diagram of an algorithm framework of a cattle image classification method provided in an embodiment of the present application;
[0059] Fig.14 It is a schematic diagram of the calculation process of a maximum pooling calculation method for each convolution block provided in an embodiment of the present application;
[0060] Fig.15 is a structural schematic diagram of a cattle image classification device provided in an embodiment of the present application;
[0061] Fig.16 is a structural block diagram of an electronic device provided in an embodiment of the present application;
[0062] Fig.17 It is a structural schematic diagram of a program product for implementing a cattle image classification method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] Below, the present application is further described in conjunction with the accompanying drawings and specific implementation methods. It should be noted that, under the premise of no conflict, the various embodiments or technical features described below can be arbitrarily combined to form a new embodiment.
[0064] See also Figure 1 , an embodiment of the present application provides a cattle image classification method, the method comprising steps S101~S102.
[0065] In the embodiment of the present application, the type of cattle is, for example, beef cattle or dairy cows.
[0066] Among them, dairy cows and / or beef cattle can be further classified into categories such as cattle, buffaloes, yaks, etc.
[0067] Step S101: extracting features of an image to be classified using a feature extraction module of a cattle classification model to obtain a feature extraction result of the image to be classified, where the image to be classified is a cattle image to be classified.
[0068] Step S102: using the classification module of the cattle classification model to classify the feature extraction result of the image to be classified, to obtain predicted classification information of the image to be classified, wherein the predicted classification information is used to indicate the predicted subdivision category of the cattle.
[0069] Among them, sub-categories refer to the sub-categories within the cattle breed categories, for example, the Nili-Ravi breed is the majority, and the difference between the Nili-Ravi breed and other breeds is small. Its identification and classification has become the most concerned issue in Pakistan's dairy production center.
[0070] Therefore, features are extracted from the cattle images to be classified, and the extracted feature extraction results are classified to obtain predicted classification information indicating the predicted subdivision category of the cattle; the method of first feature extraction and then classification realizes the accurate identification of cattle subdivision breeds.
[0071] See also Figure 2 In some embodiments, the training process of the cattle classification model may include steps S201 to S203.
[0072] Step S201: extracting features from a training image using a feature extraction module of a model to be trained to obtain a feature extraction result of the training image, wherein the training image is a cow image used for model training.
[0073] Step S202: using the classification module of the model to be trained to classify the feature extraction result of the training image to obtain predicted classification information of the training image, wherein the predicted classification information is used to indicate the predicted subdivision category of cattle.
[0074] Step S203: using the predicted classification information and the labeled classification information of the training image to train the model to be trained, so as to obtain the cattle classification model, wherein the labeled classification information is used to indicate the labeled subdivision category of the cattle.
[0075] The training images can be input after being taken on-site manually, or imported from an existing database; in some application scenarios, the training images are collected from the Pakistan Buffalo Research Center. The obtained dataset is publicly available in a dataset repository called Mendeley. The entire data is normalized and preprocessed, including all class labels, for self-activation CNN training.
[0076] Therefore, the model to be trained is trained using cattle images and labeled subdivision categories. First, features are extracted from the cattle images, and then the feature extraction results are classified to obtain predicted classification information. The labeled subdivision categories and predicted classification information are used to complete the training of the model to be trained. The cattle classification model is trained using cattle images and labeled subdivision categories. Therefore, when the cattle classification model is applied to cattle image classification, it can accurately identify the subdivision breed category of cattle.
[0077] In some embodiments, the training image can be processed for data augmentation to enhance the training strength of the model, and various augmentation techniques can be used to perform data augmentation. For example, in some application scenarios, the boundary points of the image can be transformed using reflections at random positions in the X and Y directions. The X and Y transformations specify left, right, top, and bottom reflections on the image. The random X and Y translations are set to [-4, 4]. It defines the random translation of a specific range of pixel intensities on the image in the X and Y dimensions. The pixel range used is -4 to 4. In addition, random cropping can also be applied to perform specific bit-by-bit hiding and finding operations, including shearing and randomly erasing a given image to achieve data augmentation. Figure 3 The training image results after partial data augmentation are shown.
[0078] In some embodiments, to avoid overfitting and other deep learning problems, training images are primarily augmented before training and testing.
[0079] See also Figure 4 In some implementations, the step S201 may include steps S301 to S302.
[0080] Step S301: Process the training image using the first convolution block of the feature extraction module to obtain a first processing result of the training image.
[0081] Step S302: Based on the first processing result of the training image, obtain a feature extraction result of the training image.
[0082] Therefore, the first convolution block is used to process the training image to obtain a first processing result, and then a feature extraction result is obtained based on the first processing result. Through the processing of the convolution block, the processing result obtained can better reflect the characteristics of the training image, thereby improving the accuracy of the feature extraction result, and further improving the accuracy of the trained cattle classification model when applied to cattle image classification.
[0083] See also Figure 5 In some implementations, the step S302 may include steps S401 to S403.
[0084] Step S401: pooling the first processing result of the training image using the first pooling layer of the feature extraction module to obtain a first pooling result of the training image.
[0085] Step S402: using the second convolution block of the feature extraction module to process the first pooling result of the training image to obtain a second processing result of the training image.
[0086] Step S403: Based on the second processing result of the training image, obtain a feature extraction result of the training image.
[0087] Therefore, a first pooling layer is added to obtain a first pooling result after pooling the first processing result, and then a second convolution block is added to further process the first pooling result to obtain a second processing result, and then a feature extraction result is obtained based on the second processing result. Through the processing of the added pooling layer and convolution block, the second processing result obtained can better reflect the detailed features of the training image than the first processing result, thereby improving the accuracy of the feature extraction result, and further improving the accuracy of the trained cattle classification model when applied to cattle image classification.
[0088] See also Figure 6 In some implementations, the step S403 may include steps S501 to S503.
[0089] Step S501: pooling the second processing result of the training image using the second pooling layer of the feature extraction module to obtain a second pooling result of the training image.
[0090] Step S502: using the third convolution block of the feature extraction module to process the second pooling result of the training image to obtain a third processing result of the training image.
[0091] Step S503: Based on the third processing result of the training image, obtain the feature extraction result of the training image.
[0092] Therefore, a second pooling layer is added to obtain a second pooling result after pooling the second processing result, and then a third convolution block is added to further process the second pooling result to obtain a third processing result, and then a feature extraction result is obtained based on the third processing result. Through the processing of the added pooling layer and convolution block, the third processing result obtained further reflects the detailed features of the training image compared to the second processing result, thereby improving the accuracy of the feature extraction result, and further improving the accuracy of the trained cattle classification model when applied to cattle image classification.
[0093] See also Figure 7 In some implementations, the step S503 may include steps S601 to S603.
[0094] Step S601: pooling the third processing result of the training image using the third pooling layer of the feature extraction module to obtain a third pooling result of the training image.
[0095] Step S602: using the fourth convolution block of the feature extraction module to process the third pooling result of the training image to obtain a fourth processing result of the training image.
[0096] Step S603: Based on the fourth processing result of the training image, obtain the feature extraction result of the training image.
[0097] Therefore, a third pooling layer is added to obtain a third pooling result after pooling the third processing result, and then a fourth convolution block is added to further process the third pooling result to obtain a fourth processing result, and then a feature extraction result is obtained based on the fourth processing result. Through the processing of the added pooling layer and convolution block, the fourth processing result obtained further reflects the detailed features of the training image compared with the third processing result, thereby improving the accuracy of the feature extraction result, and further improving the accuracy of the trained cattle classification model when applied to cattle image classification.
[0098] See also Figure 8 In some implementations, the step S603 may include steps S701 to S703.
[0099] Step S701: pooling the fourth processing result of the training image using the fourth pooling layer of the feature extraction module to obtain a fourth pooling result of the training image.
[0100] Step S702: using the fifth convolution block of the feature extraction module to process the fourth pooling result of the training image to obtain a fifth processing result of the training image.
[0101] Step S703: using the fifth processing result of the training image as the feature extraction result of the training image.
[0102] Therefore, a fourth pooling layer is added to obtain a fourth pooling result after pooling the fourth processing result, and then a fifth convolution block is added to further process the fourth pooling result to obtain a fifth processing result, and then a feature extraction result is obtained based on the fifth processing result. Through the processing of the added pooling layer and convolution block, the fifth processing result obtained further reflects the detailed features of the training image compared to the fourth processing result, thereby improving the accuracy of the feature extraction result, and further improving the accuracy of the trained cattle classification model when applied to cattle image classification.
[0103] See also Fig. 9In some embodiments, the processing of each convolution block from the first convolution block to the fifth convolution block may include steps S801 to S803. The input image refers to the image input to the convolution block. For example, when the pooling result is input to the convolution block, the pooling result is the input image; for another example, when the feature extraction result is input to the convolution block, the feature extraction result is the input image.
[0104] Step S801: convolve the input image using the convolution layer of the convolution block to obtain the convolution result of the input image.
[0105] Step S802: using the batch normalization layer of the convolution block to batch normalize the convolution result of the input image to obtain a batch normalized result of the input image.
[0106] Step S803: Activate the batch normalization result of the input image using the activation layer of the convolution block to obtain the activation result of the input image as the processing result of the input image.
[0107] Therefore, the input image is processed in sequence using the convolution layer, the batch normalization layer, and the activation layer, and the processing result of the input image is more accurate.
[0108] See also Fig.10 In some implementations, the step S202 may include steps S901~S902.
[0109] Step S901: Use the fully connected layer of the classification module to fully connect the feature extraction result of the training image to obtain the fully connected result of the training image.
[0110] Step S902: using the classifier of the classification module to classify the fully connected result of the training image to obtain predicted classification information of the training image.
[0111] Therefore, the feature extraction results are fully connected, and then the classifier is used to classify the fully connected results to obtain predicted classification information, so that the predicted classification information can fully reflect the characteristics of the training image. The cattle classification model trained in this way has higher accuracy when applied to cattle image classification.
[0112] See also Fig.11 In some implementations, the step S203 may include steps S1001 to S1004.
[0113] Step S1001: using the predicted classification information and the labeled classification information of the training image, the parameters of the feature extraction module of the to-be-trained model are updated to obtain a semi-trained model.
[0114] Step S1002: input the training image into the semi-training model, and use the fully connected layer of the classification module of the semi-training model to output multiple feature vectors of the training image.
[0115] Step S1003: performing feature classification on the multiple feature vectors of the training image to obtain multiple predicted feature categories of the training image.
[0116] Step S1004: using the multiple predicted feature categories and the multiple labeled feature categories of the training image, all parameters of the semi-trained model are updated to obtain the cattle classification model.
[0117] In some application scenarios, traditional pre-trained CNN (convolutional neural network) is trained on big data, and its specific features may be helpful in many aspects of medicine and other computer vision fields. Using transfer to extract features, learning these extracted features may be helpful for small datasets used to propose research, but when a large amount of data is applied to the pre-trained CNN, these data may become less accurate and less reliable. Therefore, using a specific dataset to continue training the pre-trained CNN, regardless of the size of the data, the characteristics of the dataset and the specific field can provide more reliable results.
[0118] Therefore, the model training is divided into two stages: first, the semi-trained model is trained, and then the semi-trained model is further trained. The final model can be obtained quickly, less training data is required, and the efficiency is high. The fully connected layer of the semi-classification model is used to output multiple feature vectors, and then the multiple feature vectors are feature classified. Then, the predicted feature categories obtained by classification are combined with multiple labeled feature categories to train the semi-trained model. This can improve the accuracy of model training and obtain a cattle classification model that can more accurately identify cattle sub-breeds.
[0119] In some embodiments, the cattle subcategories may include Khundi, Mix, and Nili-Ravi; the plurality of predicted feature categories and the plurality of labeled feature categories respectively include one or more of a pattern category, an eye category, a body color category, a horn category, a tail category, a body category, a neck category, and a udder category. In other embodiments, the cattle subcategories may include buffalo, cattle, and yaks.
[0120] Therefore, the cattle categories are specifically limited, which can achieve accurate identification of cattle breeds in specific areas, reduce the amount of data for model training and improve the efficiency of model training; provide a variety of cattle feature categories, increase the accuracy of cattle image classification, and improve the ability to distinguish detailed differences, especially for the identification of two or more cattle breeds with extremely high overall similarity.
[0121] See also Fig.12 and 13 In some application scenarios, the self-activated convolutional neural network can be used to realize intelligent recognition of image features. The recognition method is as follows:
[0122] The overall architecture is divided into 23 layers, which contain 5 convolution blocks with different numbers of filters and sizes. The first layer is the image (img=[r,c]) input layer, and the input size of each given image instance is 256x256x3. The second layer is a convolution layer with half the image size for several filters with 3x3 kernel size. Padding and stride as 1 means that the pixel-to-pixel sliding of the given image is 1 so that each 3x3 kernel evolves over the entire image. The 2D convolution calculation is input by equation (1), as shown in equations (2) and (3).
[0123] imput image = I = img[r,c] (1)
[0124]
[0125] Equation (2) represents the 3x3 kernel mask, which is then multiplied by the pixel of the input image. i and j represent the row and column of the input matrix respectively. At the end of the convolution operation, the output matrix is calculated as the y(i;j) variable.
[0126] Each batch normalization layer is used in all convolutional blocks, where batch normalization is used to normalize the input by calculating the variance σB2 and mean μB of each color channel.
[0127]
[0128] (4) In the formula, g xi The normalization of the activation is being measured, which is predicted by the difference between the input variable χi and the mean μB divided by the square root of the variance σβ2 and a constant value. The constant value is added to stabilize the minimum variance value. Reconsider this activation as g yi ; Zero mean and unit variance are crucial for scaling. The scaling is shown in (5).
[0129]
[0130] In formula (5), learnable factors γ and β are added to increase the amount of activation output. Multiplication will transform the output of the previous activation into a new value with learnable parameters.
[0131] The max pooling layer downsamples the given upper input to higher intensity values. The max pooling calculation for each convolutional block is as follows: Fig.14 shown.
[0132] For the iteration of the 2D matrix of the image, the input image selects a window as shown in formula (6).
[0133] w = Iselected2x2 (6)
[0134] Take the maximum value of each incremental window 'w' from left to right of the image, and then start the next row, so as to start the increment in the y direction, and finally collect a max-window downloaded by max-pool for each upper layer activation input. The maximum pool is shown in formula (7).
[0135] Max− Pooling = max(w(x;y)) (7)
[0136] After getting the convolution data, it is normalized using a batch normalization layer. In this way, the variation of the input batch data is reduced. After the data is normalized, ReLU (rectified linear function) based activation is performed. The ReLU function works like a threshold, which specifies negative values as zero and the upper limit is the same as the intensity value calculated in (8).
[0137]
[0138] The normalized feature vector is then passed to a max-pooling layer with a kernel size of 2, and the stride is also kept at 2, sliding over these two points as the next input pool. At this point, all layer parameters are summarized in the data table. Since only the convolutional layer changes the number of filter changes in the entire network, batch normalization and ReLU (linear rectification function) activation are performed in each convolution block. However, the architecture of the weights of each layer has been shown in the CNN architecture, such as Figure 2 As shown. The weights of each layer are activated using the trained network to see the effect of pooling in each architecture. Therefore, in the proposed architecture diagram, the weights of the convolutions with batch normalization and ReLU activation are shown as a stack. In the convolution showing the color input, the batch normalization below shows how the color is activated and the input to the next layer is updated / changed. Finally, in the 5th convolution block, the convolution weights and batch normalization highlight more decision strength. The final activated weights are passed to the fully connected layer, which is treated as three classes and an activation based on the softmax transfer function (Softmax) is applied.
[0139] The proposed deep CNN architecture infers spatial information from cattle images and combines rich feature vectors. Moreover, the rich features are transferred to the activation layers for better classification using transfer learning based approach. Several ML based classifiers are used to classify the instances into the relevant target classes. The credibility of the dataset and features is validated using different data splits which do not change abruptly. All the results are standardized and reliable making the proposed method an accurate method for identifying different cattle breeds.
[0140] Therefore, based on the above principles, the proposed cattle image classification method has a maximum accuracy range of 93% and can guarantee an accuracy rate of more than 85%.
[0141] See also Fig.15 The embodiment of the present application also provides a cattle image classification device, the device comprising: a feature extraction module 101, used to extract features from the image to be classified using the feature extraction module of the cattle classification model, and obtain the feature extraction result of the image to be classified, the image to be classified is a cattle image to be classified; an image classification module 102, used to classify the feature extraction result of the image to be classified using the classification module of the cattle classification model, and obtain the predicted classification information of the image to be classified, the predicted classification information is used to indicate the predicted subdivision category of the cattle. Its specific implementation method is consistent with the implementation method and the technical effect achieved in the embodiment of the cattle image classification method described above, and some contents will not be repeated.
[0142] In some embodiments, the training process of the cattle classification model can be as follows: use the feature extraction module of the model to be trained to extract features of the training image to obtain the feature extraction result of the training image, and the training image is a cattle image used for model training; use the classification module of the model to be trained to classify the feature extraction result of the training image to obtain predicted classification information of the training image, and the predicted classification information is used to indicate the predicted subdivision category of the cattle; use the predicted classification information and labeled classification information of the training image to train the model to be trained to obtain the cattle classification model, and the labeled classification information is used to indicate the labeled subdivision category of the cattle.
[0143] In some embodiments, using the feature extraction module of the model to be trained to extract features from the training image to obtain the feature extraction result of the training image may include: using the first convolution block of the feature extraction module to process the training image to obtain a first processing result of the training image; and obtaining the feature extraction result of the training image based on the first processing result of the training image.
[0144] In some embodiments, obtaining a feature extraction result of the training image based on the first processing result of the training image may include: pooling the first processing result of the training image using the first pooling layer of the feature extraction module to obtain the first pooling result of the training image; processing the first pooling result of the training image using the second convolution block of the feature extraction module to obtain the second processing result of the training image; and obtaining a feature extraction result of the training image based on the second processing result of the training image.
[0145] In some embodiments, obtaining the feature extraction result of the training image based on the second processing result of the training image may include: pooling the second processing result of the training image using the second pooling layer of the feature extraction module to obtain the second pooling result of the training image; processing the second pooling result of the training image using the third convolution block of the feature extraction module to obtain the third processing result of the training image; and obtaining the feature extraction result of the training image based on the third processing result of the training image.
[0146] In some embodiments, obtaining the feature extraction result of the training image based on the third processing result of the training image may include: pooling the third processing result of the training image using the third pooling layer of the feature extraction module to obtain the third pooling result of the training image; processing the third pooling result of the training image using the fourth convolution block of the feature extraction module to obtain the fourth processing result of the training image; and obtaining the feature extraction result of the training image based on the fourth processing result of the training image.
[0147] In some embodiments, obtaining the feature extraction result of the training image based on the fourth processing result of the training image may include: pooling the fourth processing result of the training image using the fourth pooling layer of the feature extraction module to obtain the fourth pooling result of the training image; processing the fourth pooling result of the training image using the fifth convolution block of the feature extraction module to obtain the fifth processing result of the training image; and using the fifth processing result of the training image as the feature extraction result of the training image.
[0148] In some embodiments, the processing process of each convolution block from the first convolution block to the fifth convolution block can be as follows: convolve the input image using the convolution layer of the convolution block to obtain the convolution result of the input image; batch normalize the convolution result of the input image using the batch normalization layer of the convolution block to obtain the batch normalized result of the input image; activate the batch normalized result of the input image using the activation layer of the convolution block to obtain the activation result of the input image as the processing result of the input image.
[0149] In some embodiments, the use of the classification module of the model to be trained to classify the feature extraction results of the training image to obtain predicted classification information of the training image may include: using the fully connected layer of the classification module to fully connect the feature extraction results of the training image to obtain the fully connected results of the training image; using the classifier of the classification module to classify the fully connected results of the training image to obtain predicted classification information of the training image.
[0150] In some embodiments, the method of training the model to be trained using the predicted classification information and the labeled classification information of the training image to obtain the cattle classification model may include: updating the parameters of the feature extraction module of the model to be trained using the predicted classification information and the labeled classification information of the training image to obtain a semi-trained model; inputting the training image into the semi-trained model, and outputting multiple feature vectors of the training image using the fully connected layer of the classification module of the semi-trained model; performing feature classification on the multiple feature vectors of the training image to obtain multiple predicted feature categories of the training image; and updating all parameters of the semi-trained model using the multiple predicted feature categories and the multiple labeled feature categories of the training image to obtain the cattle classification model.
[0151] In some embodiments, the cattle subcategories may include Khundi, Mix, and Neli Ravi; the plurality of predicted feature categories and the plurality of labeled feature categories may include one or more of a pattern category, an eye category, a body color category, a horn category, a tail category, a body category, a neck category, and a udder category. In other embodiments, the cattle subcategories may include buffalo, cattle, and yaks.
[0152] See also Fig.16 The embodiment of the present application further provides an electronic device 200, which includes at least one memory 210, at least one processor 220, and a bus 230 connecting different platform systems.
[0153] The memory 210 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 211 and / or a cache memory 212 , and may further include a read-only memory (ROM) 213 .
[0154] Among them, the memory 210 also stores a computer program, which can be executed by the processor 220, so that the processor 220 executes the steps of the cattle image classification method in the embodiment of the present application. Its specific implementation method is consistent with the implementation method and the technical effect achieved recorded in the embodiment of the above-mentioned cattle image classification method, and some contents will not be repeated here.
[0155] The memory 210 may also include a utility 214 having at least one program module 215, such program module 215 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0156] Accordingly, the processor 220 may execute the above-mentioned computer program and may execute the utility 214 .
[0157] The bus 230 may be a bus representing one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
[0158] The electronic device 200 may also communicate with one or more external devices 240 such as keyboards, pointing devices, Bluetooth devices, etc., and may also communicate with one or more devices that can interact with the electronic device 200, and / or communicate with any device (such as a router, a modem, etc.) that enables the electronic device 200 to communicate with one or more other computing devices. Such communication may be performed through the input and output interface 250. In addition, the electronic device 200 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 260. The network adapter 260 may communicate with other modules of the electronic device 200 through the bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0159] The embodiment of the present application also provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed, the steps of the cattle image classification method in the embodiment of the present application are implemented. The specific implementation method is consistent with the implementation method and the technical effect achieved in the embodiment of the cattle image classification method described above, and some contents will not be repeated here.
[0160] Fig.17 The program product 300 provided in this embodiment for implementing the above-mentioned cattle image classification method is shown, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product 300 of the present invention is not limited to this. In the present application, the readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. The program product 300 can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0161] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium may also be any readable medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or for use in combination with the program. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above. The program code for performing the operation of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as C language or similar programming languages. The program code may be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device, partially on a remote computing device, or entirely on a remote computing device or server. Where a remote computing device is involved, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0162] This application is explained from the perspectives of purpose of use, effectiveness, progress and novelty, and has met the functional enhancement and usage requirements emphasized by the Patent Law. The above description and drawings of this application are only the preferred embodiments of this application, and are not intended to limit this application. Therefore, all structures, devices, features, etc. that are similar or identical to this application, that is, all equivalent replacements or modifications made in accordance with the scope of the patent application of this application, should fall within the scope of protection of the patent application of this application.
Claims
1. A cattle image classification method, characterized in that: The method comprises: Using a feature extraction module of a cattle classification model to perform feature extraction on an image to be classified, and obtaining a feature extraction result of the image to be classified, wherein the image to be classified is a cattle image to be classified; Using the classification module of the cattle classification model to classify the feature extraction result of the image to be classified, to obtain predicted classification information of the image to be classified, wherein the predicted classification information is used to indicate the predicted subdivision category of the cattle; The training process of the cattle classification model includes: Using the predicted classification information and the labeled classification information of the training image, the model to be trained is trained to obtain the cattle classification model; The classification module includes a fully connected layer; The method of using the predicted classification information and the labeled classification information of the training image to train the model to be trained to obtain the cattle classification model comprises: Using the predicted classification information and the labeled classification information of the training image, the parameters of the feature extraction module of the to-be-trained model are updated to obtain a semi-trained model; Inputting the training image into the semi-training model, and using the fully connected layer of the classification module of the semi-training model to output a plurality of feature vectors of the training image; Performing feature classification on a plurality of feature vectors of the training image to obtain a plurality of predicted feature categories of the training image; All parameters of the semi-trained model are updated using the multiple predicted feature categories and the multiple labeled feature categories of the training image to obtain the cattle classification model.
2. The cattle image classification method according to claim 1, characterized in that: The training process of the cattle classification model also includes: Using a feature extraction module of the model to be trained to perform feature extraction on a training image to obtain a feature extraction result of the training image, wherein the training image is a cow image used for model training; The feature extraction result of the training image is classified using the classification module of the model to be trained to obtain predicted classification information of the training image, where the predicted classification information is used to indicate the predicted subdivision category of the cattle.
3. The cattle image classification method according to claim 2, characterized in that: The step of extracting features from the training image using the feature extraction module of the model to be trained to obtain a feature extraction result of the training image includes: Processing the training image using the first convolution block of the feature extraction module to obtain a first processing result of the training image; Based on the first processing result of the training image, a feature extraction result of the training image is obtained.
4. The cattle image classification method according to claim 3, characterized in that: The step of obtaining a feature extraction result of the training image based on the first processing result of the training image includes: Using the first pooling layer of the feature extraction module to pool the first processing result of the training image, to obtain a first pooling result of the training image; Processing the first pooling result of the training image using the second convolution block of the feature extraction module to obtain a second processing result of the training image; Based on the second processing result of the training image, a feature extraction result of the training image is obtained.
5. The cattle image classification method according to claim 4, characterized in that: The step of obtaining a feature extraction result of the training image based on the second processing result of the training image includes: Using the second pooling layer of the feature extraction module to pool the second processing result of the training image to obtain a second pooling result of the training image; Using the third convolution block of the feature extraction module to process the second pooling result of the training image, to obtain a third processing result of the training image; Based on the third processing result of the training image, a feature extraction result of the training image is obtained.
6. The cattle image classification method according to claim 5, characterized in that: The step of obtaining a feature extraction result of the training image based on the third processing result of the training image includes: Using the third pooling layer of the feature extraction module to pool the third processing result of the training image, to obtain a third pooling result of the training image; Processing the third pooling result of the training image using the fourth convolution block of the feature extraction module to obtain a fourth processing result of the training image; Based on the fourth processing result of the training image, a feature extraction result of the training image is obtained.
7. The cattle image classification method according to claim 6, characterized in that: The step of obtaining a feature extraction result of the training image based on the fourth processing result of the training image includes: Using the fourth pooling layer of the feature extraction module to pool the fourth processing result of the training image to obtain a fourth pooling result of the training image; Processing the fourth pooling result of the training image using the fifth convolution block of the feature extraction module to obtain a fifth processing result of the training image; The fifth processing result of the training image is used as the feature extraction result of the training image.
8. The cattle image classification method according to any one of claims 3 to 7, characterized in that: The processing process of each convolution block in the feature extraction module on the input image is as follows: Convolving the input image using the convolution layer of the convolution block to obtain a convolution result of the input image; Using the batch normalization layer of the convolution block to batch normalize the convolution result of the input image, so as to obtain a batch normalized result of the input image; The batch normalization result of the input image is activated by using the activation layer of the convolution block to obtain the activation result of the input image as the processing result of the input image.
9. The cattle image classification method according to claim 2, characterized in that: The step of classifying the feature extraction result of the training image using the classification module of the model to be trained to obtain the predicted classification information of the training image includes: Using the fully connected layer of the classification module to fully connect the feature extraction result of the training image, to obtain a fully connected result of the training image; The fully connected result of the training image is classified using the classifier of the classification module to obtain predicted classification information of the training image.
10. The cattle image classification method according to claim 1, characterized in that: The subcategories of the said cattle include Khundi, Mix and Nili-Ravi; The plurality of predicted feature categories and the plurality of labeled feature categories respectively include one or more of a pattern category, an eye category, a body color category, a horn category, a tail category, a body category, a neck category, and a breast category.
11. A cattle image classification device, characterized in that: The device comprises: A feature extraction module is used to extract features from the image to be classified using the feature extraction module of the cattle classification model to obtain a feature extraction result of the image to be classified, wherein the image to be classified is a cattle image to be classified; An image classification module, used for classifying the feature extraction result of the image to be classified using the classification module of the cattle classification model to obtain predicted classification information of the image to be classified, wherein the predicted classification information is used to indicate the predicted subdivision category of the cattle; The training process of the cattle classification model includes: Using the predicted classification information and the labeled classification information of the training image, the model to be trained is trained to obtain the cattle classification model; The classification module includes a fully connected layer; The method of using the predicted classification information and the labeled classification information of the training image to train the model to be trained to obtain the cattle classification model comprises: Using the predicted classification information and the labeled classification information of the training image, the parameters of the feature extraction module of the to-be-trained model are updated to obtain a semi-trained model; Inputting the training image into the semi-training model, and using the fully connected layer of the classification module of the semi-training model to output a plurality of feature vectors of the training image; Performing feature classification on a plurality of feature vectors of the training image to obtain a plurality of predicted feature categories of the training image; All parameters of the semi-trained model are updated using the multiple predicted feature categories and the multiple labeled feature categories of the training image to obtain the cattle classification model.
12. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the cattle image classification method according to any one of claims 1 to 10 when executing the computer program.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the cattle image classification method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Information entropy-based fine classification recognition model training and image recognition method and device
CN110929802A
Image classification model training method and device, computer equipment and storage medium
CN111353542A
Method and system for classification and visualisation of 3D images
WO2020162834A1