Training method and device of palmprint recognition model, computer equipment, storage medium and computer program product
By introducing a multi-dimensional joint optimization training method that combines feature distribution loss, feature classification loss, and feature contrast loss into the palmprint recognition model, the recognition accuracy and generalization ability in large-scale data scenarios are improved, and the problem of reduced recognition accuracy caused by the increase in the number of users is solved.
Patent Information
- Application Number
- CN202611417577.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-11
- Publication Date
- 2026-11-27
AI Technical Summary
As the number of users in access control and attendance systems increases, the accuracy of palmprint recognition models decreases, and existing technologies struggle to effectively distinguish similar features and avoid misjudgments.
By acquiring multiple palm image samples, teacher features are extracted using a pre-trained teacher model. Based on the teacher and student features, feature distribution loss, feature classification loss, and feature contrast loss are calculated. The weighted sum of the three losses guides the training of the student model and coordinates the learning process of the student model.
It improves the recognition accuracy and generalization ability of palmprint recognition models in large-scale data scenarios, effectively solving the problem of reduced model recognition accuracy when the amount of data increases.
Smart Images

Figure CN123182275A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision technology, and in particular to a training method, apparatus, computer device, storage medium and computer program product for a palmprint recognition model. Background Technology
[0002] In access control and attendance systems, palmprint recognition-based identity verification is a crucial means of ensuring security at entrances and exits and the accuracy of attendance tracking. As the scale of use expands, the number of registered users in the access control and attendance system gradually increases, and the size of the database to be compared also grows accordingly, which places higher demands on the discrimination capabilities of palmprint recognition models.
[0003] Currently, access control and attendance systems typically use palmprint recognition models based on deep learning for identity verification. As the number of registered users increases, the feature recognition model needs to accurately distinguish the feature differences between users within an ever-expanding database. However, in practical applications, when the number of user IDs and the number of registered users in the database increase, the feature distributions of different users easily overlap, leading to misjudgments by the palmprint recognition model when distinguishing similar features. Simultaneously, the model may also reject the recognition request of the correct user due to insufficient feature discrimination capability, resulting in a significant decrease in recognition accuracy.
[0004] Therefore, existing technologies suffer from the technical problem that the accuracy of palmprint recognition models decreases as the amount of data increases. Summary of the Invention
[0005] Based on this, the purpose of this application is to at least solve one of the above-mentioned technical defects, especially the technical defect that the recognition accuracy of palmprint recognition models decreases with the increase of data volume in the prior art. This application provides a training method, apparatus, computer equipment, storage medium and computer program product for palmprint recognition models.
[0006] Firstly, this application provides a method for training a palmprint recognition model, the method comprising:
[0007] Acquire multiple hand image samples and determine the true category of each hand image sample;
[0008] Each palm image sample is input into a pre-trained teacher model to obtain the teacher features of each palm image sample; and each palm image sample is input into a student model to be trained to obtain the student features and predicted category of each palm image sample.
[0009] Based on the teacher and student features of each palm image sample, the feature distribution loss information is determined; based on the student features and predicted categories of each palm image sample, the feature classification loss information is determined; and based on the teacher features, student features, and true categories of each palm image sample, the feature contrast loss information is determined.
[0010] The total loss information is determined based on feature distribution loss information, feature classification loss information, and feature comparison loss information;
[0011] Based on the total loss information, the student model to be trained is trained until the preset training conditions are met, and the final student model is obtained, which serves as the palmprint recognition model. The palmprint recognition model is used to recognize the palm images collected by the access control and attendance system.
[0012] In an exemplary embodiment, feature contrast loss information is determined based on the teacher features, student features, and true category of each hand image sample, including:
[0013] For any hand image sample, based on the true category of the hand image sample, select one teacher feature from each teacher feature that is the same as the true category of the hand image sample as the positive sample teacher feature of the hand image sample, and select all teacher features that are different from the true category of the hand image sample as the negative sample teacher features of the hand image sample.
[0014] Based on the student features of each palm image sample and the positive sample teacher features of each palm image sample, the first similarity corresponding to each palm image sample is determined, and based on the student features of each palm image sample and the negative sample teacher features of each palm image sample, multiple second similarities corresponding to each palm image sample are determined.
[0015] Based on the first similarity, multiple second similarities, and a preset temperature coefficient corresponding to each palm image sample, the contrast loss sub-information of each palm image sample is determined;
[0016] Based on the contrast loss sub-information of each palm image sample, the feature contrast loss information is determined.
[0017] In an exemplary embodiment, feature distribution loss information is determined based on teacher and student features of each palm image sample, including:
[0018] Based on the teacher and student features of each palm image sample, the similarity information within the feature distribution and the similarity information between feature distributions are determined.
[0019] Based on the similarity information within the feature distribution and the similarity information between feature distributions, the feature distribution loss information is determined.
[0020] In an exemplary embodiment, based on the teacher and student features of each palm image sample, similarity information within the feature distribution is determined, including:
[0021] Based on the teacher characteristics of each palm image sample, determine the similarity of teacher feature distribution; and based on the student characteristics of each palm image sample, determine the similarity of student feature distribution.
[0022] Based on the similarity of teacher and student feature distributions, the internal similarity information of feature distributions is determined.
[0023] In an exemplary embodiment, based on the teacher and student features of each palm image sample, similarity information within the feature distribution and similarity information between feature distributions are determined, including:
[0024] Based on the teacher and student characteristics of each palm image sample, the feature cross-similarity is determined;
[0025] Feature cross similarity is used as similarity information between feature distributions.
[0026] In an exemplary embodiment, feature distribution loss information is determined based on intra-feature distribution similarity information and inter-feature distribution similarity information, including:
[0027] Obtain the preset feature distribution loss balance coefficient;
[0028] The feature distribution loss information is determined based on the feature distribution loss balance coefficient, the similarity information within the feature distribution, and the similarity information between feature distributions.
[0029] Secondly, this application provides a training device for a palmprint recognition model, the device comprising:
[0030] The acquisition module is used to acquire multiple palm image samples and determine the true category of each palm image sample;
[0031] The input module is used to input each palm image sample into the pre-trained teacher model to obtain the teacher features of each palm image sample, and to input each palm image sample into the student model to be trained to obtain the student features and predicted category of each palm image sample.
[0032] The first determining module is used to determine feature distribution loss information based on teacher and student features of each palm image sample, and to determine feature classification loss information based on student features and predicted categories of each palm image sample, and to determine feature contrast loss information based on teacher features, student features and true categories of each palm image sample.
[0033] The second determination module is used to determine the total loss information based on feature distribution loss information, feature classification loss information, and feature comparison loss information;
[0034] The training module is used to train the student model to be trained based on the total loss information until the preset training conditions are met, and then obtain the final student model as the palmprint recognition model. The palmprint recognition model is used to recognize the palm images collected by the access control and attendance system.
[0035] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0036] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0037] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0038] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0039] The palmprint recognition model training method, apparatus, computer equipment, storage medium, and computer program product provided in this application acquire multiple palm image samples, extract teacher features using a pre-trained teacher model, and calculate loss information based on the teacher and student features from three dimensions: feature distribution, feature classification, and feature comparison. The weighted sum of these three loss information points guides the training of the student model, resulting in the final palmprint recognition model. This method uses feature distribution loss information to measure the difference between teacher and student features at the overall probability distribution level; feature comparison loss information to measure the similarity between student features and similar or dissimilar teacher features; and feature classification loss information to measure the deviation between the student model's predicted category and the true category. These three loss information points synergistically constrain the learning process of the student model from different perspectives, enabling the student model to extract more discriminative feature representations from the teacher model. As the amount of palm image sample data increases, traditional single loss function training methods are prone to aliasing of different categories of features in the feature space due to the single constraint dimension. However, this method applies constraints to the student model from multiple levels through joint optimization of multi-dimensional losses, effectively solving the problem of reduced model recognition accuracy when the amount of data increases, and improving the recognition accuracy and generalization ability of the palmprint recognition model in large-scale data scenarios. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A schematic diagram illustrating the application environment of the training method for the palmprint recognition model provided in this application embodiment;
[0042] Figure 2 A flowchart illustrating a training method for a palmprint recognition model provided in an embodiment of this application;
[0043] Figure 3 A flowchart illustrating another training method for a palmprint recognition model provided in this application embodiment;
[0044] Figure 4 A schematic diagram of the structure of a training device for a palmprint recognition model provided in an embodiment of this application;
[0045] Figure 5 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0046] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0047] The training method for the palmprint recognition model provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server. Server 104 acquires multiple palm image samples and determines the true category of each palm image sample. Server 104 inputs each palm image sample into a pre-trained teacher model to obtain the teacher features of each palm image sample, and inputs each palm image sample into a student model to be trained to obtain the student features and predicted category of each palm image sample. Server 104 determines feature distribution loss information based on the teacher and student features of each palm image sample, and determines feature classification loss information based on the student features and predicted category of each palm image sample, and determines feature contrast loss information based on the teacher features, student features, and true category of each palm image sample. Server 104 determines total loss information based on feature distribution loss information, feature classification loss information, and feature contrast loss information. Server 104 trains the student model to be trained based on the total loss information until the preset training conditions are met, obtaining the final student model as the palmprint recognition model. The palmprint recognition model is used to recognize palm images collected by the access control and attendance system. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0048] In one exemplary embodiment, Figure 2 A flowchart illustrating a training method for a palmprint recognition model provided in this application embodiment is shown below. Figure 2 As shown, a training method for a palmprint recognition model is provided, which is then applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps S202 to S210. Wherein:
[0049] Step S202: Obtain multiple palm image samples and determine the true category of each palm image sample.
[0050] Among them, palm image samples refer to hand image data containing biometric features such as palm texture or veins, which are used to train the model.
[0051] The "real category" refers to the real identity label corresponding to the palm image sample, which is used to identify which registered user the palm image belongs to.
[0052] Optionally, the server first obtains multiple palm image samples labeled with the real categories.
[0053] Step S204: Input each palm image sample into the pre-trained teacher model to obtain the teacher features of each palm image sample; and input each palm image sample into the student model to be trained to obtain the student features and predicted category of each palm image sample.
[0054] Among them, the pre-trained teacher model refers to a feature extraction model with high recognition accuracy that has been pre-trained on a large-scale palm image dataset, and its network parameters remain fixed and not updated during the training process.
[0055] Among them, the student model to be trained refers to a feature extraction model whose network structure is lighter than that of the teacher model and needs to learn knowledge from the teacher model and be trained and optimized.
[0056] Here, teacher features refer to the high-dimensional vector extracted by the teacher model after inputting a palm image sample, which represents the biometric features of the palm image. This vector can be represented as follows: .
[0057] Here, student features refer to the high-dimensional vector extracted by the student model after inputting a palm image sample, which represents the biometric features of the palm image. This vector can be represented as follows: .
[0058] In the specific training process, there are a number of teacher feature slices, labeled as B, which are grouped into batches, and the teacher model is used to extract feature vectors. The shape is [B, D2], where D2 is the dimension. Similarly, during training, the number of student feature slices and batches is also B. These are also grouped into batches, and the student model is used to extract student feature vectors. The shape [B,D1] has an equivalent form [B,D1,h,w], where h and w are the height and width, respectively, both equal to 1. Similarly, the teacher's eigenvector... The same operation transforms the tensor into [B, D2, h, w], where h and w are the height and width, both equal to 1. Then, a convolution operation is used to align the student tensor dimension with the teacher tensor dimension. The input channel of the convolution operation is the student feature dimension D1, and the output channel is the teacher feature dimension D2. The convolution kernel is (1, 1). Finally, the shape of the student tensor changes from [B, D1, h, w] to [B, D2, h, w], denoted as... Then, the student and teacher tensors are equivalently transformed into two-dimensional vector forms, i.e., shapes [B, D2].
[0059] The predicted category refers to the predicted identity label of the current hand image sample, which is output by the student model after classifying the student's identity based on student characteristics.
[0060] Optionally, in each round of training, the same batch of hand image samples are input into the teacher model and the student model respectively. The teacher model outputs teacher features, and the student model outputs student features and predicted categories.
[0061] Step S206: Based on the teacher and student features of each palm image sample, determine the feature distribution loss information; based on the student features and predicted category of each palm image sample, determine the feature classification loss information; and based on the teacher features, student features, and true category of each palm image sample, determine the feature contrast loss information.
[0062] Feature distribution loss information refers to a quantitative indicator used to measure the differences between teacher and student features at the overall probability distribution level. It transfers knowledge by constraining the student feature distribution to align with the teacher feature distribution. Feature distribution loss information can be expressed as... .
[0063] Feature classification loss information refers to a quantitative metric used to measure the difference between the predicted class and the true class output by the student model. It can be calculated using a classification loss function with angular margin constraints. Feature classification loss information can be expressed as... .
[0064] Feature contrastive loss information refers to a quantitative metric used to measure the similarity between student features and features of teachers within the same category, as well as the differences between student features and features of teachers from different categories. It aims to enhance the intra-class compactness and inter-class separability of features. Feature contrastive loss information can be expressed as... .
[0065] Optionally, the server calculates feature distribution loss information based on teacher features and student features, calculates feature classification loss information based on the predicted category and the true category of student features, and calculates feature comparison loss information based on student features, teacher features, and the true category.
[0066] Step S208: Determine the total loss information based on the feature distribution loss information, feature classification loss information, and feature comparison loss information.
[0067] The total loss information refers to the comprehensive loss value obtained by weighting and summing the feature distribution loss information, feature classification loss information, and feature comparison loss information according to preset weights. The total loss information can be expressed as... .
[0068] Optionally, the server calculates the total loss information by weighting the three types of loss information according to preset weights. Total loss information The method of determination can be expressed as , where a, b, and c correspond to the weights of feature classification loss information, feature distribution loss information, and feature contrast loss information, respectively.
[0069] Step S210: Based on the total loss information, train the student model to be trained until the preset training conditions are met, and obtain the final student model as the palm print recognition model; the palm print recognition model is used to recognize the palm images collected by the access control and attendance system.
[0070] Among them, the preset training conditions refer to the termination criteria used to determine whether the model training is complete, such as reaching the preset upper limit of the number of iterations or the total loss information converging to a stable value.
[0071] Among them, the palmprint recognition model refers to the final trained student model, which is used to identify the identity of the collected palm images.
[0072] Among them, the access control and attendance system refers to a security system that uses biometric identification technology to verify the identity of people entering and exiting and record the time.
[0073] Optionally, after obtaining the total loss information, the server backpropagates to update the network parameters of the student model, while the parameters of the teacher model remain unchanged. This process is repeated until the model converges or reaches a preset number of training rounds, yielding the final student model as the palmprint recognition model.
[0074] The training method for the aforementioned palmprint recognition model involves acquiring multiple palm image samples, extracting teacher features using a pre-trained teacher model, and calculating feature distribution loss, feature classification loss, and feature contrast loss based on teacher and student features. The weighted sum of these three losses guides the training of the student model, resulting in the final palmprint recognition model. This method constrains the global distribution alignment of student and teacher features through feature distribution loss, forces similar features to be closer together and dissimilar features to be further apart through feature contrast loss, and introduces angular margin penalty through feature classification loss to enhance intra-class compactness and inter-class separation. The synergistic effect of these three losses enables the student model to distill more discriminative feature representations from the teacher model. As the amount of palm image sample data increases, traditional single-loss function training methods easily lead to aliasing of different categories of features in the feature space. This method, through joint optimization, effectively solves the problem of decreased model recognition accuracy with increasing data volume, improving the recognition accuracy and generalization ability of the palmprint recognition model in large-scale data scenarios.
[0075] In an exemplary embodiment, feature contrast loss information is determined based on the teacher features, student features, and true category of each palm image sample. This includes: for any palm image sample, selecting a teacher feature from among the teacher features that matches the true category of the palm image sample as a positive sample teacher feature, and selecting all teacher features that differ from the true category of the palm image sample as negative sample teacher features; determining a first similarity for each palm image sample based on the student features and the positive sample teacher features, and determining multiple second similarities for each palm image sample based on the student features and the negative sample teacher features; determining contrast loss sub-information for each palm image sample based on the first similarity, the multiple second similarities, and a preset temperature coefficient; and determining feature contrast loss information based on the contrast loss sub-information for each palm image sample.
[0076] Among them, positive sample teacher features refer to teacher features that have the same real category as the current palm image sample, representing the target features that student features should be close to.
[0077] Among them, negative sample teacher features refer to teacher features that have different true categories from the current palm image sample, representing features that student features should be avoided.
[0078] The first similarity refers to the kernel similarity between student features and positive sample teacher features, reflecting the degree of feature similarity between similar samples. The higher the value, the closer they are.
[0079] The second similarity refers to the kernel similarity between student features and the features of each negative sample teacher, reflecting the degree of feature similarity between different classes of samples.
[0080] The temperature coefficient is a hyperparameter used to adjust the steepness of the similarity distribution. The larger the temperature coefficient, the smoother the similarity distribution; the smaller the temperature coefficient, the sharper the similarity distribution.
[0081] Among them, the contrast loss sub-information refers to the local contrast loss component calculated for a single palm image sample, and the statistical values of the contrast loss sub-information of all samples constitute the feature contrast loss information.
[0082] Optionally, for each hand image sample in the current batch, the server first selects teacher features of the same category as positive sample teacher features from the teacher features in the same batch based on their true category, and uses teacher features of different categories as negative sample teacher features. Then, the kernel function value between the student features and the positive sample teacher features is calculated as the first similarity, and the kernel function value between the student features and each negative sample teacher feature is calculated as the second similarity. Next, the first similarity is divided by the temperature coefficient, and the exponent is taken as the numerator. The first similarity and all second similarities are divided by the temperature coefficient respectively, and the exponents are taken, and the sum is used as the denominator. The negative logarithm is taken to obtain the contrast loss sub-information of the sample. The mean of the contrast loss sub-information of all samples is calculated to obtain the feature contrast loss information.
[0083] In this embodiment, the feature contrast loss information can be determined based on local contrastive loss. It can be represented as ,in, Is with Positive samples of the same type It refers to all negative samples within the batch. It is the temperature coefficient.
[0084] In this embodiment, by constructing a contrastive loss based on positive and negative sample teacher features and student features, the student model is forced to learn to bring features of samples of the same category closer together and features of samples of different categories further apart, thus forming clear decision boundaries between categories in the feature space. This local contrastive learning mechanism effectively enhances the model's ability to distinguish between different categories of hand images when the feature space becomes increasingly crowded due to increased data volume and number of categories. It avoids feature aliasing between categories and solves the problem of decreased model discrimination and recognition accuracy when the data volume increases.
[0085] In an exemplary embodiment, determining feature distribution loss information based on teacher and student features of each palm image sample includes: determining intra-feature similarity information and inter-feature similarity information based on teacher and student features of each palm image sample; and determining feature distribution loss information based on intra-feature similarity information and inter-feature similarity information.
[0086] Among them, the internal similarity information of the feature distribution refers to the quantitative index used to measure the degree of self-aggregation within the teacher feature set and the student feature set, reflecting the self-similarity between samples within the same distribution.
[0087] Among them, the similarity information between feature distributions refers to a quantitative indicator used to measure the degree of cross-similarity between the teacher feature set and the student feature set, reflecting the degree of alignment between the two distributions.
[0088] Among them, feature distribution loss information refers to a quantitative indicator used to measure the overall difference between teacher feature distribution and student feature distribution, which is calculated based on the similarity information within feature distribution and the similarity information between feature distributions.
[0089] Optionally, when calculating the feature distribution loss information, the server first calculates the internal self-similarity of teacher features and student features separately, and summarizes them to obtain the internal similarity information of the feature distribution. Simultaneously, it calculates the cross-similarity between teacher features and student features as the inter-distribution similarity information. Then, based on the internal similarity information and the inter-distribution similarity information, it calculates the feature distribution loss information according to a preset formula, such that the loss value approaches zero when the two distributions are similar, and increases when the distributions differ significantly.
[0090] In this embodiment, by calculating the internal similarity and inter-distribution similarity of the feature distributions separately, and combining the two to construct feature distribution loss information, the degree of difference between teacher features and student features at the global distribution level can be effectively measured. Compared to focusing only on the loss of a single sample pair, this distribution-level constraint ensures that the feature distribution learned by the student model is consistent with the teacher model in its overall structure. As the amount of data increases, the student model is prone to deviating from the high-quality feature distribution of the teacher model due to limited fitting ability. This distribution loss information can constrain the distribution pattern of student features at a macro level, avoiding the distribution drift problem caused by the increase in data scale, and ensuring the recognition accuracy of the model.
[0091] In an exemplary embodiment, determining the internal similarity information of the feature distribution based on the teacher features and student features of each palm image sample includes: determining the teacher feature distribution similarity based on the teacher features of each palm image sample, and determining the student feature distribution similarity based on the student features of each palm image sample; and determining the internal similarity information of the feature distribution based on the teacher feature distribution similarity and the student feature distribution similarity.
[0092] Among them, the teacher feature distribution similarity refers to the average kernel similarity among all feature pairs in the teacher feature set, which is used to measure the degree of clustering or structural characteristics of the teacher feature distribution itself.
[0093] Among them, student feature distribution similarity refers to the average kernel similarity among all feature pairs in the student feature set, which is used to measure the degree of clustering or structural characteristics of the student feature distribution itself.
[0094] Among them, the internal similarity information of feature distributions refers to the combination of indicators that reflect the degree of self-similarity between the two distributions, which is composed of the similarity of teacher feature distributions and the similarity of student feature distributions.
[0095] Optionally, for the teacher feature set in the current batch, the server uses a kernel function to calculate the similarity between any two teacher feature vectors, and averages the similarity across all feature pairs to obtain the teacher feature distribution similarity. Similarly, the same operation is performed on the student feature set to obtain the student feature distribution similarity. The sum of the two is used as the internal similarity information of the feature distribution.
[0096] In this embodiment, the method for determining the similarity information within the feature distribution is as follows: ,in, For student feature distribution similarity, The similarity of teacher feature distribution. This term calculates the average kernel similarity among all feature pairs in a student feature set, measuring the degree of clustering or structural characteristics of the student feature distribution itself. If the student feature samples are highly concentrated in the feature space, this term will have a larger value. and They serve a similar purpose.
[0097] In this embodiment, the clustering characteristics of the distributions of teacher features and student features are characterized by calculating their internal self-similarity, providing a benchmark reference for subsequent calculation of distribution differences. As the amount of data increases and the number of sample categories increases, the sample distribution in the feature space tends to become more complex. This internal similarity information can measure whether the student model feature distribution maintains a reasonable internal structure, avoiding the problem of excessive feature collapse or excessive dispersion in the student model during the distillation process, and providing an internal constraint benchmark for the global distribution alignment of student features and teacher features.
[0098] In an exemplary embodiment, determining intra-feature similarity information and inter-feature similarity information based on teacher and student features of each palm image sample includes: determining feature cross-similarity based on teacher and student features of each palm image sample; and using feature cross-similarity as inter-feature similarity information.
[0099] Feature cross similarity refers to the average kernel similarity of all pairs between the teacher feature set and the student feature set, which is used to measure the degree of alignment between the two feature distributions.
[0100] Among them, the similarity information between feature distributions refers to another expression of feature cross-similarity, which is used to reflect the overall matching degree between the teacher feature distribution and the student feature distribution.
[0101] Optionally, for the teacher and student feature sets in the current batch, the server uses a kernel function to calculate the similarity between each teacher feature and each student feature, and averages the similarity across all teacher-student pairs to obtain the feature cross-similarity. A larger value indicates that the student feature distribution is closer to the teacher feature distribution in the kernel space, and the better the alignment between the two distributions. The calculated feature cross-similarity is directly used as the similarity information between feature distributions.
[0102] In this embodiment, the method for determining the similarity information between feature distributions is expressed as follows: , It calculates the average kernel similarity of all pairs of student features and teacher features, measuring the degree of alignment between the two distributions.
[0103] In this embodiment, the overall alignment between the two distributions is quantified by calculating the cross-similarity between teacher and student features, thus measuring the distributional differences in the kernel space. When the student model is insufficiently trained or the feature extraction capability is insufficient due to increased data volume, the cross-similarity value decreases, reflecting a reduction in the alignment between distributions. This metric, as a core component of the inter-distribution similarity, provides a direct measure of distributional distance for subsequent distribution loss calculations, thereby guiding the student model to consistently gravitate towards the high-quality feature distribution of the teacher model under different data scales.
[0104] In an exemplary embodiment, determining feature distribution loss information based on similarity information within feature distributions and similarity information between feature distributions includes: obtaining a preset feature distribution loss balance coefficient; and determining feature distribution loss information based on the feature distribution loss balance coefficient, similarity information within feature distributions, and similarity information between feature distributions.
[0105] The characteristic distribution loss balance coefficient is a hyperparameter used to adjust the weights between the attracting and repulsive terms in the calculation of characteristic distribution loss information, and can be expressed as: This coefficient is used to balance the two objectives of alignment between distributions and maintaining diversity within distributions. The larger the value, the more aligned the two distributions tend to be; the smaller the value, the better it is to maintain the diversity of feature distributions and avoid excessive smoothing of features.
[0106] Among them, the feature distribution loss information refers to the loss value obtained by combining the internal similarity information and the inter-distribution similarity information according to a preset formula. When two distributions are similar, the difference between the sum of their internal similarities and the weighted similarity between the distributions approaches zero; when the two distributions are significantly different, this difference increases, generating a larger penalty signal.
[0107] Optionally, the server obtains a preset feature distribution loss balance coefficient. The feature distribution loss information is obtained by multiplying the calculated intra-feature distribution similarity information and inter-feature distribution similarity information by the balance coefficient and then subtracting the former. During training, the balance coefficient can be dynamically adjusted according to the training stage. For example, the coefficient is smaller in the early stages of training to avoid excessive attraction causing loss collapse, and the coefficient is increased in the later stages of training to strengthen distribution alignment.
[0108] In this embodiment, the method for determining the feature distribution loss information is expressed as follows: , It is a quadratic polynomial kernel, and the calculation formula is: .in, This can be understood as an attraction term, used to shorten the distance between the source and target domains. The kernel term, known as the repulsion term, is used to maintain the diversity within the distributions of teacher and student features. For the attraction term, if the two feature distributions are very similar, the kernel function value will be large. Since the attraction term is preceded by a negative sign, the larger the absolute value of the attraction term, the smaller the total loss, thus narrowing the distance between the two distributions. The feature distribution loss balancing coefficient λ balances the attraction and repulsion terms during training dynamics, preventing excessive feature smoothing. In the early stages of training or at specific phases, the attraction term may be too strong, leading to loss collapse. In such cases, λ is introduced to reduce the attraction term and strengthen the repulsion term, encouraging the preservation of diversity within the real data, thereby learning finer feature details.
[0109] In the above method for determining the feature distribution loss information, when the distributions of teacher and student features are similar, the statistical properties within student features should be similar to the statistical properties within teacher features, and their similarity should be close to their respective internal self-similarity, i.e. The similarity between teacher and student characteristics is close to 0. When the two distributions of teacher and student characteristics differ significantly, the mutual similarity between teacher and student characteristics is... The similarity is very small, while the self-similarity of student or teacher characteristics remains at its original level, leading to... The larger the value, the greater the penalty, forcing the student model to adjust its parameters to reduce distributional variance. This is achieved by minimizing... The student model not only aligns with the global distribution of teacher features, but also maintains its own internal distribution while making the mean embeddings of teacher and student features in the kernel space as close as possible.
[0110] In this embodiment, an adjustable feature distribution loss balance coefficient is introduced to achieve flexible control over the balance between feature distribution alignment strength and feature diversity preservation. When the amount of hand image data increases and sample diversity improves, a fixed-weight distribution loss may lead to over-smoothing of student features or insufficient distribution alignment. Dynamic adjustment of the balance coefficient allows the model to, at different training stages and data scales, both narrow the distance between teacher and student feature distributions through inter-distribution similarity terms to achieve knowledge distillation, and maintain the diversity within the feature distribution through internal similarity terms to avoid feature collapse. This effectively solves the problem of decreased recognition accuracy caused by increased distribution alignment difficulty as the data volume increases.
[0111] In practical applications, the maximum mean difference loss Ignoring intra-class compactness and inter-class separability, and only matching the global distribution mean, leads to feature aliasing between different classes. Therefore, the substantial improvement of the maximum mean difference loss in this application is the introduction of local contrast loss. This approach brings similar samples together and separates dissimilar samples. It considers the maximum mean difference loss. and local contrast loss Furthermore, to match high-precision feature learning tasks, this application introduces an additive angular margin loss with angular margin constraints. It inherits the multi-class classification framework of Softmax and solves the shortcomings of traditional Softmax in feature discrimination by normalization and angular margin penalty, significantly improving intra-class compactness and inter-class separation. It can be represented as Where: N is the number of samples in the training batch; n is the total number of categories; m is the additive angular interval parameter in radians, with a typical value of m=0.5 in palmprint recognition tasks, which only applies to the true categories. Corresponding angle The above makes the real class require a larger cosine similarity to be correctly classified, thus forcing intra-class features to be more compact and inter-class features to be larger; s is a feature scaling hyperparameter used to amplify the normalized cosine value to ensure the probability discrimination during softmax classification, with a typical value of 64.
[0112] The technical solution of this application enables two features of batch number to be combined with three types of loss to jointly guide the training of the student model and update the network parameters of the student model until the optimal value is reached. This training method can improve the feature recognition effect.
[0113] In another embodiment, such as Figure 3 As shown, a training method for a palmprint recognition model is provided, which is then applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0114] Step S302: Obtain multiple palm image samples and determine the true category of each palm image sample.
[0115] Step S304: Input each palm image sample into the pre-trained teacher model to obtain the teacher features of each palm image sample; and input each palm image sample into the student model to be trained to obtain the student features and predicted category of each palm image sample.
[0116] Step S306: Based on the teacher and student features of each palm image sample, determine the similarity information within the feature distribution and the similarity information between feature distributions; based on the student features and predicted categories of each palm image sample, determine the feature classification loss information; and based on the teacher features, student features, and true categories of each palm image sample, determine the feature contrast loss information.
[0117] Step S308: Determine the feature distribution loss information based on the similarity information within the feature distribution and the similarity information between feature distributions.
[0118] Step S310: Determine the total loss information based on the feature distribution loss information, feature classification loss information, and feature comparison loss information.
[0119] Step S312: Based on the total loss information, train the student model to be trained until the preset training conditions are met, and obtain the final student model as the palmprint recognition model; the palmprint recognition model is used to recognize the palm images collected by the access control and attendance system.
[0120] It should be noted that the specific limitations of the above steps can be found in the specific limitations of the training method for a palmprint recognition model described above.
[0121] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0122] The training device for the palmprint recognition model provided in the embodiments of this application is described below. The training device for the palmprint recognition model has the same inventive concept as the training method for the palmprint recognition model described above. The solution to the problem provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more palmprint recognition model training device embodiments provided below can be referred to the limitations of the palmprint recognition model training method described above. The palmprint recognition model training device described below and the palmprint recognition model training method described above can be referred to each other, and will not be repeated here.
[0123] In one exemplary embodiment, Figure 4 This is a schematic diagram of the structure of a training device for a palmprint recognition model provided in an embodiment of this application, as shown below. Figure 4 As shown, the training device for the palmprint recognition model includes: an acquisition module 402, an input module 404, a first determination module 406, a second determination module 408, and a training module 410, wherein:
[0124] The acquisition module 402 is used to acquire multiple palm image samples and determine the true category of each palm image sample;
[0125] The input module 404 is used to input each palm image sample into the pre-trained teacher model to obtain the teacher features of each palm image sample, and to input each palm image sample into the student model to be trained to obtain the student features and predicted category of each palm image sample.
[0126] The first determining module 406 is used to determine feature distribution loss information based on teacher and student features of each palm image sample, and to determine feature classification loss information based on student features and predicted categories of each palm image sample, and to determine feature contrast loss information based on teacher features, student features and true categories of each palm image sample.
[0127] The second determining module 408 is used to determine the total loss information based on feature distribution loss information, feature classification loss information, and feature comparison loss information;
[0128] The training module 410 is used to train the student model to be trained based on the total loss information until the preset training conditions are met, so as to obtain the final student model as the palm print recognition model; the palm print recognition model is used to recognize the palm images collected by the access control and attendance system.
[0129] In an exemplary embodiment, the first determining module 406 is specifically configured to, for any hand image sample, select, based on the true category of the hand image sample, one teacher feature from each teacher feature that is the same as the true category of the hand image sample as the positive sample teacher feature of the hand image sample, and select all teacher features that are different from the true category of the hand image sample as the negative sample teacher features of the hand image sample; determine a first similarity corresponding to each hand image sample based on the student features of each hand image sample and the positive sample teacher features of each hand image sample, and determine multiple second similarities corresponding to each hand image sample based on the student features of each hand image sample and the negative sample teacher features of each hand image sample; determine the contrast loss sub-information of each hand image sample based on the first similarity, the multiple second similarities, and a preset temperature coefficient; and determine feature contrast loss information based on the contrast loss sub-information of each hand image sample.
[0130] In an exemplary embodiment, the first determining module 406 is specifically used to determine the similarity information within the feature distribution and the similarity information between feature distributions based on the teacher features and student features of each palm image sample; and to determine the feature distribution loss information based on the similarity information within the feature distribution and the similarity information between feature distributions.
[0131] In an exemplary embodiment, the first determining module 406 is specifically configured to determine the similarity of teacher feature distribution based on the teacher features of each palm image sample, and to determine the similarity of student feature distribution based on the student features of each palm image sample; and to determine the internal similarity information of feature distribution based on the similarity of teacher feature distribution and the similarity of student feature distribution.
[0132] In an exemplary embodiment, the first determining module 406 is specifically used to determine the feature cross-similarity based on the teacher features and student features of each palm image sample; and to use the feature cross-similarity as similarity information between feature distributions.
[0133] In an exemplary embodiment, the first determining module 406 is specifically used to obtain a preset feature distribution loss balance coefficient; and to determine feature distribution loss information based on the feature distribution loss balance coefficient, the similarity information within the feature distribution, and the similarity information between feature distributions.
[0134] In one exemplary embodiment, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the training method for any of the palmprint recognition models described above.
[0135] In one exemplary embodiment, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the training method of any palmprint recognition model in the above embodiments.
[0136] In one exemplary embodiment, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of a training method for any of the palmprint recognition models described in the above embodiments.
[0137] Indicatively, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the internal structure of a computer device 500 provided in an embodiment of this application. The computer device 500 can be provided as a server. (Refer to...) Figure 5 The computer device 500 includes a processing component 502, which further includes one or more processors, and memory resources represented by memory 501 for storing instructions, such as application programs, that can be executed by the processing component 502. The application programs stored in memory 501 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 502 is configured to execute instructions to perform the training method of the palmprint recognition model of any of the above embodiments.
[0138] The computer device 500 may also include a power supply component 503 configured to perform power management of the computer device 500, a wired or wireless network interface 504 configured to connect the computer device 500 to a network, and an input / output (I / O) interface 505. The computer device 500 may operate on an operating system stored in memory 501, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0139] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0140] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0141] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0142] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0143] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A training method for a palmprint recognition model, characterized in that, The method includes: Acquire multiple palm image samples and determine the true category of each palm image sample; Each of the aforementioned palm image samples is input into a pre-trained teacher model to obtain teacher features for each of the aforementioned palm image samples; and each of the aforementioned palm image samples is input into a student model to be trained to obtain student features and predicted categories for each of the aforementioned palm image samples. Based on the teacher and student features of each of the palm image samples, feature distribution loss information is determined; based on the student features and predicted categories of each of the palm image samples, feature classification loss information is determined; and based on the teacher features, student features, and true categories of each of the palm image samples, feature contrast loss information is determined. Based on the feature distribution loss information, the feature classification loss information, and the feature comparison loss information, the total loss information is determined; Based on the total loss information, the student model to be trained is trained until the preset training conditions are met, and the final student model is obtained as the palm print recognition model; the palm print recognition model is used to recognize the palm images collected by the access control and attendance system.
2. The method according to claim 1, characterized in that, The determination of feature contrast loss information based on teacher features, student features, and the true category of each of the aforementioned palm image samples includes: For any of the aforementioned palm image samples, based on the true category of the palm image sample, one teacher feature that is the same as the true category of the palm image sample is selected from each of the aforementioned teacher features as the positive sample teacher feature of the palm image sample, and all teacher features that are different from the true category of the palm image sample are selected as the negative sample teacher features of the palm image sample. Based on the student features of each palm image sample and the positive sample teacher features of each palm image sample, a first similarity is determined for each palm image sample, and based on the student features of each palm image sample and the negative sample teacher features of each palm image sample, multiple second similarities are determined for each palm image sample. Based on the first similarity, multiple second similarities, and a preset temperature coefficient corresponding to each palm image sample, the contrast loss sub-information of each palm image sample is determined; Based on the contrast loss sub-information of each palm image sample, the feature contrast loss information is determined.
3. The method according to claim 1, characterized in that, The determination of feature distribution loss information based on the teacher and student features of each of the aforementioned palm image samples includes: Based on the teacher and student features of each of the palm image samples, the similarity information within the feature distribution and the similarity information between feature distributions are determined. Based on the similarity information within the feature distribution and the similarity information between the feature distributions, the feature distribution loss information is determined.
4. The method according to claim 3, characterized in that, The determination of similarity information within the feature distribution based on the teacher and student features of each of the aforementioned palm image samples includes: Based on the teacher characteristics of each of the palm image samples, the similarity of the teacher feature distribution is determined, and based on the student characteristics of each of the palm image samples, the similarity of the student feature distribution is determined. Based on the similarity of the teacher feature distribution and the similarity of the student feature distribution, the internal similarity information of the feature distribution is determined.
5. The method according to claim 3, characterized in that, The determination of intra-distribution similarity information and inter-distribution similarity information based on the teacher and student features of each of the palm image samples includes: Based on the teacher and student characteristics of each of the aforementioned palm image samples, the feature cross-similarity is determined; The feature cross similarity is used as similarity information between feature distributions.
6. The method according to claim 3, characterized in that, The step of determining feature distribution loss information based on the intra-feature similarity information and the inter-feature similarity information includes: Obtain the preset feature distribution loss balance coefficient; The feature distribution loss information is determined based on the feature distribution loss balance coefficient, the similarity information within the feature distribution, and the similarity information between the feature distributions.
7. A training device for a palmprint recognition model, characterized in that, The device includes: The acquisition module is used to acquire multiple palm image samples and determine the true category of each palm image sample; The input module is used to input each of the palm image samples into a pre-trained teacher model to obtain the teacher features of each of the palm image samples, and to input each of the palm image samples into a student model to be trained to obtain the student features and predicted category of each of the palm image samples. The first determining module is used to determine feature distribution loss information based on teacher and student features of each palm image sample, and to determine feature classification loss information based on student features and predicted categories of each palm image sample, and to determine feature contrast loss information based on teacher features, student features and true categories of each palm image sample. The second determining module is used to determine the total loss information based on the feature distribution loss information, the feature classification loss information, and the feature comparison loss information; The training module is used to train the student model to be trained based on the total loss information until the preset training conditions are met, so as to obtain the final student model as the palmprint recognition model; the palmprint recognition model is used to recognize the palm images collected by the access control and attendance system.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
