Identity consistency cross-time face recognition method and system based on feature learning

By constructing the cross-temporal facial recognition model CE-NET, combining contrastive learning with adversarial training, and optimizing the MR-NET backbone network, the problems of large intra-class differences, small inter-class differences, and data scarcity in the cross-temporal facial recognition of golden snub-nosed monkeys were solved, achieving efficient and reliable golden snub-nosed monkey individual recognition.

CN120708258APending Publication Date: 2025-09-26NORTHWEST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510728660.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing technologies are unable to effectively solve the problems of large intra-class differences, small inter-class differences and data scarcity in the cross-temporal facial recognition of golden snub-nosed monkeys, resulting in a decrease in recognition reliability.

Method used

A feature-learning-based identity consistency cross-temporal face recognition method is adopted. By constructing a cross-temporal face recognition model CE-NET, combining contrastive learning with adversarial training, optimizing the MR-NET backbone network, and using contrastive loss and generative adversarial network to extract robust identity features.

Benefits of technology

It effectively reduces intra-class differences, improves inter-class recognition accuracy, solves the problem of data scarcity, and achieves efficient and reliable cross-temporal facial recognition of golden monkeys.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120708258A_ABST
    Figure CN120708258A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of identifying biological characteristics in images. The invention discloses an identity consistency cross-time face recognition method based on feature learning. The identity consistency cross-time face recognition method comprises the steps of 1, constructing a golden snub monkey cross-time face data set; step 2, constructing a cross-time face recognition model CE-NET, wherein the cross-time face recognition model CE-NET comprises an MR-NET backbone network, a comparative learning module, an adversarial training module and a calculation module; step 3, training a cross-time face recognition model CE-NET; step 4, a cross-time face recognition model CE-NET is tested; and step 5, applying a cross-time face recognition model CE-NET. According to the method, the MR-NET backbone network is optimized by combining comparative learning and adversarial training, so that the problems of large intra-class difference and small inter-class difference in cross-time face recognition of golden snub monkeys are solved; the problem of data scarcity is solved by constructing a sample pair and a positive sample pair.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of recognizing biometric features in images, and in particular relates to a method and system for cross-temporal face recognition based on identity consistency and feature learning. Background Art

[0002] As a first-class nationally protected species, the golden snub-nosed monkey possesses unique ecological and research value. Its similar physiology and behavioral patterns to humans provide a crucial window into life science research. However, the lack of efficient individual recognition technology has hampered progress in the conservation and research of golden snub-nosed monkeys. Advanced facial recognition methods are urgently needed to support ecological conservation and scientific exploration.

[0003] Current research on golden snub-nosed monkey facial recognition primarily utilizes traditional machine learning and deep learning approaches. Traditional methods, such as LBP and PCA, rely on manual feature extraction. While they have achieved some success in livestock identification, they struggle to adapt to the complex recognition requirements of species like golden snub-nosed monkeys, which closely resemble humans. Deep learning-based recognition techniques can be categorized into four categories: basic models, which have been successfully applied to animals like giant pandas; two-stage models, which improve accuracy by performing detection before recognition but are computationally expensive; attention-based models, which focus on key features but cannot address temporal variations; and loss function optimization methods borrowed from human face recognition techniques but lack specialized designs for animal cross-temporal features. However, these approaches still face three core challenges in addressing cross-temporal recognition of golden snub-nosed monkeys: poor image quality due to the wild environment and a scarcity of cross-seasonal data; high similarity between individuals, while facial variations within the same animal with age and season far exceed inter-class differences. These limitations prevent existing methods from effectively decoupling identity and temporal features, significantly reducing the reliability of long-term monitoring.

[0004] In view of this, this study proposes a cross-temporal facial recognition model CE-NET to perform cross-temporal facial recognition of golden snub-nosed monkeys, aiming to decouple identity and temporal features, overcome the limitations of existing technologies on time sensitivity, provide intelligent and efficient recognition solutions for the protection of endangered species such as golden snub-nosed monkeys, and promote the progress of ecological research and conservation practice. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to address the deficiencies in the above-mentioned existing technologies and provide a method for identity consistency cross-temporal facial recognition based on feature learning. The method has a simple structure and a reasonable design. It adopts contrastive learning and adversarial training to jointly optimize the MR-NET backbone network, thereby solving the problem of "large intra-class differences and small inter-class differences" in the cross-temporal facial recognition of golden monkeys; by constructing sample pairs and positive sample pairs, the problem of data scarcity is solved.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] In a first aspect, the present invention includes a method for identity consistent cross-temporal face recognition based on feature learning, characterized by comprising the following steps:

[0008] Step 1: Collect facial images of multiple samples at different time periods, use the collection period as a label, and construct a golden monkey cross-temporal facial dataset. The golden monkey cross-temporal facial dataset includes a training set, a facial verification test set, and a facial retrieval test set.

[0009] Step 2: Construct a cross-temporal face recognition model CE-NET, which includes the MR-NET backbone network, a contrastive learning module, an adversarial training module, and a computation module; train the MR-NET backbone network;

[0010] Step 3: Train the cross-temporal face recognition model CE-NET:

[0011] Step 301: input the facial images of the training set into the MR-NET backbone network to obtain facial features;

[0012] Step 302, contrastive learning: Select facial features based on preset rules to construct positive and negative sample pairs, calculate contrastive loss, calculate gradient based on contrastive loss, and optimize and update the contrastive learning module;

[0013] Step 303, adversarial training: constructing a generative adversarial network, including a discriminator D and a generator G, where the generator G uses the trained MR-NET backbone network; iterative training is performed to obtain a trained generative adversarial network;

[0014] Step 4: Test the cross-temporal face recognition model CE-NET;

[0015] Step 5. Apply the cross-temporal facial recognition model CE-NET: Input two golden snub-nosed monkey facial images from different time periods into the cross-temporal facial recognition model CE-NET. The cross-temporal facial recognition model CE-NET outputs the judgment result and confidence level of whether the two images belong to the same golden snub-nosed monkey individual.

[0016] The above-mentioned identity consistency cross-temporal face recognition method based on feature learning is characterized in that the comparative learning in step 302 is pairwise comparative learning, and the specific process is as follows:

[0017] Step 3021: Select one facial feature from each of the same golden snub-nosed monkeys in any two different collection periods to form a positive sample pair, and any two facial features from different golden snub-nosed monkeys to form a negative sample pair;

[0018] Step 3022: The positive and negative sample pairs are input into the first loss function layer to calculate the pairwise comparison loss value;

[0019] Step 3023: Calculate the gradient of the parameters based on the multi-period contrast loss value, update the contrastive learning module according to the gradient, and repeat steps 401-402 until the preset stopping condition is reached.

[0020] The above-mentioned identity consistency cross-temporal face recognition method based on feature learning is characterized in that the comparative learning in step 302 is multi-period comparative learning, and the specific process is as follows:

[0021] Step 3021: Select one facial feature from each of the multiple collection periods of the same golden snub-nosed monkey to form a positive sample pair, and any two facial features from different golden snub-nosed monkeys to form a negative sample pair;

[0022] Step 3022: The positive and negative sample pairs are input into the second loss function layer to calculate the multi-period contrast loss value;

[0023] Step 3023: Calculate the gradient of the parameters based on the multi-period contrast loss value, update the contrastive learning module according to the gradient, and repeat steps 401-402 until the preset stopping condition is reached.

[0024] The above-mentioned identity consistency cross-temporal face recognition method based on feature learning is characterized in that the specific process of the adversarial training in step 303 is:

[0025] Step 3031: Construct a generative adversarial network, including a discriminator D and a generator G. The generator G uses the MR-NET backbone network trained in step 2.

[0026] Step 3032: Set the initial training parameters of the discriminator D and the generator G;

[0027] Step 3033: Fix the parameters of the generator G and train the discriminator D: input the real sample of the training set into the discriminator D, and the discriminator D outputs the collection period to which the real sample belongs. The loss of the discriminator D is calculated and the parameters of the discriminator D are updated.

[0028] Fixed the discriminator D, trained the generator G, input random Gaussian noise Z into the generator G, generated a pseudo sample face image, the pseudo sample face image was input into the discriminator D, the discriminator D discriminated the pseudo sample face image, obtained the discrimination result, calculated the loss of the generator G, and updated the parameters of the generator G;

[0029] Step 3034: If the loss of the discriminator D converges, the iteration ends and a trained generative adversarial network is obtained; otherwise, the iteration returns to step 3033 until the preset stopping condition is reached and a trained generative adversarial network is obtained.

[0030] The above-mentioned identity consistency cross-temporal face recognition method based on feature learning is characterized in that the discriminator D adopts an era classifier.

[0031] The above-mentioned identity consistency cross-temporal facial recognition method based on feature learning is characterized in that: the period classifier adopts a multi-layer perceptron, the input layer receives the facial features of the sample, the hidden layer constructs the feature map through a nonlinear activation function, and the output layer generates the period probability distribution of the sample through the activation function.

[0032] The above-mentioned identity consistency cross-temporal face recognition method based on feature learning is characterized in that: the MR-NET backbone network in step 2 includes:

[0033] Input layer: used to receive 3-channel RGB image input;

[0034] Convolutional layer: includes 3×3 convolutional layer, first normalization layer, PReLU activation function layer;

[0035] 4 residual block layers: including layer1 residual layer, layer2 residual layer, layer3 residual layer and layer4 residual layer;

[0036] Feature integration layer: including the second normalization layer, Dropout layer, and adaptive average pooling layer;

[0037] Output layer: fully connected layer.

[0038] The above-mentioned identity consistency cross-temporal face recognition method based on feature learning is characterized in that the specific steps of training the MR-NET backbone network are: inputting the samples of the training set into the MR-NET backbone network, calculating the loss of the MR-NET backbone network, the loss function of the MR-NET backbone network includes triple loss and model loss, calculating the gradient according to the loss, and updating the MR-NET backbone network according to the gradient optimization.

[0039] In a second aspect, the identity consistency cross-temporal face recognition system based on feature learning of the present invention is characterized by comprising:

[0040] An image acquisition module, used for respectively acquiring facial images of a plurality of golden snub-nosed monkeys during a plurality of acquisition periods;

[0041] The image processing module uses image segmentation technology to distinguish the golden monkey's facial area from the background area in the real-time image;

[0042] A feature extraction module is used to receive facial images of golden snub-nosed monkeys at different time periods and output facial features of each image;

[0043] The contrastive learning module is connected to the output of the feature extraction module to calculate the contrastive loss; the parameters of the contrastive learning module are optimized and updated based on the contrastive loss;

[0044] The adversarial training module includes a discriminator D and a generator G. The generator G uses the trained MR-NET backbone network to output pure identity facial features;

[0045] The calculation module is used to calculate the similarity of pure identity facial features and output the judgment result and confidence level of whether the two images belong to the same golden monkey individual.

[0046] Compared with the prior art, the present invention has the following advantages:

[0047] 1. The present invention has a simple structure, reasonable design, and is easy to implement and operate.

[0048] 2. The cross-temporal facial recognition model CE-NET of the present invention includes an MR-NET backbone network and a computing module that have been jointly optimized through contrastive learning and adversarial training. The dual optimization mechanism of contrastive learning and adversarial training tightly clusters the facial features of golden snub-nosed monkey individuals with consistent identities, reduces the impact of intra-class differences on facial features, and solves the problem of "large intra-class differences" in cross-temporal facial recognition of golden snub-nosed monkeys.

[0049] 3. The positive and negative sample pairs of the contrastive learning of the present invention maximize the distance between the features of golden snub-nosed monkeys of different identities; the triplet loss of the MR-NET backbone network brings the anchor point and the positive sample closer and pushes the negative sample further away, thereby expanding the feature distance between golden snub-nosed monkeys of different identities, reducing the misjudgment rate caused by inter-class similarity, and solving the problem of "small inter-class difference" in the cross-temporal facial recognition of golden snub-nosed monkeys.

[0050] 4. The present invention improves the structure of ResNet50 to obtain the MR-NET backbone network. The MR-NET backbone network adopts a joint supervision mechanism of triplet loss and cross entropy loss. Triplet loss is used in the time domain to solve the problem of inter-class similarity, and cross entropy loss enhances classification accuracy, thereby improving the performance of the model in conventional recognition tasks.

[0051] 5. The contrastive learning of the present invention designs two time-series-aware loss functions, pairwise contrast loss and multi-period contrast loss, to further refine the time-invariant features. The pairwise contrast loss maximizes the cosine similarity of the identity features of two pairs of positive sample pairs of the same golden monkey across periods, thereby strengthening the consistency of the identity features of the same individual across periods. The multi-period contrast loss maximizes the cosine similarity of the identity features of the positive sample pairs of the same individual during all acquisition periods, thereby extracting common identity features across periods and avoiding local deviations in pairwise contrast.

[0052] 6. The generative adversarial network of the present invention introduces a period classifier as a discriminator and an MR-NET backbone network as a generator. The discriminator and the generator form an adversarial relationship, and adversarial training removes time information, thereby effectively solving the problem of "intra-class differences are greater than inter-class differences" caused by seasonal changes in fur color and age-related morphological evolution of golden snub-nosed monkeys.

[0053] 7. By constructing sample pairs and positive sample pairs, the present invention effectively solves the data scarcity problem in the cross-temporal facial recognition of golden monkeys. Under limited data, the cross-temporal facial recognition model CE-NET can learn identity feature representations with temporal robustness, meet the requirements of contrastive learning on data scale, and have good use effect.

[0054] In summary, the present invention has a simple structure and reasonable design. It adopts contrastive learning and adversarial training to jointly optimize the MR-NET backbone network, solving the problem of "large intra-class differences and small inter-class differences" in golden monkey cross-temporal facial recognition. By constructing sample pairs and positive sample pairs, it solves the problem of data scarcity.

[0055] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 Flow chart of the method of the present invention.

[0057] Figure 2 This is a partial example of the golden monkey cross-temporal facial dataset of the present invention.

[0058] Figure 3 This is a structural diagram of the MR-NET backbone network of the present invention.

[0059] Figure 4 Schematic diagram of triples in the MR-NET backbone network of the present invention.

[0060] Figure 5 This is a system architecture diagram of the present invention.

[0061] Description of the accompanying drawings:

[0062] 1. Image acquisition module; 2. Image processing module; 3. Feature extraction module; 4. Contrastive learning module; 5. Adversarial training module; 6. Computation module, DETAILED DESCRIPTION

[0063] The method of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments of the present invention.

[0064] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0065] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0066] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0067] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used herein to describe the spatial positional relationship of a device or feature to other devices or features as shown in the figures. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figures. For example, if the device in the drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" can include both "above" and "below". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.

[0068] Example 1

[0069] like Figure 1 As shown, the identity consistency cross-temporal face recognition method based on feature learning of the present invention includes the following steps:

[0070] Step 1: Collect facial images of multiple samples at different time periods, use the collection period as a label, and construct a golden monkey cross-temporal facial dataset. The golden monkey cross-temporal facial dataset includes a training set, a test set, and a validation set.

[0071] The facial images include at least m golden snub-nosed monkey samples taken at T periods, where T ≥ 3 and m is a positive integer. In one possible embodiment, facial images of each golden snub-nosed monkey are collected over a period of three years, with facial images from at least six collection periods within the three years, and no fewer than 50 images from each collection period. The number of golden snub-nosed monkeys is 26. Figure 2 As shown, taking 4 individuals as an example, A, B, C, and D are 4 golden monkey individuals with different identities, and each golden monkey has facial images from 1 to 6, a total of 6 periods.

[0072] Step 2: Construct a cross-temporal facial recognition model CE-NET. The cross-temporal facial recognition model CE-NET includes the MR-NET backbone network, a contrastive learning module, an adversarial training module, and a computing module; train the MR-NET backbone network.

[0073] like Figure 3 As shown, the MR-NET backbone network in step 2 includes:

[0074] Input layer: used to receive 3-channel RGB image input;

[0075] Convolutional layer: includes 3×3 convolutional layer, first normalization layer, PReLU activation function layer;

[0076] 4 residual block layers: including layer1 residual layer, layer2 residual layer, layer3 residual layer and layer4 residual layer;

[0077] Feature integration layer: including the second normalization layer, Dropout layer, and adaptive average pooling layer;

[0078] Output layer: fully connected layer.

[0079] It should be noted that the ResNet50 network model is modified as the MR-NET backbone network in this application. The specific modifications are: the activation function of ResNet50 is changed from ReLU to PReLU. The PReLU activation function allows non-zero outputs in negative areas, which can better utilize all neurons and improve the model's ability to express negative features. Structurally, this application adds a Dropout layer to prevent overfitting and enhance the generalization ability of the model, and uses an adaptive average pooling layer to reduce the size of the feature map to 1×1 for easy access to the fully connected layer. In addition, the output dimension of the last fully connected layer is changed from 512 dimensions to 128-dimensional facial features, compressing the feature vector and reducing redundant calculations. The improved MR-NET backbone network can avoid the problem of gradient disappearance during training while maintaining the representational capabilities of the deep network.

[0080] Model loss L of MR-NET backbone network Total =L triplet +LCE , L triplet Represents the triple loss value, L CE Represents the cross entropy loss value. The triplet loss brings the anchor point closer to the positive sample and pushes the negative sample further away, thus expanding the feature distance between golden monkeys of different identities and reducing the misclassification rate caused by inter-class similarity; the cross entropy loss enhances the classification accuracy and improves the performance of the model in conventional recognition tasks. By combining the triplet loss L triplet With cross entropy loss L CE The MR-NET backbone network can not only extract discriminative facial features, but also solve the problem of "small inter-class differences" in the cross-temporal facial recognition of golden snub-nosed monkeys, providing strong support for subsequent cross-temporal research on golden snub-nosed monkeys.

[0081] like Figure 4 As shown in the figure, the first facial image from the golden monkey XJ is used as the anchor sample anchor, the second facial image from the golden monkey XJ and the first facial image of the golden monkey XJ constitute a positive sample pair positive, and the first facial image from the golden monkey LN and the first facial image of the golden monkey XJ constitute a negative sample pair negative. These three pictures constitute a triplet.

[0082] L triplet Represents the triple loss value, where a i represents the anchor sample, (a i , p i ) represents the positive sample pair of the i-th golden monkey, (a i , n j ) represents the negative sample pair of the i-th golden monkey, and the anchor sample, positive sample pair, and negative sample pair constitute a triplet. d(,) represents the Euclidean distance, α represents the interval parameter used to control the distance difference between the positive and negative sample pairs, and m represents the number of golden monkeys. A relative distance constraint relationship in the feature space is established for the triplet to guide the MR-NET backbone network to learn stable features with discrimination. In one possible embodiment, m = 26, α = 0.2. In the MR-NET backbone network, d(a i ,p i ) and d(a i , n j ), filter out d(a i , p i ) minus d(a i , n j ) is greater than 0.2 to calculate the triplet loss value, and then update the MR-NET backbone network gradient, enhance the ability of the MR-NET backbone network to learn difficult samples, and solve the problem of "small inter-class differences" between different golden monkey individuals.

[0083] where y i Indicates the true label of the facial image belonging to the i-th golden monkey, p i represents the probability that the facial image predicted by the model belongs to the i-th golden monkey, logp i Represents the model prediction probability p i Take the natural logarithm. In the MR-NET backbone network, not only does it need to solve the problem of "small inter-class differences", it also needs to have basic identity classification capabilities. That is, given a golden monkey face image, the MR-NET backbone network needs to recognize the identity of the golden monkey. Therefore, the cross entropy loss function is used as the model loss function L CE , improving the classification accuracy of the MR-NET backbone network in the routine face recognition task of golden monkeys.

[0084] Step 3: Train the cross-temporal face recognition model CE-NET:

[0085] Step 301: input the facial images of the training set into the MR-NET backbone network to obtain facial features;

[0086] Step 302, contrastive learning: Select facial features based on preset rules to construct positive and negative sample pairs, calculate contrast loss, calculate gradient based on contrast loss, and optimize and update the contrastive learning module.

[0087] The specific process of comparative learning in step 302 is:

[0088] Step 3021: Select one facial feature from each of the same golden monkeys in any two different collection periods to form a positive sample pair, and any two facial features from different golden monkeys to form a negative sample pair.

[0089] In one possible embodiment, the test set is divided into query sets [F iTj ] and Gallery Collection [F iT'j ], F itj represents the jth facial image of the i-th golden monkey collected in the t-th period. 1<T'<T. In the query set [F iTj ] and Gallery Collection [F iT'j ], and the two facial images constitute a positive sample pair of the same golden monkey; a facial image is selected from the data set of the first golden monkey and a facial image is selected from the data set of other golden monkeys, and the two facial images constitute a negative sample pair of the first golden monkey.

[0090] like Figure 2 As shown, the facial features A0 and A1 of individual A constitute the positive sample, and the facial features A0 of individual A and the facial features B1 of individual B constitute the negative sample.

[0091] Step 3022: The positive and negative sample pairs are input into the first loss function layer to calculate the pairwise comparison loss values. in represents the facial features extracted by the model from the jth picture of the i-th golden monkey in the t-th period, τ represents the hyperparameter, represents the facial features of the i-th golden monkey in the j'th picture at the t'th period extracted by the model, represents the cosine similarity of the positive sample pairs compared with each other, that is, the cosine similarity between two facial images of the same golden monkey at different times, D 正 Represents the cosine similarity weight of the positive sample pairs compared pairwise; represents the facial features extracted by the model from the j′th picture of the i′th golden monkey in the t′th period, Denotes the cosine similarity of the pairwise comparison of negative samples, that is, the cosine similarity between two facial images of different golden monkeys at different times, D 负 Represents the cosine similarity weight of the negative sample pairs compared pairwise.

[0092] The pairwise comparison loss maximizes the cosine similarity of the identity features of the same golden monkey in pairs across time periods, thereby achieving similar identity features of the same individual across time periods. That is, it maximizes the cosine similarity of the positive sample pairs of the same individual, ensuring identity consistency and the characteristics of the same individual in different time periods and at different ages remain close, making the similarity of positive sample pairs much higher than that of negative sample pairs, thereby strengthening identity consistency across time periods.

[0093] It should be noted that cosine similarity is used to measure the similarity between facial features because, compared with other methods of measuring feature similarity such as Euclidean distance, cosine similarity can ignore the scale differences in facial features caused by time factors and pay more attention to the consistency of feature direction.

[0094] In addition, the implementation of contrastive learning usually requires the participation of a large amount of data. In one possible embodiment, the number of golden snub-nosed monkeys m = 26, there are 6 collection periods, and the number of facial images of each golden snub-nosed monkey in each period is k = 50. The golden snub-nosed monkey cross-temporal facial dataset proposed in this application contains a maximum of 7,800 facial images, which is far from the required data scale.

[0095] However, for the pairwise comparison loss designed in this application, positive sample pairs and negative sample pairs are established. This far exceeds the data size required for contrastive learning. Compared to traditional contrastive learning, which requires millions of samples for training, this application effectively addresses the data scarcity issue in golden monkey cross-temporal facial recognition by constructing positive and negative sample pairs. With limited data, the model can learn identity feature representations that are time-robust, meeting the data size requirements of contrastive learning and achieving good results.

[0096] Step 3023: Calculate the gradient of the parameters based on the pairwise contrast loss values, update the contrastive learning module according to the gradient, and repeat steps 401-402 until the preset stopping condition is reached.

[0097] Step 303, adversarial training: construct a generative adversarial network, including a discriminator D and a generator G, where the generator G uses the trained MR-NET backbone network; iterative training is performed to obtain a trained generative adversarial network.

[0098] The specific process of adversarial training in step 303 is:

[0099] Step 3031: Construct a generative adversarial network, including a discriminator D and a generator G. The generator G uses the MR-NET backbone network trained in step 2.

[0100] Discriminator D uses an epoch classifier, which utilizes a multi-layer perceptron. Its input layer receives the facial features of the sample, the hidden layer constructs a feature map using a nonlinear activation function, and the output layer generates the epoch probability distribution of the sample using the activation function. It should be noted that the epoch classifier consists of an input layer, hidden layer 1, hidden layer 2, and an output layer, each of which includes a fully connected layer. As discriminator D, the epoch classifier extracts epoch-related information implicit in facial features to achieve epoch classification. Specifically, the epoch classifier seeks to maximize temporal information and minimize identity information in facial features.

[0101] The generator G hopes that the extracted facial features contain as much identity information as possible and as little time information as possible.

[0102] Therefore, the tasks of the discriminator D and the generator G are contradictory, forming an adversarial architecture.

[0103] Step 3032: Set the initial training parameters of the discriminator D and the generator G;

[0104] Step 3033: Fix the parameters of the generator G and train the discriminator D: input the real samples of the training set into the discriminator D, and the discriminator D outputs the collection period to which the real samples belong. Calculate the loss of the discriminator D. where y it Indicates the true label of the facial image belonging to the tth collection period of the i-th golden monkey, p itDenotes the probability that the facial image predicted by the model belongs to the t-th acquisition period of the i-th golden monkey, and calculates the loss L of the discriminator D T , update the parameters of the discriminator D. When minimizing L T When log p it Increase, p it Close to 1. The MR-NET backbone network, used as the generator G, does not need to generate facial images. Instead, it generates robust facial features during the adversarial process. The goal is to ensure that the extracted features contain as many identity features as possible and as few temporal features as possible, thereby preventing the epoch classifier from using the facial features output by the MR-NET backbone network for epoch classification. The parameters of the discriminator D are updated based on its loss.

[0105] Fixed the discriminator D, trained the generator G, input the random Gaussian noise Z into the generator G, generated a pseudo sample facial image, the pseudo sample facial image was input into the discriminator D, the discriminator D discriminated the pseudo sample facial image, obtained the discrimination result, calculated the loss of the generator G, the loss function of the generator G is: where y it Indicates the true label of the facial image belonging to the tth collection period of the i-th golden monkey, p it Denotes the probability that the facial image predicted by the model belongs to the t-th acquisition period of the i-th golden monkey, and calculates the loss L of the generator G ad , update the parameters of the generator G. When minimizing L ad When log(1-p it ) increases, p it Close to 0, it meets the goal of adversarial training, that is, the facial features extracted by the MR-NET backbone network contain more identity information and less temporal information. This residual temporal information is not sufficient for epoch classification. The parameters of generator G are updated according to its loss.

[0106] It should be noted that since the epoch classifier uses a multi-layer perceptron with a three-layer fully connected layer architecture, its structure is relatively simple compared to the MR-NET backbone network. Therefore, after each training of the MR-NET backbone network, the epoch classifier is trained three times to prevent the situation where the epoch classifier is faced with new features before learning due to large feature changes.

[0107] Step 3034: If the loss of the discriminator D converges, the iteration ends and a trained generative adversarial network is obtained; otherwise, the iteration returns to step 3033 until the preset stopping condition is reached and a trained generative adversarial network is obtained.

[0108] The adversarial training module introduces a period classifier as a discriminator and an MR-NET backbone network as a generator. The discriminator and the generator form an adversarial relationship, forcing the model to suppress time-related features, such as seasonal coat color changes or age-related morphological differences, thereby enhancing the independence of identity features.

[0109] Step 4: Test the cross-temporal facial recognition model CE-NET. Use the test set to test the cross-temporal facial recognition model CE-NET. The cross-temporal facial recognition model CE-NET outputs the recognition result of the test set to obtain the recognition accuracy of the cross-temporal facial recognition model CE-NET.

[0110] Step 5. Apply the cross-temporal facial recognition model CE-NET: Input two golden snub-nosed monkey facial images from different time periods into the cross-temporal facial recognition model CE-NET. The cross-temporal facial recognition model CE-NET outputs the judgment result and confidence level of whether the two images belong to the same golden snub-nosed monkey individual.

[0111] Two golden snub-nosed monkey facial images are input into the cross-temporal facial recognition model CE-NET; each image passes through the MR-NET backbone network, outputting facial features F1 and F2. At this point, the facial features have not yet separated identity and time information; then they pass through the contrast learning module, calculating the pairwise contrast loss, bringing the facial features of the same golden snub-nosed monkey closer together and pushing the facial features of different individuals apart, and outputting the contrast-optimized features Z1 and Z2; features Z1 and Z2 pass through the adversarial training module, separating identity and time information through adversarial loss, and outputting pure identity facial features h1 and h2. Pure identity facial features only retain key information related to the individual identity of the golden snub-nosed monkey, such as facial structure, and do not include time information, such as hair length; pure identity facial features h1 and h2 pass through the calculation module to calculate feature similarity, and use a threshold or classifier to determine whether they are the same individual. Finally, the judgment result and confidence level of whether the two images belong to the same golden snub-nosed monkey are output.

[0112] The cross-temporal facial recognition model CE-NET combines the dual optimization mechanisms of contrastive learning and adversarial training to tightly cluster the facial features of golden snub-nosed monkey individuals with consistent identities, reducing the impact of intra-class differences on facial features, and solving the problem of "large intra-class differences" in cross-temporal facial recognition of golden snub-nosed monkeys.

[0113] Example 2

[0114] Different from the first embodiment, in this embodiment, the specific process of comparative learning in step 302 is as follows:

[0115] Step 3021: Select one facial feature from each of multiple collection periods of the same golden snub-nosed monkey to form a positive sample pair, and any two facial features of different golden snub-nosed monkeys to form a negative sample pair.

[0116] A facial feature is selected from the same golden monkey in each period, and multiple facial features constitute the positive sample pair of the golden monkey. i1j ,...,F itj ,...,F i(T-1)j ] A facial feature is selected from each of the (T-1) epochs to form a positive sample pair for the i-th golden monkey. 1≤i≤m, where m is a positive integer. 1≤t≤T, where T≥3. 1≤j≤K, where K is a positive integer.

[0117] Select a facial feature from the training set of the first golden monkey and a facial feature from the training set of other golden monkeys. The two facial images constitute the negative sample pair of the first golden monkey. itj and F i't'j' , 1≤i′≤m, i′≠i, 1≤t′≤T, 1≤j′≤K, F i't'j' represents the facial features of the j′th facial image collected from the i′th golden monkey in the t′th period.

[0118] like Figure 2 As shown in the figure, facial features A0, A1, A2, A3, A4, and A5 of individual A constitute a positive sample pair, and facial feature A0 of individual A and facial feature B1 of individual B constitute a negative sample pair of individual A. When the number of negative sample pairs is significantly higher than the number of positive sample pairs, the same number of negative sample pairs as the number of positive sample pairs are randomly selected from the negative sample pairs for the next calculation step.

[0119] Step 3022: Input the positive and negative sample pairs into the second loss function layer to calculate the multi-period contrast loss value L C2 Represents the multi-period contrast loss value, where It represents the i-th golden monkey in the j-th period t The facial features of the facial image are extracted by the model, j t represents the facial image selected in the t-th period, represents multiple facial images (j1,…,j t ,…,j T )’s facial features, F 正 Represents the cosine similarity weight of the positive sample pair, represents the facial features extracted by the model from the j′th picture of the i′th golden monkey in the t′th period, i′≠i, 1≤t′≤T, represents the cosine similarity between the facial features of different individuals of golden monkeys at any time, F 负 F represents the cosine similarity weight of negative samples. 正 Characterizing the characteristics of the same golden monkey in multiple periods, F负 Characterize the characteristics of different golden monkeys at any time, L C2 Cosine similarity of identity features of positive pairs of samples from the same individual across all acquisition times.

[0120] Multi-epoch contrastive loss L C2 Maximizing the cosine similarity of identity features of pairs of positive samples from the same individual across all acquisition periods directly extracts common features across time, avoiding local bias in pairwise comparisons. Through the contrastive learning module, robust features that are independent of time, identifiable, and representative of identity information are directly extracted from facial images.

[0121] In addition, the implementation of contrastive learning usually requires the participation of a large amount of data. In one possible embodiment, the number of golden snub-nosed monkeys m = 26, there are 6 collection periods, and the number of facial images of each golden snub-nosed monkey in each period is k = 50. The golden snub-nosed monkey cross-temporal facial dataset proposed in this application contains a maximum of 7,800 facial images, which is far from the required data scale.

[0122] However, for the multi-period contrast loss designed in this application, positive and negative sample pairs are established. This far exceeds the data size required for contrastive learning. Compared to traditional contrastive learning, which requires millions of samples for training, this application effectively addresses the data scarcity issue in golden monkey cross-temporal facial recognition by constructing positive and negative sample pairs. With limited data, the model can learn identity feature representations that are time-robust, meeting the data size requirements of contrastive learning and achieving good results.

[0123] Step 3023: Calculate the gradient of the parameters based on the multi-period contrast loss value, update the contrastive learning module according to the gradient, and repeat steps 401-402 until the preset stopping condition is reached.

[0124] Example 3

[0125] As shown in FIG5 , the identity consistent cross-temporal face recognition system based on feature learning of the present invention includes:

[0126] An image acquisition module 1 is used to respectively acquire facial images of a plurality of golden snub-nosed monkeys during a plurality of acquisition periods;

[0127] Image processing module 2, which distinguishes the golden monkey's facial area from the background area in the real-time image based on image segmentation technology;

[0128] The feature extraction module 3 is used to receive facial images of golden snub-nosed monkeys at different periods and output facial features of each image; the feature extraction module includes the MR-NET backbone network.

[0129] Contrastive learning module 4 is connected to the output of feature extraction module 3 and is used to calculate contrastive loss and optimize and update the parameters of contrastive learning module 4 based on the contrastive loss. The contrastive learning module can be a pairwise contrastive learning module or a multi-period contrastive learning module.

[0130] Specifically, the comparative learning module 4 at least includes:

[0131] The feature projection head is used to map the high-dimensional features output by the feature extraction module 3 into a low-dimensional space suitable for contrastive learning to enhance the discriminability of the features;

[0132] The sample pair construction layer constructs positive and negative sample pairs based on preset rules. There are two preset rules. The first is that a positive sample pair is composed of one facial feature from each of two different collection periods of the same golden snub-nosed monkey, and a negative sample pair is composed of any two facial features from different golden snub-nosed monkeys. The second is that a positive sample pair is composed of one facial feature from each of multiple collection periods of the same golden snub-nosed monkey, and a negative sample pair is composed of any two facial features from different golden snub-nosed monkeys.

[0133] The loss calculation layer is used to calculate the contrastive loss. If the first preset rule is selected, the pairwise contrastive loss is calculated; if the second preset rule is selected, the multi-epoch contrastive loss is calculated.

[0134] The gradient layer is used to calculate the gradient according to the contrastive loss and update the parameters of the contrastive learning module 4 based on the gradient.

[0135] Adversarial training module 5 includes a discriminator D and a generator G. Generator G uses the trained MR-NET backbone network to output pure identity facial features. Specifically, adversarial training module 5 includes the discriminator D, the generator G, and a loss function layer. The loss function layer includes the discriminator loss and the generator loss.

[0136] The calculation module 6 is used to calculate the similarity of pure identity facial features and output the judgment result and confidence level of whether the two images belong to the same golden monkey individual.

[0137] The image acquisition module 1 captures two golden monkey facial images, and the image processing module 2 distinguishes the golden monkey facial area from the background area in the two golden monkey facial images respectively; the two golden monkey facial images are input into the feature extraction module 3, and the feature extraction module 3 outputs facial features F1 and F2. At this time, the facial features have not yet separated identity and time information; then, after passing through the comparative learning module 4, pairwise comparative loss is calculated to bring the facial features of the same golden monkey closer together and push the facial features of different individuals apart, and the comparative optimized features Z1 and Z2 are output; the features Z1 and Z2 pass through the adversarial training module 5, which separates identity and time information through adversarial loss, and outputs pure identity facial features h1 and h2. The pure identity facial features only retain key information related to the individual identity of the golden monkey, such as facial structure, and do not include time information, such as hair length; the pure identity facial features h1 and h2 pass through the calculation module 6 to calculate feature similarity, and determine whether they are the same individual through a threshold or classifier, and finally output the judgment result and confidence level of whether the two images belong to the same golden monkey individual.

[0138] Performance Test 1

[0139] Table 1 The impact of different backbone networks on model recognition performance

[0140]

[0141]

[0142] The performance of different backbone networks on the performance of the cross-temporal face recognition model CE-NET was tested, and Table 1 was obtained. Table 1 shows the performance indicators of the MR-NET backbone network, Ghos tNetV2, Incept ion_ResNetV1, MobileNet, GhostNetV1, ResNet18, ResNet34, and ResNet101.

[0143] From the results in the table, we can see that the MR-NET backbone network obtained in this application based on the improved ResNet50 network has the best performance in terms of accuracy, false acceptance rate control and first-time matching success rate, and is the optimal backbone network choice for the golden monkey cross-temporal face recognition task.

[0144] Specifically, the MR-NET backbone network achieved an accuracy of 71.72%, significantly higher than other backbone networks, demonstrating its top performance in the overall classification task. At a false acceptance rate (FAR) of 0.1, the MR-NET backbone network achieved a correct acceptance rate (TAR) of 49.39%, far exceeding the 35.33% of the second-place ResNet101. At a false acceptance rate (FAR) of 0.05, the MR-NET backbone network achieved a TAR of 38.67%, also leading the other models. Under the same FAR constraint, the MR-NET backbone network achieved a significantly higher TAR than other models, demonstrating a better balance between security and recognition accuracy, making it suitable for scenarios requiring high security. The MR-NET backbone network achieved a Rank-1 recognition rate of 42.31%, significantly outperforming other models, demonstrating a higher success rate in first-pass matching.

[0145] Analysis shows that the ResNet family outperforms other networks because of its unique residual structure, which enables it to learn more complex facial features. ResNet50 outperforms ResNet18, ResNet34, and ResNet101 because fewer layers capture limited complex facial features, while more layers require more facial image data and graphics card computing power. Consequently, when data and computing power are mismatched, the model's learned facial features are limited. Therefore, the MR-NET backbone network, derived from an improved ResNet50 network, overcomes the imbalance between data and computing power when solving the golden monkey facial recognition problem in this paper, achieving the best recognition performance.

[0146] Performance Test 2

[0147] The MR-NET backbone network is used as the benchmark model of the cross-temporal face recognition model CE-NET. The effects of contrastive learning on the model recognition performance and the effects of contrastive learning combined with adversarial training on the model recognition performance are analyzed. The results are divided into four categories: (1) The MR-NET backbone network only adds a contrastive learning module, and the contrastive learning module adopts a pairwise contrastive learning module C1, which is composed of only pairwise contrast loss L C1 Solve the cross-time problem; (2) The MR-NET backbone network only adds the contrastive learning module, and the contrastive learning module adopts the multi-period contrastive learning module C2, which is only composed of the multi-period contrast loss L C2 Solve the cross-temporal problem; (3) The MR-NET backbone network adds the pairwise contrast learning module C1 and the adversarial training module to jointly solve the cross-temporal problem; (4) The MR-NET backbone network adds the multi-period contrast learning module C2 and the adversarial training module to jointly solve the cross-temporal problem.

[0148] (1) The MR-NET backbone network only adds the pairwise contrastive learning module C1

[0149] The MR-NET backbone network only incorporates the pairwise contrastive learning module C1, referred to as the NET1 model. The NET1 model was trained using five training sets arranged in ascending order of epochs, namely test sets 11 to 15. Accuracy, TAR@FAR=0.1, and TAR@FAR=0.05 performance were then tested using the face verification test set arranged in ascending order of epochs. Rank-1 and Rank-5 performance were also tested using the face retrieval test set arranged in ascending order of epochs. The performance data is shown in Table 2.

[0150] In the test set 11, the face verification test set is trained for 0 and 1 epochs and tested for 2 epochs; the face images in the query set Probe in the face retrieval test set belong to 3 epochs, and the images in the gallery set Gallery belong to 2 or 1 epochs.

[0151] In the test set 12, the face verification test set is trained for epochs 0, 1, and 2, and tested for epoch 3; the face images in the query set Probe in the face retrieval test set belong to epoch 4, and the images in the gallery set Gallery belong to epoch 1, 2, or 3.

[0152] In the test set 13, the face verification test set is trained for epochs 0, 1, 2, and 3, and tested for epoch 4; the face images in the query set Probe in the face retrieval test set belong to epoch 5, and the images in the gallery set Gallery belong to epoch 1, 2, 3, or 4.

[0153] In the test set 14, the face verification test set is trained for epochs 0, 1, 2, 3, and 4, and tested for epoch 5; the face images in the query set Probe in the face retrieval test set belong to epoch 6, and the images in the gallery set Gallery belong to epoch 1, 2, 3, 4, or 5.

[0154] In the test set 15, the face verification test set is trained for epochs 0, 1, 2, 3, 4, and 5, and tested for epoch 6; the face images in the query set Probe in the face retrieval test set belong to epoch 7, and the images in the gallery set Gallery belong to epoch 1, 2, 3, 4, 5, or 6.

[0155] Table 2 Effect of pairwise contrastive learning on improving model recognition performance

[0156]

[0157] Compared to the performance data of the MR-NET backbone network in Table 1, the NET1 model, trained on the test set 11, showed increases in Accuracy, Rank-1, and Rank-5, indicating improved recognition and retrieval matching capabilities. However, the TAR@FAR = 0.1 and TAR@FAR = 0.05 values ​​decreased slightly, indicating a decline in the validation capability of the NET1 model.

[0158] Based on test set 12, the values ​​of Accuracy, Rank-1, TAR@FAR=0.1, and TAR@FAR=0.05 all increased, while Rank-5 decreased slightly, and the overall recognition ability of the model improved.

[0159] Based on test set 13, the three indicators TAR@FAR=0.1, TAR@FAR=0.05, and Rank-1 have increased.

[0160] Based on test set 14, the five indicators of Accuracy, Rank-1, TAR@FAR=0.1, TAR@FAR=0.05, and Rank-5 all increased.

[0161] Based on the test set 15, only Rank-5 increases.

[0162] Overall, adding the pairwise contrast loss L in contrastive learning C1 After that, the model's cross-temporal recognition ability has been improved to a certain extent. However, since the face of the golden monkey is greatly affected by the time factor, it is difficult for the model to directly extract identifiable and robust facial features from the facial features. Therefore, in the contrastive learning only pairwise comparison loss L C1 Under the optimization, the model performance is not stable, and the indicators will rise and fall.

[0163] (2) The MR-NET backbone network only adds the multi-period contrastive learning module C2

[0164] The MR-NET backbone network only adds the multi-period contrastive learning module C2, referred to as the NET2 model. After the NET2 model is trained with five training sets, it is tested with test sets 21 to 25 in sequence, and the performance data shown in Table 3 are obtained.

[0165] The golden monkey face dataset includes data from three periods, referred to as dataset 1. The dataset 1 is divided into training set 21 [F i1j , F i2j ] and test set 21[F i3j ], training 1 and 2 period golden monkey cross-temporal facial images, testing 3 period golden monkey cross-temporal facial images.

[0166] The golden monkey face dataset includes data from two periods, referred to as dataset 2. The dataset 2 is divided into training set 22 [F i1j , F i2j , F i3j ] and test set 22[F i4j ], training the golden monkey's cross-temporal facial images of periods 1, 2, and 3, and testing the golden monkey's cross-temporal facial images of period 4.

[0167] The golden monkey face dataset includes data from three periods, referred to as dataset 3. The dataset 3 is divided into training set 23 [F i1j , F i2j , F i3j , F i4j ] and test set 23[F i5j ], training the golden snub-nosed monkey's cross-temporal facial images of periods 1, 2, 3, and 4, and testing the golden snub-nosed monkey's cross-temporal facial images of period 5.

[0168] The golden monkey face dataset includes data from four periods, referred to as dataset 4. The dataset 4 is divided into training set 24 [F i1j , F i2j , F i3j , F i4j , F i5j ] and test set 24[F i6j ], training the golden snub-nosed monkey's cross-temporal facial images of periods 1, 2, 3, 4, and 5, and testing the golden snub-nosed monkey's cross-temporal facial images of period 6.

[0169] The golden monkey face dataset includes data from five periods, referred to as dataset 5. The dataset 5 is divided into training set 25 [F i1j , F i2j , F i3j , F i4j , F i5j , F i6j ] and test set 25[F i7j ], training the golden snub-nosed monkey's cross-temporal facial images of periods 1, 2, 3, 4, 5, and 6, and testing the golden snub-nosed monkey's cross-temporal facial images of period 7.

[0170] Table 3 Effect of multi-period contrastive learning on improving model recognition performance

[0171]

[0172] Compared with the performance data of the MR-NET backbone network in Table 1, the NET2 model is tested based on the test set 21. The NET2 model only has an increase in the Rank-1 and Rank-5 indicators, and the performance of other indicators has slightly decreased.

[0173] When tested on test set 22, the model showed significant growth in all indicators except Rank-1.

[0174] When tested based on test set 23, the performance of all five indicators increased significantly.

[0175] When testing based on test set 24, there was a significant performance increase in the three indicators of Accuracy, TAR@FAR=0.05, and Rank-1, but the performance decreased in the two indicators of TAR@FAR=0.1 and Rank-5.

[0176] When testing based on test set 25, all five indicators decreased.

[0177] Comparing Tables 2 and 3, we can see that the multi-epoch contrastive learning module C2 improves the recognition capabilities of the MR-NET backbone network to a greater degree than the pairwise contrastive learning module C1. This is because, when solving the problem of cross-temporal facial recognition of golden snub-nosed monkeys, the multi-epoch contrastive learning module C2 processes positive samples by maximizing feature similarity across all epochs of images of the same identity, thereby extracting "common identity features" across epochs through contrastive learning. The pairwise contrastive learning module C1 processes positive samples by maximizing feature similarity between pairs of images of the same identity across different epochs. Finding essential identity features across all epochs is more direct and effective than searching for them pairwise. Therefore, when extracting facial features that are as robust as possible to temporal factors, the more direct multi-epoch contrastive learning module C2 performs slightly better than the pairwise contrastive learning module C1.

[0178] However, the NET2 model and the NET1 model have the same problem. The robust features are too difficult to learn, resulting in unstable training and some indicators rising while others falling.

[0179] (3) The MR-NET backbone network adds the pairwise contrast learning module C1 and the adversarial training module

[0180] The MR-NET backbone network is added with a pairwise comparison learning module C1 and an adversarial training module, referred to as the NET3 model. The NET3 model is tested using test sets 11 to 15 in (1) in turn, and the performance data shown in Table 4 are obtained.

[0181] Table 4 Effects of pairwise contrastive learning and adversarial training modules on improving model recognition performance

[0182]

[0183]

[0184] Comparing Table 4, when tested on test set 11, the performance of the NET3 model in Accuracy and Rank-5 decreased slightly, but increased in other indicators.

[0185] When tested on test set 12, the NET3 model showed growth in all five indicators.

[0186] When tested on test set 13, the performance of the NET3 model increased significantly.

[0187] When tested on test set 14, the NET3 model achieved significant performance improvements across all five metrics. This is because the training phase in this set of experiments included a large amount of data from spring and summer, and the test phase also fell within that period. The model learned more about facial feature changes during spring and summer, resulting in exceptionally high performance in this set of experiments. This phenomenon further demonstrates that the time factor is crucial for improving recognition rates in golden snub-nosed monkey cross-temporal facial recognition.

[0188] When trained on the test set 15, the performance of the NET3 model in various indicators has greatly increased.

[0189] It can be seen that on the basis of pairwise contrastive learning, the performance of the NET3 model has been significantly improved after adding the adversarial training module, indicating that adversarial training can not only enhance the effectiveness of contrastive learning, but also further enhance the MR-NET backbone network to extract identifiable and robust facial representations, effectively solving the impact of time factors on the cross-temporal facial recognition of golden monkeys.

[0190] Comparing the performance data of the MR-NET backbone network in Table 4 with that in Table 1, we can see that each metric shows improvements across all experimental settings. In particular, when the NET3 model was trained on the test set 15, Accuracy increased from 71.72% to 82.5%, a 10.78% increase; TAR@FAR=0.1 increased from 49.39% to 72.8%, a 23.41% increase; TAR@FAR=0.05 increased from 38.67% to 59.46%, a 20.97% increase; and Rank-5 increased from 57.69% to 92.31%, a 34.62% increase. These significant increases in metrics demonstrate that the incorporation of contrastive learning and adversarial training into the model for golden monkey facial recognition effectively learns identity information from facial features that is unaffected by temporal factors. This experimental result demonstrates the effectiveness of combining contrastive learning with adversarial training in successfully solving the temporal face recognition problem of golden monkeys.

[0191] (4) The MR-NET backbone network is added with the multi-period contrastive learning module C2 and the adversarial training module. The MR-NET backbone network is added with the multi-period contrastive learning module C2 and the adversarial training module, referred to as the NET4 model. The NET4 model is tested using test sets 21 to 25 in (2) in turn, and the performance data shown in Table 5 are obtained.

[0192] Table 5. The impact of multi-epoch contrastive learning and adversarial training modules on improving model recognition performance

[0193]

[0194] Comparing the performance data in Tables 3 and 5, all metrics of the NET4 model increased when tested on Test Sets 21, 24, and 25. When tested on Test Set 22, TAR@FAR = 0.1 and TAR@FAR = 0.05 decreased. When tested on Test Set 23, TAR@FAR = 0.1, TAR@FAR = 0.05, Rank-1, and Rank-5 decreased slightly, but remained at very high values, not affecting cross-temporal recognition performance. Overall, after adding adversarial training, contrastive learning training gradually stabilized, and the overall recognition performance of the model improved.

[0195] Comparing the performance data of the MR-NET backbone network in Table 1 with that in Table 5, all experimental results in Table 5 are significantly higher than those in Table 1. These experimental results demonstrate that the combination of contrastive learning and adversarial training significantly enhances the model's ability to extract stable, accurate, discriminable, time-independent, and robust facial features. The NET4 model indeed learns the "common identity" features of the same golden snub-nosed monkey individual across different time periods.

[0196] The above description is merely an embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural change made to the above embodiment based on the technical essence of the present invention shall still fall within the scope of protection of the technical solution of the present invention.

Claims

1. Identity-consistent cross-temporal face recognition method based on feature learning, characterized by: The following steps are involved: Step 1: Collect facial images of multiple samples at different time periods, use the collection period as a label, and construct a golden monkey cross-temporal facial dataset. The golden monkey cross-temporal facial dataset includes a training set, a facial verification test set, and a facial retrieval test set. Step 2: Construct a cross-temporal face recognition model CE-NET, which includes the MR-NET backbone network, a contrastive learning module, an adversarial training module, and a computation module; train the MR-NET backbone network; Step 3: Train the cross-temporal face recognition model CE-NET: Step 301: input the facial images of the training set into the MR-NET backbone network to obtain facial features; Step 302, contrastive learning: Select facial features based on preset rules to construct positive and negative sample pairs, calculate contrastive loss, calculate gradient based on contrastive loss, and optimize and update the contrastive learning module; Step 303, adversarial training: constructing a generative adversarial network, including a discriminator D and a generator G, where the generator G uses the trained MR-NET backbone network; iterative training is performed to obtain a trained generative adversarial network; Step 4: Test the cross-temporal face recognition model CE-NET; Step 5. Apply the cross-temporal facial recognition model CE-NET: Input two golden snub-nosed monkey facial images from different time periods into the cross-temporal facial recognition model CE-NET. The cross-temporal facial recognition model CE-NET outputs the judgment result and confidence level of whether the two images belong to the same golden snub-nosed monkey individual.

2. The identity consistent cross-temporal face recognition method based on feature learning according to claim 1, characterized in that: The comparative learning in step 302 is pairwise comparative learning, and the specific process is as follows: Step 3021: Select one facial feature from each of the same golden snub-nosed monkeys in any two different collection periods to form a positive sample pair, and any two facial features from different golden snub-nosed monkeys to form a negative sample pair; Step 3022: The positive and negative sample pairs are input into the first loss function layer to calculate the pairwise comparison loss value; Step 3023: Calculate the gradient of the parameters based on the multi-period contrast loss value, update the contrastive learning module according to the gradient, and repeat steps 401-402 until the preset stopping condition is reached.

3. The identity consistent cross-temporal face recognition method based on feature learning according to claim 1, characterized in that: The comparative learning in step 302 is multi-period comparative learning, and the specific process is as follows: Step 3021: Select one facial feature from each of the multiple collection periods of the same golden snub-nosed monkey to form a positive sample pair, and any two facial features from different golden snub-nosed monkeys to form a negative sample pair; Step 3022: The positive and negative sample pairs are input into the second loss function layer to calculate the multi-period contrast loss value; Step 3023: Calculate the gradient of the parameters based on the multi-period contrast loss value, update the contrastive learning module according to the gradient, and repeat steps 401-402 until the preset stopping condition is reached.

4. The identity consistent cross-temporal face recognition method based on feature learning according to claim 1, characterized in that: The specific process of adversarial training in step 303 is: Step 3031: Construct a generative adversarial network, including a discriminator D and a generator G. The generator G uses the MR-NET backbone network trained in step 2. Step 3032: Set the initial training parameters of the discriminator D and the generator G; Step 3033: Fix the parameters of the generator G and train the discriminator D: input the real sample of the training set into the discriminator D, and the discriminator D outputs the collection period to which the real sample belongs. The loss of the discriminator D is calculated and the parameters of the discriminator D are updated. Fixed the discriminator D, trained the generator G, input random Gaussian noise Z into the generator G, generated a pseudo sample face image, the pseudo sample face image was input into the discriminator D, the discriminator D discriminated the pseudo sample face image, obtained the discrimination result, calculated the loss of the generator G, and updated the parameters of the generator G; Step 3034: If the loss of the discriminator D converges, the iteration ends and a trained generative adversarial network is obtained; otherwise, the iteration returns to step 3033 until the preset stopping condition is reached and a trained generative adversarial network is obtained.

5. The identity consistent cross-temporal face recognition method based on feature learning according to claim 3, characterized in that: The discriminator D adopts an epoch classifier.

6. The identity consistent cross-temporal face recognition method based on feature learning according to claim 5, characterized in that: The period classifier uses a multi-layer perceptron. The input layer receives the facial features of the sample, the hidden layer constructs the feature map through a nonlinear activation function, and the output layer generates the period probability distribution of the sample through the activation function.

7. The identity consistent cross-temporal face recognition method based on feature learning according to claim 1, characterized in that: The MR-NET backbone network in step 2 includes: Input layer: used to receive 3-channel RGB image input; Convolutional layer: includes 3×3 convolutional layer, first normalization layer, PReLU activation function layer; 4 residual block layers: including layer1 residual layer, layer2 residual layer, layer3 residual layer and layer4 residual layer; Feature integration layer: including the second normalization layer, Dropout layer, and adaptive average pooling layer; Output layer: fully connected layer.

8. The identity consistent cross-temporal face recognition method based on feature learning according to claim 1, characterized in that: The specific steps of training the MR-NET backbone network are as follows: input the samples of the training set into the MR-NET backbone network, calculate the loss of the MR-NET backbone network, the loss function of the MR-NET backbone network includes triple loss and model loss, calculate the gradient according to the loss, and update the MR-NET backbone network according to the gradient optimization.

9. Identity-consistent cross-temporal face recognition system based on feature learning, characterized by: include: An image acquisition module (1) is used to respectively acquire facial images of a plurality of golden snub-nosed monkeys during a plurality of acquisition periods; An image processing module (2) distinguishes the face area of ​​the golden monkey from the background area in the real-time image based on image segmentation technology; A feature extraction module (3) is used to receive facial images of golden monkeys at different periods and output facial features of each image; A contrastive learning module (4) is connected to the output of the feature extraction module (3) and is used to calculate the contrastive loss; and the parameters of the contrastive learning module (4) are optimized and updated based on the contrastive loss; The adversarial training module (5) includes a discriminator D and a generator G. The generator G uses the trained MR-NET backbone network to output pure identity facial features; The calculation module (6) is used to calculate the similarity of pure identity facial features and output the judgment result and confidence level of whether the two images belong to the same golden monkey individual.