Animal identity recognition method and device, electronic equipment and storage medium
Through the feature extraction and fusion technology of the target detection model, combined with multi-scale and attention mechanisms, the problem of insufficient feature extraction in animal identity recognition is solved and the accuracy and reliability of recognition are improved.
Patent Information
- Application Number
- CN202410864237.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-30
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-30
AI Technical Summary
Existing technology is difficult to extract stable and accurate features in animal identification, resulting in the inability to fully reflect the uniqueness of individual animals, thus affecting the accuracy of identification.
Using the target detection model, multiple local features are extracted from the image to be identified through the feature extraction layer and feature fusion is performed to generate a comprehensive feature vector. Combined with multi-scale feature extraction and attention mechanism, it is input to the target detection layer for animal identity recognition. .
It significantly improves the expression ability and recognition accuracy of features, enhances the model's ability to capture the uniqueness of individual animals in images, improves the accuracy and reliability of the recognition process, and solves the problem of insufficient feature extraction in the existing technology.
Smart Images

Figure CN118736624A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to an animal identification method, device, electronic equipment and storage medium. Background Art
[0002] With the development of modern smart agriculture, animal identification technology plays an important role in automatically identifying and recording animal information. This technology provides technical support for key links such as animal inventory, behavior monitoring and growth status assessment, and can be extended to farmers to monitor the health status of animals in real time and track their behavior habits. At present, there are three main methods in the field of animal individual identification: facial feature recognition, individual feature recognition and tracking algorithm recognition. The facial feature recognition method relies on extracting key features from the face of the animal and using machine learning technology to distinguish between individuals. Individual feature recognition relies on the analysis of features of specific parts of the animal for individual identification. The identification method based on tracking algorithms continuously locks the target animal through tracking technology to confirm its identity.
[0003] However, in actual application, existing technologies still face some challenges in animal identity recognition. It is very difficult to extract stable and accurate features from facial features, body shape or other individual features. The feature expression ability is insufficient, and it is difficult to fully capture the subtle and key information in the image, resulting in the inability to fully reflect the uniqueness of individual animals, and thus the inability to accurately identify the animal's identity. Summary of the invention
[0004] The present invention provides an animal identification method, device, electronic device and storage medium, which are used to solve the defect that the prior art is difficult to fully capture subtle and key information in an image when extracting features, resulting in the inability to accurately identify the animal's identity.
[0005] The present invention provides an animal identification method, comprising: Inputting the image to be identified into the feature extraction layer in the target detection model to obtain the feature vector output by the feature extraction layer; inputting the feature vector into the target detection layer in the target detection model to obtain the target detection result output by the target detection layer; Animal identity recognition is performed based on the target detection result to obtain the identity recognition result of the animal in the image to be recognized; wherein the feature extraction layer includes a first feature extraction layer, the first feature extraction layer is used to extract multiple local features of the image to be recognized, and the first feature extraction layer is also used to perform feature fusion on the multiple local features; the target detection model is trained based on a sample recognition image and a target detection result label corresponding to the sample recognition image.
[0006] According to the present invention, there is provided an animal identification method, wherein the image to be identified is input into a feature extraction layer in a target detection model to obtain a feature vector output by the feature extraction layer, comprising: The image to be identified is input into the first feature extraction layer to obtain an initial feature vector output by the first feature extraction layer; the initial feature vector is input into the second feature extraction layer in the feature extraction layer to obtain a feature vector output by the second feature extraction layer, and the second feature extraction layer is used to perform multi-scale feature extraction on the initial feature vector.
[0007] According to the present invention, there is provided an animal identification method, wherein the image to be identified is input into the first feature extraction layer to obtain an initial feature vector output by the first feature extraction layer, comprising: Inputting the image to be recognized into the third feature extraction layer in the first feature extraction layer to obtain a first sub-feature vector output by the third feature extraction layer; Inputting the first sub-feature vector into a first downsampling layer in the first feature extraction layer to obtain a second sub-feature vector output by the first downsampling layer, wherein the first downsampling layer is used to downsample the first sub-feature vector to obtain a first downsampling feature map, and the first downsampling layer is also used to perform local feature extraction on the first downsampling feature map; Inputting the second sub-feature vector into a second downsampling layer in the first feature extraction layer to obtain a third sub-feature vector output by the second downsampling layer, wherein the second downsampling layer is used to downsample the second sub-feature vector to obtain a second downsampling feature map, and the second downsampling layer is also used to perform local feature extraction on the second downsampling feature map; The third sub-feature vector is input to a fourth feature extraction layer in the first feature extraction layer to obtain an initial feature vector output by the fourth feature extraction layer.
[0008] According to the present invention, there is provided an animal identification method, wherein the image to be identified is input into a third feature extraction layer in the first feature extraction layer, and a first sub-feature vector output by the third feature extraction layer is obtained, comprising: Inputting the image to be identified into the block feature extraction layer in the third feature extraction layer to obtain a block feature vector output by the block feature extraction layer, wherein the block feature extraction layer is used to segment the image to be identified to obtain a plurality of blocks, and the block feature extraction layer is also used to extract features from the plurality of blocks; The block feature vector is input to a fifth feature extraction layer in the third feature extraction layer to obtain a first sub-feature vector output by the fifth feature extraction layer.
[0009] According to the present invention, there is provided an animal identification method, wherein the step of inputting the third sub-feature vector into a fourth feature extraction layer in the first feature extraction layer to obtain an initial feature vector output by the fourth feature extraction layer comprises: inputting the third sub-feature vector into a first pooling layer in the fourth feature extraction layer to obtain a first pooling feature vector output by the first pooling layer; The first pooled feature vector is input to the second pooling layer in the fourth feature extraction layer to obtain an initial feature vector output by the second pooling layer.
[0010] According to the present invention, there is provided an animal identification method, wherein the second feature extraction layer comprises a first convolution block, a second convolution block, a third convolution block and a fourth convolution block connected in sequence; The first convolution block includes a first upsampling layer, a first connection layer and a first convolution layer connected in sequence; The second convolution block includes a second upsampling layer, a second connection layer, a first multi-scale feature extraction layer and a first attention mechanism feature extraction layer connected in sequence; The third convolution block includes a second convolution layer, a third connection layer, a second multi-scale feature extraction layer, and a second attention mechanism feature extraction layer connected in sequence; The fourth convolution block includes a third convolutional layer, a fourth connection layer, a third multi-scale feature extraction layer and a third attention mechanism feature extraction layer which are connected in sequence.
[0011] According to the present invention, there is provided an animal identification method, wherein the animal identification is performed based on the target detection result to obtain the identification result of the animal in the image to be identified, comprising: Based on the target detection result, determining two ear tag colors of the animal in the image to be identified; the two ear tag colors include an ear tag color of the left ear of the animal and an ear tag color of the right ear of the animal; Based on the two ear tag colors, an identity recognition result of the animal in the image to be recognized is determined.
[0012] The present invention also provides an animal identification device, comprising: A feature extraction module is used to input the image to be identified into the feature extraction layer in the target detection model to obtain the feature vector output by the feature extraction layer; A target detection module, used for inputting the feature vector into the target detection layer in the target detection model to obtain the target detection result output by the target detection layer; An identification module, used to perform animal identification based on the target detection result, and obtain an identification result of the animal in the image to be identified; Among them, the feature extraction layer includes a first feature extraction layer, which is used to extract multiple local features of the image to be identified, and the first feature extraction layer is also used to perform feature fusion on the multiple local features; the target detection model is trained based on the sample recognition image and the target detection result label corresponding to the sample recognition image.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned animal identification methods is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the animal identification method as described in any one of the above is implemented.
[0015] The animal identification method, device, electronic device and storage medium provided by the present invention input the image to be identified into the feature extraction layer in the target detection model to obtain the feature vector output by the feature extraction layer; and the feature extraction layer includes a first feature extraction layer, the first feature extraction layer is used to extract multiple local features of the image to be identified, and the first feature extraction layer is also used to perform feature fusion on multiple local features. Through the first feature extraction layer, the present invention can extract multiple local features from the image to be identified, and integrate these local information through feature fusion technology to form a comprehensive feature vector. This feature vector encodes the key information in the image, significantly improves the expressive ability of the features, and provides rich feature representation for subsequent target detection tasks. This feature extraction and fusion method not only enhances the target detection model's ability to capture the uniqueness of individual animals in the image, but also improves the accuracy and reliability of the identification process. In this way, the present invention effectively solves the shortcomings of the prior art in animal identification and provides strong technical support for achieving more accurate animal identification. The feature vector is input into the target detection layer in the target detection model to obtain the target detection result output by the target detection layer; animal identification is performed based on the target detection result to obtain the identification result of the animal in the image to be identified; and the target detection model is trained based on the sample identification image and the target detection result label corresponding to the sample identification image; the target detection model learns how to identify and classify animals from various different images during the training process. This data-driven approach enables the model to have good generalization ability, so that it can still maintain high detection performance when facing images in different scenes and under different conditions, and improve the stability and reliability of animal identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a schematic diagram of the process of the animal identification method provided by the present invention.
[0018] Figure 2 It is one of the structural schematic diagrams of the target detection model provided by the present invention.
[0019] Figure 3 This is the second structural schematic diagram of the target detection model provided by the present invention.
[0020] Figure 4 This is the third structural schematic diagram of the target detection model provided by the present invention.
[0021] Figure 5 This is the fourth structural schematic diagram of the target detection model provided by the present invention.
[0022] Figure 6 This is the fifth structural diagram of the target detection model provided by the present invention.
[0023] Figure 7 It is a structural schematic diagram of the animal identification device provided by the present invention.
[0024] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] In the context of modern smart agriculture, animal identification technology is of great significance for improving breeding efficiency, optimizing feeding management, and strengthening disease prevention. However, the applicant of the present invention has found in the process of practical application and research that although the methods of facial feature recognition, individual feature recognition, and tracking algorithm recognition are instructive in theory, they face challenges in extracting stable and accurate features in practical applications. They have obvious deficiencies in extracting stable and accurate features. These methods often find it difficult to capture the subtle and critical information of the uniqueness of individual animals in the image, resulting in the inability to fully reflect the uniqueness of individual animals. Due to the limitations of feature extraction, it is difficult for existing methods to achieve high-accuracy animal identification in practical applications.
[0027] To overcome these challenges, the applicant conducted further research and explored technologies such as deep learning and image processing. The applicant found that the key to solving these problems lies in improving the technical means of feature extraction and target detection to more finely capture and express subtle and critical information in the image, which can significantly improve the accuracy and robustness of the recognition system.
[0028] In view of the above problems, the present invention proposes the following embodiments. Figure 1 A schematic diagram of the process of the animal identification method provided by the present invention, such as Figure 1 As shown, the animal identification method includes: Step 110: input the image to be identified into the feature extraction layer in the target detection model to obtain the feature vector output by the feature extraction layer.
[0029] Here, the image to be identified contains the animals to be identified, that is, the target animal individuals, which are the main objects of the identification process. The image to be identified may also include other elements, such as fences, water tanks, etc. The image to be identified is input into the feature extraction layer in the target detection model. The main function of the feature extraction layer is to extract key feature information from the original image. These feature information are converted into feature vectors, which are a high-dimensional numerical representation that contains various features in the image, such as shape, color, texture, etc. Through the processing of the feature extraction layer, the complex information in the original image is compressed and converted into a more structured form, which is convenient for subsequent analysis and processing.
[0030] The feature extraction layer includes a first feature extraction layer, the first feature extraction layer is used to extract multiple local features of the image to be identified, and the first feature extraction layer is also used to perform feature fusion on the multiple local features.
[0031] The design of the first feature extraction layer can not only effectively extract multiple local features in the image, but also integrate these local features through feature fusion technology to form a comprehensive feature vector with high expressiveness and robustness. This process significantly improves the accuracy and reliability of animal identification, while enhancing the generalization ability of the model and ensuring stable performance in a changing practical application environment.
[0032] Exemplarily, the embodiments of the present invention are applied to indoor breeding environments, such as pig farms, and the design of the image to be identified is crucial when performing animal identification. The image to be identified must not only clearly present the target animal individuals, that is, multiple pigs, as the core object of the identification process. It should also contain key elements in the breeding environment, such as fixed facilities such as troughs, fences, and rest areas. These environmental features not only enrich the image content, but also provide important contextual information for analyzing the behavior patterns of animals. In addition, the image background of the image to be identified, such as the ground and walls, provides the necessary contrast to distinguish the individual animals in the foreground, which helps to achieve more accurate target recognition in complex environments. Combining these elements, the image to be identified constitutes a comprehensive visual scene, providing rich feature information for subsequent feature extraction.
[0033] More specifically, the image to be identified can be extracted from the farming video data, which is realized by four network surveillance cameras installed in the farming environment. These cameras support RTMP (Real-Time Messaging Protocol), have high-definition video and electric zoom functions, and can clearly capture multiple animals in the farming environment and elements in the environment, such as troughs, fences, etc. The first camera is set on the wall diagonally above the feeding trough about 3 meters from the ground, mainly monitoring the animal's eating behavior and feeding trough. The second camera is set on the wall directly above the drinking fountain about 2 meters from the ground, focusing on monitoring the animal's drinking behavior. The third and fourth cameras are installed in a position where they can overlook the panoramic view, providing a global perspective of the farming environment, which helps to observe the overall activities and distribution of animals.
[0034] These cameras form a 24-hour real-time video surveillance system, which pushes the collected video data to the Nginx server for recording and storage through the RTMP protocol. The RTMP protocol is particularly suitable for the transmission of real-time video data due to its high efficiency, high concurrency and low memory usage. The Nginx server is configured as an RTMP streaming media server by installing the nginx-rtmp-module module. This module enables Nginx to handle operations such as publishing, playing and forwarding RTMP streams, and is a key technical component for achieving real-time transmission and storage of video data. Video data is saved in segments of 30 minutes. This segmentation strategy helps to ensure data continuity while facilitating subsequent video analysis and processing. The images to be identified are obtained by extracting frames from the farming video data, and these images to be identified will be used as input data for the target detection model to process.
[0035] Of course, the image to be recognized can also be obtained by other methods, which will not be described in detail here.
[0036] In another embodiment, before the image to be identified is input into the feature extraction layer, the image to be identified is first processed using an image preprocessing network structure. Specifically, before feature extraction, the image to be identified is optimized using an image preprocessing network structure to improve the effect of subsequent feature extraction. The spatial dimensions (height and width) of the feature map are gradually reduced through multiple convolution layers to achieve abstraction and compression of the image features, thereby extracting key information from the image. Further, a five-layer attention mechanism is introduced, which can focus on important areas or features in the image to achieve refined extraction of key features. Through multi-layer convolution operations, the details and texture of the image are gradually restored from the abstract features, which helps to retain important visual information in the image. The original image is weighted using the extracted feature map information to enhance the key features in the image while suppressing unimportant or noise information. Finally, an optimized new image to be identified is generated, which is more natural and smooth, has more prominent features, and is more suitable for target detection.
[0037] The advantage of doing this is that, through this image preprocessing network structure, the image can be optimized before feature extraction, providing a more accurate and robust feature representation for subsequent target detection, thereby improving the recognition performance of the entire system.
[0038] Exemplarily, the image preprocessing network structure may be an EnlightenGAN (generative adversarial network) network structure.
[0039] Step 120: input the feature vector into the target detection layer in the target detection model to obtain the target detection result output by the target detection layer.
[0040] In one embodiment, the feature vector obtained from the feature extraction layer contains key information in the image, which is passed to the target detection layer for further processing to obtain a target detection result. The target detection result contains multiple precise bounding box locations, each of which contains an animal, and each bounding box can clearly display various areas of the animal's body, including but not limited to the animal's ears, the color of the ear tag on the ear, and other multimodal information. Through the above information, the target detection result provides the necessary visual and feature data for subsequent animal identification to improve the accuracy of identification.
[0041] More specifically, the object detection layer includes a Detect detection head, which uses the feature vector to generate region proposals for potential target objects. These region proposals define the location and range of the image that may contain the target object. For each region proposal, the Detect detection head predicts a bounding box that represents the specific location and size of the target object in the image in the form of coordinates. The bounding box is a standard output in object detection because it provides accurate spatial positioning of the target object. In addition to the location and size of the bounding box, the Detect detection head also predicts a category label for each bounding box, indicating the category to which the target object in the box may belong, such as "pig". At the same time, a confidence score is generated for each bounding box to indicate the model's confidence level in the accuracy of the prediction. In order to select the most accurate bounding box from multiple overlapping predictions, the Detect detection head applies the NMS algorithm to remove predictions with low confidence scores and retain the best bounding box.
[0042] The target detection model is trained based on the sample recognition image and the target detection result label corresponding to the sample recognition image.
[0043] During the training process, the model learns the relationship between the features in the sample image and its label, so that in subsequent practical applications, it can predict the target detection results based on the input image features.
[0044] The principle of this training method is to train the model through a large number of sample images and their corresponding labels, so that the model can learn the characteristic representations of different targets (animal individuals) and the association between these characteristics and corresponding labels. Through this training method, the model can gradually optimize its own parameters and improve its generalization ability for new images, so that it can accurately identify targets in unseen images.
[0045] The benefit of this training method is that it can make the model have higher recognition accuracy and generalization ability. By making full use of a large amount of sample data for training, the model can learn rich feature representations, so that it can better adapt to target detection tasks in different scenarios and conditions in practical applications. At the same time, this training method also helps to improve the robustness of the model, so that it can still maintain good recognition results in the face of some noise interference or large changes.
[0046] Step 130 , performing animal identification based on the target detection result to obtain an identification result of the animal in the image to be identified.
[0047] The principle of this step is to use the target detection results detected by the target detection model to extract information from the bounding box image area in the target detection results. These features may include color, texture, shape and other visual information that are helpful for identity recognition. Special attention is paid to features that are helpful for identity recognition, such as the color of the animal's ear tag or other unique identifiers. The extracted features are matched with the known animal identity database to determine the identity of the animal in the image to be identified.
[0048] When dealing with individual animals with highly similar appearances, traditional feature extraction methods often have difficulty in fully capturing the subtle differences between them, resulting in insufficient feature expression capabilities and difficulty in achieving accurate distinction. The target detection model of the present invention can accurately detect the position and bounding box of the animal. Then, for each detected animal area, more detailed feature information, such as color, texture, shape, etc., is extracted, which helps to distinguish different individuals. In this way, the subtle differences between individual animals can be better captured, the feature expression capabilities can be improved, and accurate identification of animals with similar appearances can be achieved.
[0049] The animal identification method provided by the embodiment of the present invention can extract multiple local features from the image to be identified through the first feature extraction layer, and integrate these local information through feature fusion technology to form a comprehensive feature vector. This feature vector encodes the key information in the image, significantly improves the expressive ability of the features, and provides rich feature representations for subsequent target detection tasks. This feature extraction and fusion method not only enhances the target detection model's ability to capture the uniqueness of individual animals in the image, but also improves the accuracy and reliability of the identification process. In this way, the present invention effectively solves the shortcomings of the prior art in animal identification and provides strong technical support for achieving more accurate animal identification.
[0050] Based on any of the above embodiments, in the method, inputting the image to be identified into the feature extraction layer in the target detection model to obtain the feature vector output by the feature extraction layer includes: The image to be identified is input into the first feature extraction layer to obtain an initial feature vector output by the first feature extraction layer; the initial feature vector is input into the second feature extraction layer in the feature extraction layer to obtain a feature vector output by the second feature extraction layer, and the second feature extraction layer is used to perform multi-scale feature extraction on the initial feature vector.
[0051] To better understand the target detection model of the embodiment of the present invention, Figure 2 As shown, the target detection model includes a first feature extraction layer, a second feature extraction layer and a target detection layer.
[0052] In one embodiment, the feature extraction layer includes a first feature extraction layer and a second feature extraction layer; the image to be identified is input into the first feature extraction layer to obtain an initial feature vector output by the first feature extraction layer; wherein the feature extraction layer includes the first feature extraction layer, the first feature extraction layer is used to extract multiple local features of the image to be identified, and the first feature extraction layer is also used to perform feature fusion on the multiple local features; further, the initial feature vector is input into the second feature extraction layer in the feature extraction layer to obtain a feature vector output by the second feature extraction layer, and the second feature extraction layer is used to perform multi-scale feature extraction on the initial feature vector.
[0053] More specifically, the main task of the first feature extraction layer is to extract local features from the image to be identified. These local features may include basic visual elements such as edges, textures, and colors in the image, which are the basis for individual animal identification. After extracting multiple local features, the first feature extraction layer further fuses these local features into an initial feature vector. This step helps to integrate information from different local regions to form a more comprehensive feature representation. Local feature extraction is usually achieved through convolution operations, while feature fusion may be achieved through pooling layers or specific fusion strategies such as weighted averaging, feature splicing, etc. The second feature extraction layer receives the initial feature vector and performs multi-scale analysis on it. The object detection model analyzes features at different scales to capture comprehensive information from local details to global patterns. Through multi-scale feature extraction, the second feature extraction layer is able to mine deeper and more abstract feature representations, which may include higher-level attributes such as the animal's body shape and posture. Multi-scale feature extraction can be achieved by stacking multiple convolutional layers and pooling layers, each layer extracting features at a different scale, or using specific multi-scale structures such as feature pyramid networks (FPN).
[0054] In another embodiment, the feature extraction layer only includes the first feature extraction layer, and the image to be identified is input into the first feature extraction layer to obtain the feature vector output by the first feature extraction layer; more specifically, the first feature extraction layer is composed of a plurality of convolutional layers stacked in sequence, and each layer is responsible for extracting local features from the input image. Each convolutional layer captures the local features of the image, such as edges, textures, etc., through its filter (convolution kernel), and generates a corresponding feature map. In order to enhance the expressive power of the network, the output of each convolutional layer will pass through a nonlinear activation function, such as ReLU, which helps the network learn complex feature mappings. Each convolutional layer outputs a feature map, in which each pixel represents a feature value, and these feature maps integrate the feature information of the image at different levels. Between the convolutional layers, a pooling layer can be added or the structure of the convolutional layer itself can be used to achieve feature fusion, integrating feature information at different levels to form a more comprehensive image feature representation. At the end of the convolutional layer sequence, the feature map output by the last convolutional layer will be straightened to form a one-dimensional feature vector. This feature vector summarizes the key feature information of the entire image and provides input data for subsequent classifiers or subsequent tasks.
[0055] Of course, the feature extraction layer may also be other structures, which will not be described here one by one.
[0056] The animal identification method provided by the embodiment of the present invention, through the feature extraction of the first feature extraction layer and the second feature extraction layer, the target detection model can more comprehensively understand the image content and improve the recognition ability of individual animals. The combination of local features and multi-scale features helps to improve the accuracy of recognition, especially when the individual animals are similar in appearance or the environment is complex. Not only that, feature fusion and multi-scale analysis make the target detection model more robust and more resistant to occlusion, lighting changes and background interference. The feature vectors extracted and generated by the first feature extraction layer and the second feature extraction layer contain rich information from shallow to deep layers, providing more clues for subsequent target detection and identification.
[0057] Based on any of the above embodiments, in the method, inputting the image to be recognized into the first feature extraction layer to obtain an initial feature vector output by the first feature extraction layer includes: Inputting the image to be recognized into the third feature extraction layer in the first feature extraction layer to obtain a first sub-feature vector output by the third feature extraction layer; Inputting the first sub-feature vector into a first downsampling layer in the first feature extraction layer to obtain a second sub-feature vector output by the first downsampling layer, wherein the first downsampling layer is used to downsample the first sub-feature vector to obtain a first downsampling feature map, and the first downsampling layer is also used to perform local feature extraction on the first downsampling feature map; Inputting the second sub-feature vector into a second downsampling layer in the first feature extraction layer to obtain a third sub-feature vector output by the second downsampling layer, wherein the second downsampling layer is used to downsample the second sub-feature vector to obtain a second downsampling feature map, and the second downsampling layer is also used to perform local feature extraction on the second downsampling feature map; The third sub-feature vector is input to a fourth feature extraction layer in the first feature extraction layer to obtain an initial feature vector output by the fourth feature extraction layer.
[0058] To better understand the first feature extraction layer of the embodiment of the present invention, as shown in FIG. Figure 3 As shown, the first feature extraction layer includes a third feature extraction layer, a first downsampling layer, a second downsampling layer and a fourth feature extraction layer.
[0059] Specifically, in the third feature extraction layer, a convolution operation is performed on the image to be identified to extract a first sub-feature vector, and the first sub-feature vector is downsampled by the first downsampling layer to obtain a second sub-feature vector, which helps to reduce the size of the feature map and improve the efficiency of subsequent calculations. The second sub-feature vector is downsampled by the second downsampling layer to obtain a third sub-feature vector. The purpose of this is to gradually reduce the size of the feature map through multiple downsampling while retaining important feature information. Finally, the fourth feature extraction layer receives the third sub-feature vector, performs further feature extraction, and obtains an initial feature vector. The fourth feature extraction layer usually includes a fully connected layer or other layers for extracting high-level features.
[0060] Exemplarily, the first feature extraction layer can use EfficientViT (Visual Transformer) as the backbone network.
[0061] In one embodiment, the image to be identified is input into the third feature extraction layer in the first feature extraction layer to obtain the first sub-feature vector output by the third feature extraction layer; the first sub-feature vector is input into the first downsampling layer in the first feature extraction layer to obtain the initial feature vector output by the first downsampling layer, and the initial feature vector is input into the second feature extraction layer for the next step of feature extraction. By reducing the number of feature extraction layers and downsampling layers, the network structure can be simplified and the amount of calculation can be reduced, thereby speeding up the feature extraction. The target detection model can be run in a resource-constrained environment, such as an embedded device. Although the number of layers is reduced, the local features of the input image are still extracted through the convolution operation, and the features are compressed and extracted through the downsampling layer. In this way, effective image features can still be extracted, but the details and complexity of the features may be reduced, but the purpose of identifying the identity of the animal in the image to be identified can still be achieved. Since the network structure is simplified and the amount of calculation in the feature extraction process is reduced, the image can be processed more quickly, which is suitable for scenes with high real-time requirements, such as real-time monitoring and rapid identification.
[0062] In another embodiment, the image to be identified is input into the third feature extraction layer in the first feature extraction layer to obtain a first sub-feature vector output by the third feature extraction layer; the first sub-feature vector is input into the first downsampling layer in the first feature extraction layer to obtain a second sub-feature vector output by the first downsampling layer; the second sub-feature vector is input into the second downsampling layer in the first feature extraction layer to obtain an initial feature vector output by the second downsampling layer, and the initial feature vector is input into the second feature extraction layer for the next step of feature extraction.
[0063] Of course, the first feature extraction layer may also be other structures, which will not be described here one by one.
[0064] The animal identification method provided by the embodiment of the present invention realizes the fine extraction and effective fusion of multi-level features through the feature extraction and downsampling process of the first feature extraction layer of the present invention, and significantly improves the accuracy and efficiency of animal identification. The generation of the initial feature vector combines local details with global context information, and by gradually reducing the feature dimension, it not only optimizes the computational efficiency but also enhances the generalization ability of the model. This multi-level and multi-scale feature extraction method not only improves the robustness of the recognition system, reduces the interference of noise and occlusion, but also lays a solid foundation for subsequent target detection and identification tasks.
[0065] Based on any of the above embodiments, in the method, inputting the image to be recognized into the third feature extraction layer in the first feature extraction layer to obtain the first sub-feature vector output by the third feature extraction layer includes: Inputting the image to be identified into the block feature extraction layer in the third feature extraction layer to obtain a block feature vector output by the block feature extraction layer, wherein the block feature extraction layer is used to segment the image to be identified to obtain a plurality of blocks, and the block feature extraction layer is also used to extract features from the plurality of blocks; The block feature vector is input to a fifth feature extraction layer in the third feature extraction layer to obtain a first sub-feature vector output by the fifth feature extraction layer.
[0066] To better understand the third feature extraction layer of the embodiment of the present invention, as shown in FIG. Figure 4 As shown, the third feature extraction layer includes a block feature extraction layer and a fifth feature extraction layer.
[0067] More specifically, this step first inputs the image to be identified into a block feature extraction layer, which divides the image into multiple small blocks or regions. After the image is segmented, each block can be independently feature extracted, which helps to focus on different local features in the image. The block feature extraction layer performs feature extraction on each image block, which can capture detailed information of the image, such as texture, edges, etc. Further, the fifth feature extraction layer receives all block feature vectors and integrates or merges them into a single first sub-feature vector. In some cases, the fifth feature extraction layer also includes a feature fusion operation to ensure that the features of different blocks can be effectively combined.
[0068] The benefit is that through this block feature extraction method, the target detection model can more fully understand the image content, especially when the image contains diverse and complex visual information. This method is particularly useful in application scenarios such as smart agriculture because it can improve the accuracy and efficiency of animal identification.
[0069] Exemplarily, the block feature extraction layer may be Overlap PatchEbed (overlap feature extraction module), and the fifth feature extraction layer may be EfficientViT Block.
[0070] The animal identification method provided by the embodiment of the present invention effectively extracts and fuses rich local feature information from the image to be identified through the integrated processing of the block feature extraction layer of the third feature extraction layer and the fifth feature extraction layer. This process not only enhances the model's ability to capture local details of the image, but also significantly improves the expression and recognition accuracy of the features through multi-scale and multi-region feature integration. In addition, the flexibility and robustness of the method ensure that stable recognition performance can be maintained under changing environmental conditions, providing strong technical support for animal identification in smart agriculture.
[0071] Based on any of the above embodiments, in the method, inputting the third sub-feature vector to a fourth feature extraction layer in the first feature extraction layer to obtain an initial feature vector output by the fourth feature extraction layer includes: Inputting the third sub-feature vector into the first pooling layer in the fourth feature extraction layer to obtain a first pooling feature vector output by the first pooling layer; The first pooled feature vector is input to the second pooling layer in the fourth feature extraction layer to obtain an initial feature vector output by the second pooling layer.
[0072] To better understand the fourth feature extraction layer of the embodiment of the present invention, as shown in FIG. Figure 5 As shown, the fourth feature extraction layer includes a first pooling layer and a second pooling layer.
[0073] Specifically, the third sub-feature vector obtained by the previous layer processing is passed as input to the fourth feature extraction layer. Inside the fourth feature extraction layer, the third sub-feature vector is first processed by the first pooling layer. Pooling operations usually include maximum pooling or average pooling, the purpose of which is to reduce the spatial size of the features and extract the main features. The first pooling layer outputs the first pooled feature vector, which further reduces the spatial complexity of the data while maintaining important features. The first pooled feature vector is input to the second pooling layer in the fourth feature extraction layer for deeper pooling operations. The second pooling layer finally outputs the initial feature vector, which has a lower spatial dimension while retaining the key information of the image as much as possible.
[0074] The advantage of this is that through continuous pooling operations, the spatial dimension of the features is effectively reduced, the amount of computation for subsequent processing is reduced, and the model is more robust to small changes and noise. Furthermore, reducing the feature dimension helps to reduce the complexity of the model, thereby preventing overfitting to a certain extent. In general, more critical and abstract feature information can be effectively extracted from the third sub-feature vector, providing a high-quality initial feature vector for subsequent target detection and identity recognition. This method is particularly suitable for smart agricultural scenarios that require processing high-resolution images and large amounts of data.
[0075] Exemplarily, the first pooling layer may be a global average pooling layer (Global AVGPooling), and the second pooling layer may be a spatial pyramid pooling layer (SPPF).
[0076] In another embodiment, a classifier is further provided between the first pooling layer and the second pooling layer inside the fourth feature extraction layer. The introduction of the classifier in the feature extraction process can make a preliminary classification judgment on the features in the intermediate stage of feature extraction. The output of the classifier can be used as a feedback signal to adjust the network parameters and optimize the feature extraction process. The introduction of the classifier may enable the model to further refine and adjust the features after preliminary classification to better adapt to the classification task.
[0077] The animal identification method provided by the embodiment of the present invention effectively reduces the spatial dimension of the feature by continuously pooling the third sub-feature vector, while extracting and retaining key abstract feature information, and generating a stable initial feature vector with high generalization ability. This process not only improves the computational efficiency and enhances the robustness of the feature, but also provides a refined feature representation for subsequent target detection tasks, thereby significantly improving the accuracy and efficiency of animal identification.
[0078] Based on any of the above embodiments, the second feature extraction layer includes a first convolution block, a second convolution block, a third convolution block and a fourth convolution block connected in sequence; The first convolution block includes a first upsampling layer, a first connection layer and a first convolution layer connected in sequence; The second convolution block includes a second upsampling layer, a second connection layer, a first multi-scale feature extraction layer and a first attention mechanism feature extraction layer connected in sequence; The third convolution block includes a second convolution layer, a third connection layer, a second multi-scale feature extraction layer, and a second attention mechanism feature extraction layer connected in sequence; The fourth convolution block includes a third convolutional layer, a fourth connection layer, a third multi-scale feature extraction layer and a third attention mechanism feature extraction layer which are connected in sequence.
[0079] To better understand the second feature extraction layer of the embodiment of the present invention, Figure 6 As shown, the second feature extraction layer includes a first convolution block, a second convolution block, a third convolution block and a fourth convolution block.
[0080] More specifically, the second feature extraction layer consists of multiple convolutional blocks, each of which is responsible for feature extraction and processing at a different level.
[0081] The first convolutional block starts with the first upsampling layer, which is usually used to increase the spatial resolution of the feature map and restore the details of the image. The first upsampling layer is followed by the first connection layer, which is used to merge feature maps of different levels to increase the diversity of features. The first convolutional layer applies convolution operations to further extract local features in the upsampled feature map.
[0082] The benefit of this is that it provides preliminary feature refinement and detail recovery, which helps capture the fine texture and shape information of the image. Feature merging enhances the expressiveness of features and provides richer information for subsequent processing.
[0083] The second upsampling layer of the second convolutional block continues to increase the resolution of the feature map and further restores image details. The second connection layer performs deeper feature fusion, which may involve weighting and combination of different feature maps. Furthermore, the first multi-scale feature extraction layer extracts features at multiple scales to capture features of different degrees. The first attention mechanism feature extraction layer introduces an attention mechanism that can accurately assign attention weights to each neuron, and due to its parameter-free nature, it not only effectively reduces the model size, but also significantly improves the detection speed.
[0084] The second convolutional layer in the third convolutional block further refines feature extraction and enhances the model's sensitivity to local changes. The third connection layer performs feature fusion at a deeper level, integrating feature information from different levels. The second multi-scale feature extraction layer continues to extract features at multiple scales, which may involve more complex multi-scale feature fusion. The second attention mechanism feature extraction layer further optimizes feature focus.
[0085] Here, the structures of the fourth convolution block and the third convolution block are basically the same, and will not be described in detail here.
[0086] In an embodiment of the present invention, the initial feature vector output by the first feature extraction layer is input into the first convolution block, the second convolution block, the third convolution block and the fourth convolution block connected in sequence to obtain the feature vector output by the fourth convolution block.
[0087] Exemplarily, the first multi-scale feature extraction layer and the second multi-scale feature extraction layer may be EMSC modules, and the first attention mechanism feature extraction layer and the second attention mechanism feature extraction layer may be SimAM attention mechanisms.
[0088] More specifically, the implementation of SimAM’s attention mechanism is based on the following precise calculation formula:
[0089] The final neuron calculation formula is as follows: Equation 1, where e is the neuron capacity, t is the target neuron in the channel, i is the neuron index, and X i are the other neurons in the channel, y is the binary label, M is the number of channels, λ is the regularization parameter, and W t is the partial derivative of the weight with respect to t, b t is the partial derivative of the deviation with respect to t, u t is the average value of all neurons except the neuron in the channel, σ tis the variance of all neurons except the neuron being sought in the channel.
[0090] In one embodiment, the initial feature vector output by the first feature extraction layer is input to the second convolution block to obtain the feature vector output by the second convolution block.
[0091] In another embodiment, the initial feature vector output by the first feature extraction layer is input into the second convolution block and the third convolution block connected in sequence, and finally the feature vector output by the third convolution block is obtained.
[0092] In another embodiment, the initial feature vector output by the first feature extraction layer is input to the second convolution block, the third convolution block and the fourth convolution block which are connected in sequence, and finally the feature vector output by the fourth convolution block is obtained.
[0093] In another embodiment, the initial feature vector output by the first feature extraction layer is input to the first convolution block and the third convolution block connected in sequence, and finally the feature vector output by the third convolution block is obtained.
[0094] In another embodiment, the initial feature vector output by the first feature extraction layer is input to the first convolution block, the third convolution block and the fourth convolution block connected in sequence, and finally the feature vector output by the fourth convolution block is obtained.
[0095] The animal identification method provided by the embodiment of the present invention realizes the process from upsampling to multi-scale feature extraction and then to the guidance of the attention mechanism through a series of structured convolution blocks in the second feature extraction layer. This coherent process not only enhances the expressive power of the features, but also significantly improves the model's in-depth understanding of the image content through feature fusion and refinement. The introduction of the attention mechanism further ensures that the model can focus on the most critical information in the image, thereby improving the accuracy and robustness of recognition. This comprehensive feature extraction strategy provides an efficient, accurate and stable technical solution for animal identification in smart agriculture.
[0096] Based on the above embodiment, in the method, performing animal identification based on the target detection result to obtain the identification result of the animal in the image to be identified includes: Based on the target detection result, determining two ear tag colors of the animal in the image to be identified; the two ear tag colors include an ear tag color of the left ear of the animal and an ear tag color of the right ear of the animal; Based on the two ear tag colors, an identity recognition result of the animal in the image to be recognized is determined.
[0097] Exemplarily, the embodiment of the present invention is applied to the identification of pigs in a farm. Furthermore, the color information of the pig ear tag is extracted in each bounding box in the target detection result, which can be achieved by image processing technology, such as color space conversion, edge detection, etc. The color information is matched with a pre-set ear tag color determination scheme to determine the pig identity. It should be noted that the ear tag color determination scheme designs a mapping relationship between the identities of all pigs and the ear tag colors. For example, the ear tag with yellow on the left and blue on the right represents pig No. 1, the ear tag with blue on the left and yellow on the right represents pig No. 2, and so on. This method provides a solution to the problems encountered in the prior art when identifying individual animals with highly similar appearances, because the ear tag color of each animal is unique and different from other features of the appearance. Even if the animals have similar appearances, their ear tag colors may be very different, so they can be distinguished by the ear tag color. Furthermore, the pre-set ear tag color determination scheme designs a mapping relationship between the identities of all pigs and the ear tag colors. In this way, the color of each animal's ear tag can be matched to its identity, avoiding the problem of the feature extraction stage being unable to fully capture the subtle differences between individual animals.
[0098] The animal identification method provided by the embodiment of the present invention realizes rapid and accurate identification of the animal identity through the ear tag color identification method based on the target detection result. The method simplifies the identification process and improves the accuracy and speed of identification by utilizing the ear tag color, which is easy to distinguish and highly repeatable. This process not only improves the accuracy and efficiency of identification, but also enhances the robustness and ease of use of the method.
[0099] The animal identification device provided by the present invention is described below. The animal identification device described below and the animal identification method described above can be referenced to each other.
[0100] Figure 7 The schematic diagram of the structure of the animal identification device provided by the present invention is as follows: Figure 7 As shown, the animal identification device comprises: A feature extraction module 710 is used to input the image to be identified into the feature extraction layer in the target detection model to obtain a feature vector output by the feature extraction layer; A target detection module 720, configured to input the feature vector into a target detection layer in the target detection model to obtain a target detection result output by the target detection layer; An identification module 730 is used to perform animal identification based on the target detection result to obtain an identification result of the animal in the image to be identified; Among them, the feature extraction layer includes a first feature extraction layer, which is used to extract multiple local features of the image to be identified, and the first feature extraction layer is also used to perform feature fusion on the multiple local features; the target detection model is trained based on the sample recognition image and the target detection result label corresponding to the sample recognition image.
[0101] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the animal identification method, which includes: inputting the image to be identified into the feature extraction layer in the target detection model to obtain the feature vector output by the feature extraction layer; inputting the feature vector into the target detection layer in the target detection model to obtain the target detection result output by the target detection layer; performing animal identification based on the target detection result to obtain the identification result of the animal in the image to be identified; wherein the feature extraction layer includes a first feature extraction layer, the first feature extraction layer is used to extract multiple local features of the image to be identified, and the first feature extraction layer is also used to perform feature fusion on the multiple local features; the target detection model is trained based on the sample identification image and the target detection result label corresponding to the sample identification image.
[0102] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0103] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the animal identification method provided by the above-mentioned methods, the method comprising: inputting the image to be identified into the feature extraction layer in the target detection model to obtain the feature vector output by the feature extraction layer; inputting the feature vector into the target detection layer in the target detection model to obtain the target detection result output by the target detection layer; performing animal identity recognition based on the target detection result to obtain the identity recognition result of the animal in the image to be identified; wherein the feature extraction layer comprises a first feature extraction layer, the first feature extraction layer being used to extract multiple local features of the image to be identified, and the first feature extraction layer being further used to perform feature fusion on the multiple local features; the target detection model is trained based on a sample identification image and a target detection result label corresponding to the sample identification image.
[0104] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for animal identification, characterized in that: include: Inputting the image to be recognized into the feature extraction layer in the target detection model to obtain the feature vector output by the feature extraction layer; Will The feature vector is input into the target detection layer in the target detection model to obtain the target detection result output by the target detection layer; Perform animal identification based on the target detection result to obtain an identification result of the animal in the image to be identified; The feature extraction layer includes a first feature extraction layer, the first feature extraction layer is used to extract multiple local features of the image to be identified, and the first feature extraction layer is also used to perform feature fusion on the multiple local features; The target detection model is trained based on the sample recognition image and the target detection result label corresponding to the sample recognition image.
2. The animal identification method according to claim 1, characterized in that: The step of inputting the image to be identified into the feature extraction layer in the target detection model to obtain the feature vector output by the feature extraction layer includes: The image to be identified is input into the first feature extraction layer to obtain an initial feature vector output by the first feature extraction layer; the initial feature vector is input into the second feature extraction layer in the feature extraction layer to obtain a feature vector output by the second feature extraction layer, and the second feature extraction layer is used to perform multi-scale feature extraction on the initial feature vector.
3. The animal identification method according to claim 2, characterized in that: The step of inputting the image to be recognized into the first feature extraction layer to obtain an initial feature vector output by the first feature extraction layer includes: Inputting the image to be recognized into the third feature extraction layer in the first feature extraction layer to obtain a first sub-feature vector output by the third feature extraction layer; Inputting the first sub-feature vector into a first downsampling layer in the first feature extraction layer to obtain a second sub-feature vector output by the first downsampling layer, wherein the first downsampling layer is used to downsample the first sub-feature vector to obtain a first downsampling feature map, and the first downsampling layer is also used to perform local feature extraction on the first downsampling feature map; Inputting the second sub-feature vector into a second downsampling layer in the first feature extraction layer to obtain a third sub-feature vector output by the second downsampling layer, wherein the second downsampling layer is used to downsample the second sub-feature vector to obtain a second downsampling feature map, and the second downsampling layer is also used to perform local feature extraction on the second downsampling feature map; The third sub-feature vector is input to a fourth feature extraction layer in the first feature extraction layer to obtain an initial feature vector output by the fourth feature extraction layer.
4. The animal identification method according to claim 3, characterized in that: The step of inputting the image to be recognized into the third feature extraction layer in the first feature extraction layer to obtain a first sub-feature vector output by the third feature extraction layer includes: Inputting the image to be identified into the block feature extraction layer in the third feature extraction layer to obtain a block feature vector output by the block feature extraction layer, wherein the block feature extraction layer is used to segment the image to be identified to obtain a plurality of blocks, and the block feature extraction layer is also used to extract features from the plurality of blocks; The block feature vector is input to a fifth feature extraction layer in the third feature extraction layer to obtain a first sub-feature vector output by the fifth feature extraction layer.
5. The animal identification method according to claim 3, characterized in that: The step of inputting the third sub-feature vector to a fourth feature extraction layer in the first feature extraction layer to obtain an initial feature vector output by the fourth feature extraction layer includes: Inputting the third sub-feature vector into the first pooling layer in the fourth feature extraction layer to obtain a first pooling feature vector output by the first pooling layer; The first pooled feature vector is input to the second pooling layer in the fourth feature extraction layer to obtain an initial feature vector output by the second pooling layer.
6. The animal identification method according to claim 2, characterized in that: The second feature extraction layer includes a first convolution block, a second convolution block, a third convolution block and a fourth convolution block connected in sequence; The first convolution block includes a first upsampling layer, a first connection layer and a first convolution layer connected in sequence; The second convolution block includes a second upsampling layer, a second connection layer, a first multi-scale feature extraction layer and a first attention mechanism feature extraction layer connected in sequence; The third convolution block includes a second convolution layer, a third connection layer, a second multi-scale feature extraction layer, and a second attention mechanism feature extraction layer connected in sequence; The fourth convolution block includes a third convolutional layer, a fourth connection layer, a third multi-scale feature extraction layer and a third attention mechanism feature extraction layer which are connected in sequence.
7. The animal identification method according to claim 1, characterized in that: The performing of animal identification based on the target detection result to obtain an identification result of the animal in the image to be identified includes: Based on the target detection result, determining two ear tag colors of the animal in the image to be identified; the two ear tag colors include an ear tag color of the left ear of the animal and an ear tag color of the right ear of the animal; Based on the two ear tag colors, an identity recognition result of the animal in the image to be recognized is determined.
8. An animal identification device, characterized in that: include: A feature extraction module is used to input the image to be identified into the feature extraction layer in the target detection model to obtain the feature vector output by the feature extraction layer; A target detection module, used for inputting the feature vector into the target detection layer in the target detection model to obtain the target detection result output by the target detection layer; An identification module, used to perform animal identification based on the target detection result, and obtain an identification result of the animal in the image to be identified; The feature extraction layer includes a first feature extraction layer, the first feature extraction layer is used to extract multiple local features of the image to be identified, and the first feature extraction layer is also used to perform feature fusion on the multiple local features; The target detection model is trained based on the sample recognition image and the target detection result label corresponding to the sample recognition image.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the animal identification method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the animal identification method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Cow face identification method based on deep neural network
CN108549860A
Animal identity identifying method and device, computer device and storage medium
CN108921026A
Golden monkey face image recognition method, device and equipment and storage medium
CN111950362A
Livestock face image recognition method and device
CN112215066A
Target detection method, training method of target detection model and electronic equipment
CN114648645A
