Metric learning-based simian class identification method and system, and medium

By constructing the SE-ResNet model and combining metric learning and attention mechanisms, the problems of inter-class differences and intra-class differences in ape recognition are solved, and efficient individual and population recognition is achieved.

CN119785378AActive Publication Date: 2025-04-08GUANGDONG OCEAN UNIVERSITY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411777093.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-08
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

The complex environment of ape habitats makes it difficult for traditional methods to effectively identify ape individuals and population categories, and there are problems of inter-class differences and intra-class differences.

Method used

A deep neural network model based on metric learning is adopted, specifically to build a SE-ResNet model, through data augmentation and iterative training, combining cross-entropy loss and triple loss, an attention mechanism is introduced to improve identification efficiency.

Benefits of technology

It improves the efficiency of identifying ape individuals and population categories, enhances its resistance to inter-class differences and intra-class differences, and achieves higher recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119785378A_ABST
    Figure CN119785378A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, in particular to a metrics learning-based simian class recognition method and system and a medium, and the method comprises the steps: obtaining an original image of a simian class, and carrying out the data enhancement of the original image, and obtaining a training sample; constructing an SE-ResNet model, and inputting the training sample into the SE-ResNet model for training to obtain an simian class recognition model; wherein the SE-ResNet model comprises a plurality of residual error modules, each residual error module comprises a plurality of residual error blocks embedded with SE modules, and the SE modules are used for adaptively adjusting the weight of each feature channel; carrying out feature extraction and classification on the simian image by adopting a simian identification model, and identifying simian individuals and population categories at the same time; according to the invention, simian individuals and populations can be efficiently identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, system and medium for ape identification based on metric learning. Background Art

[0002] The habitats of apes are generally densely vegetationed, individual behavior is unpredictable, there is insufficient light, and the environment is humid, all of which severely limit manual individual identification.

[0003] Considering that apes are social animals with unique population activity ranges, there is a certain degree of coupling between individuals and populations, and there are similarities in characteristics between populations. At the same time, the fixed living area of ​​the ape group makes the background data similar, resulting in slight inter-class differences. In addition, due to different perspectives, movement postures and lighting conditions, there are obviously different appearances, resulting in huge intra-class differences. However, the connection between individual apes makes the population have certain deep common characteristics, resulting in the need to improve the efficiency of individual and population category recognition of apes. Summary of the invention

[0004] The present invention aims to provide a method, system and medium for ape identification based on metric learning, so as to improve the efficiency of identifying individual and population categories of apes.

[0005] In order to achieve the above object, the present invention provides the following technical solutions: In a first aspect, an embodiment of the present invention provides a method for ape identification based on metric learning, the method comprising the following steps: Acquire original images of apes, perform data enhancement on the original images, and obtain training samples; Constructing an SE-ResNet model, inputting the training samples into the SE-ResNet model for training, and obtaining an ape recognition model; wherein the SE-ResNet model comprises a plurality of residual modules, the residual module comprises a plurality of residual blocks embedded with SE modules, and the SE module is used to adaptively adjust the weights of each feature channel; The ape recognition model is used to extract features and classify ape images, and simultaneously identify individual apes and population categories.

[0006] Preferably, the step of constructing a SE-ResNet model and inputting the training samples into the SE-ResNet model for training to obtain an ape recognition model comprises: Using the CNN model parameters pre-trained by the ImageNet database, and using the CNN model parameters as the hyperparameters of the ape recognition model; In the process of iterative training of the SE-ResNet model, the SE-ResNet model is trained using the Adam optimization algorithm. During the training process, the learning rate scheduling strategy and label smoothing are used to perform joint optimization to a set number of epoch iterations to complete one iterative training of the SE-ResNet model; Determine the total loss function of the SE-ResNet model, and determine the loss value of the SE-ResNet model after completing the current iterative training based on the total loss function. When the loss value is lower than the set loss threshold, complete the training of the SE-ResNet model to obtain a trained ape recognition model.

[0007] Preferably, the method further comprises: In the process of iterative training of the SE-ResNet model, an attention mechanism module is added after the multiple residual modules in the SE-ResNet model, and the multiple residual modules are retrained; wherein the attention mechanism module includes two convolutional layers and a Sigmoid activation function, and the attention mechanism module is used to generate an attention map and adjust the input feature map, and then use an adaptive average pooling layer to convert the feature map into a global feature vector; The global features are normalized through the batch normalization layer, and the individual category prediction scores and scores of different categories are output separately through the classification head.

[0008] Preferably, the residual module processes the feature image as follows: ; Where x represents the input image, Represents the features of the input image x after passing through the residual module, and StemBlock represents the primary features converted from the input image x. represents the higher-level features extracted from the input image x after passing through the tth residual block in the residual module; The expression for processing the feature image by the residual block is: ; Wherein, x is the input image, that is, the feature image of the input residual block, t is the index of the residual block, is the feature image generated by the tth residual block, , , are the weights of the convolution kernels, and σ is the ReLU activation function.

[0009] Preferably, the processing process of the SE module includes a compression stage and an excitation stage, and the processing formula of the compression stage is: ; in, represents the numerical distribution of C feature maps, that is, global information, H and W are the height and width of the feature map, x represents the input image, is the eigenvalue of the i-th row, j-th column, and channel c in the feature image after the residual block, where i and j are the height index and width index of the feature map, respectively, and c is the channel index; The processing formula of the excitation stage is: ; in, and is the weight of the fully connected layer, σ1 and σ2 are the ReLU activation function and Sigmoid activation function layers respectively, s is the output feature after excitation, and z is the input feature after compression.

[0010] Preferably, the expression of the total loss function is: ; in, is the total loss function of the SE-ResNet model, is the cross entropy loss function, is the triple loss function, A vector representing individual characteristics, A vector representing population characteristics, λ1 and λ2 are weighted coefficients of the loss function, which are used to control the weights of different losses in the total loss; The expression of the cross entropy loss function is: ; in, represents the weight of the linear function, is the embedding vector of image x of category i; The expression of the triple loss function is: ; Among them, fa is the feature vector of the anchor sample, fp is the feature vector of the positive sample, which belongs to the same category as the anchor sample, and fn is the feature vector of the negative sample, which does not belong to the same category as the anchor sample.

[0011] Preferably, the method further comprises: During the training of the SE-ResNet model, the number of iterations for training the SE-ResNet model is determined, and the weight of the cross entropy loss and the weight of the triplet loss are determined based on the number of iterations, the sum of the weight of the cross entropy loss and the weight of the triplet loss is 1, the weight of the cross entropy loss decreases as the number of iterations increases, and the weight of the triplet loss increases as the number of iterations increases.

[0012] In a second aspect, an embodiment of the present invention provides an ape identification system based on metric learning, the system comprising: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements any one of the methods described above.

[0013] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a program executable by a processor, wherein the program executable by the processor is used to execute any of the methods described above when executed by the processor.

[0014] The beneficial effects of the present invention are as follows: the present invention provides a method, system and medium for ape identification based on metric learning, by obtaining the original image of the ape, performing data enhancement on the original image, and obtaining a training sample; by constructing an SE-ResNet model, the training sample is input into the SE-ResNet model for training, and an ape identification model is obtained; wherein the SE-ResNet model includes a plurality of residual modules, the residual module includes a plurality of residual blocks embedded with SE modules, and the SE module is used to adaptively adjust the weights of each feature channel; the SE-ResNet model is a deep neural network model based on metric learning, which can not only be used for individual identification of apes, but also can learn the coupling relationship between populations and individuals, thereby improving the performance of resisting the negative effects of inter-class differences and intra-class differences; finally, the ape identification model is used to extract features and classify the ape image, and the individual and population categories of the ape are identified at the same time. The embodiment provided by the present invention can efficiently identify individuals and populations of apes. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0016] Figure 1 is a flow chart of a method for ape identification based on metric learning in an embodiment of the present invention; Figure 2 is a structural diagram of an ape identification model in an embodiment of the present invention; Figure 3 yes Figure 2 A diagram of the spatial attention structure of the mesopranoid recognition model; Figure 4 yes Figure 2 Schematic diagram of the triplet loss of the ape recognition model; Figure 5 It is a schematic diagram of the individual confusion matrix of the CNN model; Figure 6 It is a schematic diagram of the population confusion matrix of the CNN model; Figure 7 It is a schematic diagram of the structure of the ape identification system based on metric learning in an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of the present invention, so as to fully understand the purpose, scheme and effect of the present invention. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.

[0018] In recent years, the use of camera trap survey technology for non-invasive sampling of terrestrial wildlife species such as apes has been widely used. However, traditional infrared cameras are easily disturbed by the environment, resulting in false triggering and taking a large number of useless photos. Unmanned aerial vehicles are used to take thermal infrared images to detect apes, but a single infrared image cannot simultaneously observe the appearance of the rainforest. The fusion method of infrared and visible light images can achieve good performance. However, it is very difficult to find the traces of apes living in the high-altitude canopy in large areas of tropical rainforests under foggy conditions, not to mention taking high-quality images.

[0019] Deep learning has made significant progress in solving problems that have been elusive for many years in the artificial intelligence community by using representation learning methods with multiple levels of representation, obtained by combining simple but nonlinear modules, each of which transforms one level of representation (starting from the raw input) into a higher, slightly more abstract level of representation. Deep learning greatly reduces the human effort by automatically identifying and detecting species on images, and provides methods with the ability to analyze complex, interactive, nonlinear data.

[0020] The mainstream methods of species identification mainly focus on the independent identification of a single individual and weaken the common characteristics at the population level. The local structure between similar samples of the population will be inadvertently destroyed, and lack the ability to resist intra-class differences. Due to biological inheritance, the appearance and behavioral characteristics between parents and offspring will be transmitted to a certain extent.

[0021] In order to solve the main challenge of huge intra-class differences and weak inter-class differences, the present invention proposes a new deep metric learning method that considers both inter-class loss and intra-class loss. The intra-class triplet loss makes the sample distance of the same individual very close, while the sample distance of different individuals is widened. The inter-class loss learns the coupling characteristics within the population and forms intra-class clusters, which can significantly reduce the negative impact of inter-class differences and intra-class differences on ape recognition and improve the recognition accuracy. By capturing inter-class differences and intra-class invariance, the inter-class similarity distance is maximized, while the intra-class similarity distance is minimized. In addition, the present invention also combines the triplet loss with the cross entropy loss to jointly learn the facial information of apes, and introduces the attention mechanism to enable the model to selectively focus on important features of apes. Through this method, it is possible to reduce labor costs, resist the negative impact of inter-class differences and intra-class differences, and improve the recognition ability of apes.

[0022] See also Figure 1 The present invention provides a method for ape identification based on metric learning, the method comprising the following steps: S100, obtaining an original image of apes, and performing data enhancement on the original image to obtain a training sample; It should be noted that directly inputting the original image into the model may lead to overfitting. In order to avoid this situation, the present invention uses a series of data enhancement methods. It can change the original data to simulate different lighting conditions, shooting angles and occlusion conditions. Such random changes in training samples can reduce the dependence on certain specific attributes, learn more features, and thus obtain better performance. In this embodiment, the present invention uses a composite data enhancement method, which includes horizontal flipping, random rotation, random erasing, and color jittering. Before training the SE-ResNet model, the present invention processes the data set, considers the average dimension of the image, and adjusts all images to a uniform resolution of 256*256.

[0023] During the original image acquisition process, the present invention not only focuses on the image quality of individuals, but also analyzes the coupling relationship of populations. Since apes are highly social and gregarious animals, each individual belongs to a fixed population family and has a fixed range of activities. Therefore, this analysis can help the present invention understand the potential related appearance features between individuals in the population and the specific analysis of the environment. The present invention uses the T-SNE algorithm to reduce the dimension of the characteristics of the population in order to visualize the relationship between different individuals and populations. The results show that although some individuals are far apart, there is generally a relatively obvious clustering phenomenon between different populations, indicating that there is a certain correlation between individuals in terms of appearance features.

[0024] S200, constructing an SE-ResNet model, inputting the training sample into the SE-ResNet model for training, and obtaining an ape recognition model; wherein the SE-ResNet model comprises a plurality of residual modules, the residual module comprises a plurality of residual blocks embedded with SE modules, and the SE module is used to adaptively adjust the weights of each feature channel; S300 uses ape recognition models to extract features and classify ape images, and simultaneously identifies individual and population categories of apes.

[0025] refer to Figure 2 , Figure 3 and Figure 4 In the present invention, a model for simultaneous identification of ape individuals and populations based on metric learning is proposed to distinguish different individuals and the groups they belong to. In order to capture the subtle differences between individuals and explore the commonalities between groups, the present invention adopts the SE-ResNet model (Squeeze-and-Excitation Residual Network) as the backbone network for individual identification and population classification of apes. The SE module (Squeeze-and-Excitation) in the SE-ResNet model enhances the feature recalibration capability of the network, so that the importance of feature channels can be adaptively adjusted. Specifically, the SE-ResNet model includes multiple residual modules, each of which includes multiple residual blocks and SE modules. The SE module is embedded in the residual block, and each SE module captures different feature patterns through 1×1, 3×3 and 1×1 convolution kernel configurations. The SE module embedded in each residual block calculates the weight of the feature channel through global average pooling and a fully connected layer, thereby improving the expression ability of important features and suppressing irrelevant information.

[0026] The present invention uses the SE-ResNet model to train an ape recognition model, and uses the ape recognition model to extract features and classify ape images. The SE-ResNet model proposed in the present invention is a deep neural network model based on metric learning, which utilizes individual and population clustering loss functions and a permutation attention module. The deep metric learning method can not only be used for individual recognition of apes, but also can learn the coupling relationship between populations and individuals, thereby improving the performance of resisting the negative impact of inter-class differences and intra-class differences. The embodiment provided by the present invention can efficiently identify individuals and populations of apes.

[0027] As an improvement of the above embodiment, in S200, the SE-ResNet model is constructed, and the training samples are input into the SE-ResNet model for training to obtain the ape recognition model, including: S210, using the CNN model parameters pre-trained by the ImageNet database, and taking the CNN model parameters as the hyperparameters of the ape recognition model; In order to improve the performance of the SE-ResNet model, the present invention uses a transfer learning strategy. The weights of the CNN pre-trained on the ImageNet database (http: / / www.image-net.org / ) with similar characteristics to the dataset of the present invention are used to initialize each layer of the network. Specifically, the use of the CNN model parameters pre-trained on the ImageNet database and applied to the SE-ResNet model helps to improve the initial performance of the SE-ResNet model and enhance the generalization ability of the ape recognition model.

[0028] S220, in the process of iteratively training the SE-ResNet model, using the Adam optimization algorithm to train the SE-ResNet model, and in the training process, using the learning rate scheduling strategy and label smoothing to jointly optimize to a set number of epoch iterations, completing one iterative training of the SE-ResNet model; In order to speed up the convergence of the SE-ResNet model and solve the gradient instability problem of the deep SE-ResNet model, the present invention adopts the Adam optimization algorithm. At the same time, during the training process, the WarmupMultiStepLR learning rate scheduling strategy is used. The initial learning rate is set to 0.001, and the learning rate is warmed up at the beginning of training. The learning rate is warmed up for the first 10 iterations, and the warming factor is 0.01. Afterwards, at the specified epoch (60th and 150th), the learning rate is reduced to 0.6 times the original. In order to further improve the stability of the model, the present invention also introduces label smoothing (LabelSmoothing) for joint optimization. Finally, the training stopped after 200 epoch iterations.

[0029] S230, determining the total loss function of the SE-ResNet model, and determining the loss value of the SE-ResNet model after completing the current iterative training based on the total loss function. When the loss value is lower than the set loss threshold, the training of the SE-ResNet model is completed to obtain a trained ape recognition model.

[0030] As an improvement of the above embodiment, in S220, the method further includes: S221, in the process of iteratively training the SE-ResNet model, adding an attention mechanism module after the multiple residual modules in the SE-ResNet model, and retraining the multiple residual modules; wherein the attention mechanism module includes two convolutional layers and a Sigmoid activation function, and the attention mechanism module is used to generate an attention map and adjust the input feature map, and then use an adaptive average pooling layer to convert the feature map into a global feature vector; S222, normalize the global features through the batch normalization layer, and output the individual category prediction scores and the scores of different categories through the classification head.

[0031] In order to achieve a balance between generalization and specificity in the task of identifying ape images, the early layers of the pre-trained model are frozen during the training process of transfer learning, and only the latter layers are fine-tuned. Specifically, in order to improve the interpretability and recognition performance of the SE-ResNet model, and to deeply identify the specific areas that the SE-ResNet model pays attention to in the population classification problem, the present invention adds a customized attention mechanism module to the SE-ResNet model. The attention mechanism module includes two convolutional layers and a Sigmoid activation function, which are used to generate attention maps and adjust input features. The attention of the SE-ResNet model can be more focused on the local feature areas in the image that are crucial for classification and recognition, so as to more effectively identify the facial features and limb details of apes, and further improve the recognition accuracy of individuals and populations. Then, the feature map is converted into a global feature vector using an adaptive average pooling layer. Then, the global features are standardized by a batch normalization layer. In addition, the final classification head of the SE-ResNet model includes two fully connected layers, one for generating individual category prediction scores and the other for category prediction, and the output is the scores of different categories.

[0032] As an improvement of the above embodiment, the expression for processing the feature image by the residual module is: ; Where x represents the input image, Represents the features of the input image x after passing through the residual module, and StemBlock represents the primary features converted from the input image x. represents the higher-level features extracted from the input image x after passing through the tth residual block in the residual module; The expression for processing the feature image by the residual block is: ; Wherein, x is the input image, that is, the feature image of the input residual block, t is the index of the residual block, is the feature image generated by the tth residual block, , , are the weights of the convolution kernels, and σ is the ReLU activation function.

[0033] In this embodiment, the image is first processed preliminarily through the convolution layer and the pooling layer, and then enters the residual module for deep feature extraction. Then, multi-scale feature fusion is performed, and the feature maps from different residual modules are adjusted to the same scale and superimposed to capture richer contextual information. Specifically, StemBlock is used to convert the input image x into primary features, and Stage is used to continuously extract higher-level features. This multi-scale processing improves the ability to understand image details and global structures. Finally, the feature map is converted into a vector representation through global average pooling, and the features are further aggregated through the fully connected layer, and finally classified through the Softmax layer. In this way, SE-ResNet can effectively capture the subtle differences between individual apes and achieve high-precision individual recognition and population classification.

[0034] As an improvement of the above embodiment, the processing process of the SE module includes a compression stage and an excitation stage. The processing formula of the compression stage is: ; in, represents the numerical distribution of C feature maps, that is, global information, H and W are the height and width of the feature map, x represents the input image, is the eigenvalue of the i-th row, j-th column, and channel c in the feature image after the residual block, where i and j are the height index and width index of the feature map, respectively, and c is the channel index; The processing formula of the excitation stage is: ; in, and is the weight of the fully connected layer, σ1 and σ2 are the ReLU activation function and Sigmoid activation function layers respectively, s is the output feature after excitation, and z is the input feature after compression.

[0035] As an improvement of the above embodiment, the expression of the total loss function is: ; in, is the total loss function of the SE-ResNet model, A vector representing individual characteristics, A vector representing population characteristics, λ1 and λ2 are weighted coefficients of the loss function, which are used to control the weights of different losses in the total loss; The expression of the cross entropy loss function is: ; in, represents the weight of the linear function, is the embedding vector of image x of category i; The expression of the triple loss function is: L triplet =max(0,||fa-fp|| 2 -||fa-fn|| 2 +margin); Among them, L triplet represents the triplet loss, fa is the feature vector of the anchor sample, fp is the feature vector of the positive sample, which belongs to the same category as the anchor sample, and fn is the feature vector of the negative sample, which does not belong to the same category as the anchor sample.

[0036] Specifically, after completing one iterative training of the SE-ResNet model, the cross entropy loss function and the triplet loss function of the SE-ResNet model are calculated respectively, and the total loss function of the SE-ResNet model is determined based on the cross entropy loss and the triplet loss; when constructing the loss function module, the present invention first uses the cross entropy loss, and there is an implicit relationship between the learning embeddings established by the cross entropy loss.

[0037] Cross entropy loss can effectively optimize the classification performance during the learning process, but in order to further explore the subtle differences between ape populations and the coupling relationship between individual characteristics within populations, the present invention introduces a triplet loss mechanism. This method can not only establish a clearer distinction between class differences, but also capture the fine-grained similarities embedded within populations, thereby improving the ability to recognize complex individual characteristics.

[0038] In the triplet loss function, the square of the Euclidean distance between the anchor sample and the positive sample is ||fa-fp|| 2 , and the square of the Euclidean distance between the anchor sample and the negative sample is ||fa-fn|| 2 In addition, margin is a preset boundary value used to control the distance between positive and negative sample pairs, so that the model can better distinguish samples of different categories.

[0039] During the model training process, the present invention introduces triplet loss to prompt the model to minimize the distance between the anchor sample and the positive sample, and maximize the distance between the anchor sample and the negative sample. This mechanism performs very well in the task of extracting individual and population characteristics, and helps to achieve more accurate individual feature identification and differentiated discrimination between populations. At the same time, during the training process, the present invention adopts a step-by-step adjustment strategy to balance the weights of cross entropy loss and triplet loss to ensure that the model can achieve optimal performance in both individual and population identification tasks. In the initial training stage, the present invention increases the weight of cross entropy loss to quickly optimize classification performance; in the later training stage, the present invention gradually increases the weight of triplet loss to enhance the model's ability to handle inter-class differences and intra-class consistency.

[0040] As an improvement of the above embodiment, the method further includes: During the training of the SE-ResNet model, the number of iterations for training the SE-ResNet model is determined, and the weight of the cross entropy loss and the weight of the triplet loss are determined based on the number of iterations, the sum of the weight of the cross entropy loss and the weight of the triplet loss is 1, the weight of the cross entropy loss decreases as the number of iterations increases, and the weight of the triplet loss increases as the number of iterations increases.

[0041] In the early stage of training the SE-ResNet model, the weight of the cross entropy loss is increased; in the later stage of training the SE-ResNet model, the weight of the triplet loss is gradually increased, When building a model or using an existing model, the performance of the model is usually evaluated by calculating the accuracy. However, relying solely on the accuracy to judge the quality of the model is not comprehensive enough. The confusion matrix provides a way to interpret the prediction results of the model from more angles. It is a technique for evaluating various performance characteristics of the model that can be calculated from the model. The confusion matrix converts the probabilities produced by the model and expresses them as a combination of predicted values ​​and actual values, and presents them in the format of a square table. Figure 5 and Figure 6 The confusion matrix of the CNN model proposed in the present invention is shown, which includes the results of individual and population classification.

[0042] and Figure 1 Corresponding to the method, refer to Figure 7 , an embodiment of the present invention provides a system for identifying apes based on metric learning, comprising: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0043] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0044] In addition, an embodiment of the present invention further discloses a computer program product or a computer program, which is stored in a computer-readable storage medium. A processor of a computer device can read the computer program from a computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above method. Similarly, the contents of the above method embodiment are all applicable to the storage medium embodiment, and the functions specifically implemented by the storage medium embodiment are the same as those of the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above method embodiment.

[0045] It will be appreciated by those skilled in the art that all or some of the methods disclosed above and the system may be implemented as software, firmware, hardware and appropriate combinations thereof. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0046] The above is a specific description of the preferred implementation of the present disclosure, but the present disclosure is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present disclosure. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present disclosure.

Claims

1. A method for ape identification based on metric learning, characterized in that: The method comprises the following steps: Acquire original images of apes, perform data enhancement on the original images, and obtain training samples; Constructing an SE-ResNet model, inputting the training samples into the SE-ResNet model for training, and obtaining an ape recognition model; wherein the SE-ResNet model comprises a plurality of residual modules, the residual module comprises a plurality of residual blocks embedded with SE modules, and the SE module is used to adaptively adjust the weights of each feature channel; The ape recognition model is used to extract features and classify ape images, and simultaneously identify individual apes and population categories.

2. The method according to claim 1, characterized in that The step of constructing the SE-ResNet model and inputting the training samples into the SE-ResNet model for training to obtain the ape recognition model comprises: Using the CNN model parameters pre-trained by the ImageNet database, and using the CNN model parameters as the hyperparameters of the ape recognition model; In the process of iterative training of the SE-ResNet model, the SE-ResNet model is trained using the Adam optimization algorithm. During the training process, the learning rate scheduling strategy and label smoothing are used to perform joint optimization to a set number of epoch iterations to complete one iterative training of the SE-ResNet model; Determine the total loss function of the SE-ResNet model, and determine the loss value of the SE-ResNet model after completing the current iterative training based on the total loss function. When the loss value is lower than the set loss threshold, complete the training of the SE-ResNet model to obtain a trained ape recognition model.

3. The method according to claim 2, characterized in that The method further comprises: In the process of iterative training of the SE-ResNet model, an attention mechanism module is added after the multiple residual modules in the SE-ResNet model, and the multiple residual modules are retrained; wherein the attention mechanism module includes two convolutional layers and a Sigmoid activation function, and the attention mechanism module is used to generate an attention map and adjust the input feature map, and then use an adaptive average pooling layer to convert the feature map into a global feature vector; The global features are normalized through the batch normalization layer, and the individual category prediction scores and scores of different categories are output separately through the classification head.

4. The method according to claim 1, characterized in that: The expression for processing the feature image by the residual module is: ; Where x represents the input image, Represents the features of the input image x after passing through the residual module, and StemBlock represents the primary features converted from the input image x. represents the higher-level features extracted from the input image x after passing through the tth residual block in the residual module; The expression for processing the feature image by the residual block is: ; Where x represents the input image, t is the index of the residual block, is the feature image generated by the tth residual block, , , are the weights of the convolution kernels, and σ is the ReLU activation function.

5. The method according to claim 4, characterized in that The processing process of the SE module includes a compression stage and an excitation stage. The processing formula of the compression stage is: ; in, represents the numerical distribution of C feature maps, that is, global information, H and W are the height and width of the feature map, x represents the input image, is the eigenvalue of the i-th row, j-th column, and channel c in the feature image after the residual block, where i and j are the height index and width index of the feature map, respectively, and c is the channel index; The processing formula of the excitation stage is: ; in, and is the weight of the fully connected layer, σ1 and σ2 are the ReLU activation function and Sigmoid activation function layers respectively, s is the output feature after excitation, and z is the input feature after compression.

6. The method according to claim 2, characterized in that The expression of the total loss function is: ; in, is the total loss function of the SE-ResNet model, is the cross entropy loss function, is the triplet loss function, A vector representing individual characteristics, A vector representing population characteristics, λ1 and λ2 are weighted coefficients of the loss function, which are used to control the weights of different losses in the total loss; The expression of the cross entropy loss function is: ; in, represents the weight of the linear function, is the embedding vector of image x of category i; The expression of the triple loss function is: ; Among them, fa is the feature vector of the anchor sample, fp is the feature vector of the positive sample, which belongs to the same category as the anchor sample, and fn is the feature vector of the negative sample, which does not belong to the same category as the anchor sample.

7. The method according to claim 6, characterized in that The method further comprises: During the training of the SE-ResNet model, the number of iterations for training the SE-ResNet model is determined, and the weight of the cross entropy loss and the weight of the triplet loss are determined based on the number of iterations, the sum of the weight of the cross entropy loss and the weight of the triplet loss is 1, the weight of the cross entropy loss decreases as the number of iterations increases, and the weight of the triplet loss increases as the number of iterations increases.

8. A metric learning-based ape identification system, characterized in that: The system comprises: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the ape identification method based on metric learning as described in any one of claims 1 to 7.

9. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to perform the method according to any one of claims 1 to 7 when executed by the processor.

Citation Information

Patent Citations

  • Small-strand pedestrian re-identification method based on uncertainty second-order self-attention structure model

    CN115761795A

  • Hainan hylobatidaes individual identification method based on multi-view feature fusion

    CN118053178A

  • Target re-identification

    WO2019016540A1