A Feature Distribution Measurement Method Based on Hybrid Metrics

By introducing mixed metrics into deep transfer learning methods, calculating multi-order statistical distances of inter-domain features, the problem that existing methods fail to accurately measure the difference in conditional distribution between domains is solved, and the labeling accuracy and generalization ability of the transfer learning model in the target domain data is improved.

CN115861660BActive Publication Date: 2025-07-22HARBIN ENG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211689077.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2025-07-22
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

The existing deep transfer learning methods only consider the differences in edge distribution between domains in image classification, and fail to accurately measure the differences in conditional distribution between domains, resulting in insufficient generalization ability of the transfer learning model in the target domain data and cannot be accurately labeled.

Method used

A feature distribution measurement method based on mixed metrics is adopted, and the first-order, second-order, and third-order statistical distances of the inter-domain feature edge distribution and conditional distribution are calculated, and the target domain pseudo-label is obtained, and the transfer learning model is updated to improve the annotation performance.

Benefits of technology

By taking into account the multi-order statistical information of the edge distribution and conditional distribution of inter-domain features simultaneously, the transfer learning model's annotation accuracy and generalization ability of the target domain data is improved, and the accuracy of the pseudo-label is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115861660B_ABST
    Figure CN115861660B_ABST
Patent Text Reader

Abstract

A feature distribution measurement method based on hybrid metrics, which aims to solve the problem that the transfer learning model of the deep transfer learning method cannot accurately label the target domain data when performing image classification. The pictures are divided into the source domain and the target domain; the pictures in the source domain are used to train the transfer learning model to obtain the model; the classification loss is calculated; the first, second, and third order statistical distances of the inter-domain feature marginal distribution differences are calculated, and then weighted and combined to obtain the hybrid metric of the inter-domain feature marginal distribution; the soft labels of the target domain are obtained, the initial soft centroids of the target domain features are calculated using the soft labels, and then the pseudo-labels of the target domain features are obtained using the cosine similarity; the first, second, and third order statistical distances of the inter-domain feature conditional distribution differences are calculated, and then weighted and combined to obtain the hybrid metric of the inter-domain feature conditional distribution; the two hybrid metrics are added to obtain the inter-domain feature statistical distance; the overall loss function of the transfer learning model is calculated, and the model is updated; the test samples are predicted to obtain the class prediction probabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for measuring feature distribution, and more particularly to a method for measuring feature distribution based on the marginal distribution of inter-domain features and the conditional distribution of inter-domain features, belonging to the field of image classification. Background Art

[0002] With the development of information technology and the Internet, social networks, video surveillance and other fields generate a huge amount of image data every moment, showing an explosive growth. Image classification is one of the most important tasks in computer vision, and its goal is to assign corresponding semantic labels to images. With the development of machine learning and computer vision technologies, using a computer to complete automatic recognition and classification based on image content has become a research hotspot. In recent years, deep learning networks have made great breakthroughs in image classification. By inputting a large amount of labeled training data to train the network, a powerful deep learning network model can be obtained, and then the test data can be labeled. However, the recognition performance of existing deep learning methods needs to meet the following two basic assumptions: First, the training of a deep learning model depends on a sufficient number of labeled training samples. The larger the number of samples and the higher the quality, the stronger the generalization ability of the trained deep learning model. Second, the training data and the test data need to satisfy independent and identically distributed. When there is a distribution difference between the training data and the test data, it will lead to a significant decline in the performance of the deep learning model. In practical applications, the above two assumptions usually cannot be satisfied, resulting in the inability to establish a reliable deep learning model to label the test data. In recent years, transfer learning has relaxed the two basic assumptions in traditional machine learning, aiming to use the knowledge contained in the training data (source domain) and tasks to solve the tasks and problems of the test data (target domain).

[0003] With the development of deep learning technology, transfer learning methods based on deep learning (deep transfer learning methods) have achieved remarkable results. This method uses a deep learning network to extract features from different domains. Before feeding the features into the classifier, different feature distribution measurement methods are used to calculate the distribution difference between domains. Compared with other transfer learning methods, the deep transfer learning method has higher performance and stability, and has been deeply studied and widely applied in image classification problems. The effect of the deep transfer learning method depends on the selection and design of the feature distribution measurement method. The feature distribution measurement method directly affects the generalization ability of the transfer learning model and determines the labeling performance of the transfer learning model for the target domain data. Existing research usually uses the Maximum Mean Discrepancy (MMD) or Correlation Alignment (CORAL) as the feature distribution measurement. However, although the above feature distribution measurement methods have improved the performance of the transfer learning model to a certain extent, there are still the following problems:

[0004] 1) Usually, a single feature distribution metric method cannot accurately characterize the complex inter-domain feature distribution differences;

[0005] 2) The above-mentioned feature distribution metric method only calculates the inter-domain marginal distribution differences. However, to ensure the classification performance of the deep transfer learning algorithm, the extracted features should also satisfy the clustering assumption. Therefore, it is also necessary to accurately calculate the inter-domain conditional distribution differences.

[0006] In practical applications, the above problems will directly lead to insufficient generalization ability of the transfer learning model for the target domain data, directly affecting the annotation effect of the target domain data. Summary of the Invention

[0007] In order to solve the problem that the deep transfer learning method only considers the inter-domain marginal distribution differences and does not consider the inter-domain conditional distribution differences when classifying images, and cannot accurately measure the inter-domain feature distribution differences, resulting in the transfer learning model being unable to accurately annotate the target domain data, the present invention further proposes a feature distribution metric method based on hybrid metrics.

[0008] It includes the following steps:

[0009] S1. Obtain a certain number of pictures, divide the pictures into training samples and test samples, use the training samples as the source domain, and the test samples as the target domain;

[0010] S2. Construct a transfer learning model, train the transfer learning model using the pictures in the source domain, output the prediction probability of the object category in the pictures until the loss remains unchanged, and obtain the trained transfer learning model;

[0011] S3. Calculate the classification loss of the source domain data according to the trained transfer learning model;

[0012] S4. Use the maximum mean discrepancy to calculate the first-order statistic distance of the inter-domain feature marginal distribution differences;

[0013] S5. Use the correlation alignment method to calculate the second-order statistic distance of the inter-domain feature marginal distribution differences;

[0014] S6. Use the high-order moment matching method to calculate the third-order statistic distance of the inter-domain feature marginal distribution differences;

[0015] S7. Weightedly combine the first-order statistic distance, the second-order statistic distance, and the third-order statistic distance to obtain the hybrid statistic distance of the inter-domain feature marginal distribution;

[0016] S8. Obtain the target domain soft labels, calculate the initial soft centroids of the target domain features using the soft labels, and then use the k-means algorithm with cosine similarity as the distance metric to obtain the pseudo-labels of the target domain features

[0017] S9. Calculate the first-order statistic distance of the conditional distribution difference of the inter-domain features by using the target domain pseudo-labels and the maximum mean discrepancy;

[0018] S10. Calculate the second-order statistic distance of the conditional distribution difference of the inter-domain features by using the target domain pseudo-labels and the correlation alignment method;

[0019] S11. Calculate the third-order statistic distance of the conditional distribution difference of the inter-domain features by using the target domain pseudo-labels and the high-order moment matching method;

[0020] S12. Combine the first-order statistic distance, the second-order statistic distance, and the third-order statistic distance with weights to obtain the mixed statistic distance of the conditional distribution of the inter-domain features;

[0021] S13. Add the mixed statistic distance of the marginal distribution of the inter-domain features obtained in S7 and the mixed statistic distance of the conditional distribution of the inter-domain features obtained in S12 to obtain the statistic distance of the inter-domain features;

[0022] S14. Calculate the overall loss function of the transfer learning model according to the classification loss of the source domain data in S3 and the statistic distance of the inter-domain features in S13, and update the parameters of the transfer learning model to obtain a new transfer learning model;

[0023] S15. Use the new transfer learning model to predict the test samples to obtain the prediction probabilities of the types corresponding to the test samples.

[0024] Furthermore, the transfer learning model in S2 sequentially includes a feature extractor and a classifier. The feature extractor sequentially includes an input layer, a convolutional layer, a pooling layer, four residual convolutional modules, a bottleneck layer, and a feature normalization layer; the classifier sequentially includes two fully connected layers.

[0025] Furthermore, in S3, calculate the classification loss of the source domain data according to the trained transfer learning model. The specific process is as follows:

[0026]

[0027] Among them, represents the classification loss of the source domain data, J(·) represents the cross-entropy loss function, and n s represents the number of samples in the source domain, x s and y s respectively represent the source domain sample feature vector and the corresponding label, where i = 1, 2, 3,..., n s .

[0028] Furthermore, in S7, combine the first-order statistic distance, the second-order statistic distance, and the third-order statistic distance with weights to obtain the mixed statistic distance of the marginal distribution of the inter-domain features. The specific process is as follows:

[0029] First-order statistic distance:

[0030]

[0031] where the inter-domain feature is the feature between the source-domain feature h s and the target-domain feature h t ; n s and n t represent the number of samples in h s and h t respectively, and j = 1, 2, 3, …, n t ; k(·,·) is the Gaussian kernel function, so there is γ is the bandwidth parameter, and i′, j′ represent the source-domain and target-domain sample indices respectively;

[0032] Second-order statistic distance:

[0033]

[0034] where represents the square of the matrix Frobenius norm, d represents the dimension of the feature of h s and h t , and the two have the same dimension. Cov(h s ) and Cov(h t ) represent the covariance matrices of h s and h t respectively;

[0035] The third-order statistic distance is:

[0036]

[0037] where represents the outer product of vectors, represents the third power, and the result is a third-order tensor;

[0038] Mixed statistic distance of the marginal distribution of inter-domain features:

[0039]

[0040] where α k is the hyperparameter used to balance the distances of each order of statistics,

[0041] Furthermore, in S12, the first-order statistic distance, the second-order statistic distance, and the third-order statistic distance are weighted and combined to obtain the mixed statistic distance of the conditional distribution of inter-domain features. The specific process is as follows:

[0042] First-order statistic distance

[0043]

[0044] Among them, h s,c and h t,c respectively represent the samples of class c in h s and h t The number of such samples is and

[0045] Second-order statistic distance

[0046]

[0047] Among them, Cov c (·) represents the covariance matrix of the features of class c;

[0048] Third-order statistic distance

[0049]

[0050] Mixed statistic distance of the conditional distribution of inter-domain features

[0051]

[0052] Among them, β k represents the hyperparameter used to balance the distances of various orders of statistics,

[0053] Furthermore, in S12, the first-order statistic distance, the second-order statistic distance, and the third-order statistic distance are weighted and combined to obtain the mixed statistic distance of the conditional distribution of inter-domain features. The specific process is as follows:

[0054] First-order statistic distance

[0055]

[0056] Among them, h s,c and h t,c respectively represent the samples of class c in h s and h t The number of such samples is and

[0057] Second-order statistic distance

[0058]

[0059] Among them, Cov c (·) represents the covariance matrix of the features of class c;

[0060] Third-order statistic distance

[0061]

[0062] Mixed statistical distance of inter-domain feature conditional distributions

[0063]

[0064] where β k represents a hyperparameter for balancing the statistical distances of each order,

[0065] Furthermore, in S13, the mixed statistical distance of the inter-domain feature marginal distribution obtained in S7 is added to the mixed statistical distance of the inter-domain feature conditional distribution obtained in S12 to obtain the inter-domain feature statistical distance. The specific process is as follows:

[0066] D mixup (h s , h t ) = D marginal (h s , h t ) + D conditional (h s , h t ).

[0067] Furthermore, in S14, the overall loss function of the transfer learning model is calculated according to the classification loss of the source domain data in S3 and the inter-domain feature statistical distance in S13. The specific process is as follows:

[0068]

[0069] Beneficial effects:

[0070] The pictures obtained in the present invention are divided into a training set and a test set, and the training set and the test set respectively correspond to the source domain and the target domain of the deep transfer learning method. The constructed transfer learning model is trained using the source domain to obtain a transfer learning model. The classification loss of the source domain data is calculated according to the transfer learning model. Then, the first-order statistic distance, the second-order statistic distance, and the third-order statistic distance of the inter-domain feature marginal distribution difference are calculated using the maximum mean discrepancy, the correlation alignment method, and the high-order moment matching method; the three are weighted and combined to obtain the mixed statistic distance of the inter-domain feature marginal distribution. The soft labels of the target domain are obtained, and the initial soft centroids of the target domain features are calculated using the soft labels, and then the k-means algorithm using the cosine similarity as the distance metric is used to obtain the pseudo-labels of the target domain features. The first-order statistic distance, the second-order statistic distance, and the third-order statistic distance of the conditional distribution difference of the inter-domain features are calculated using the target domain pseudo-labels in combination with the maximum mean discrepancy, the correlation alignment method, and the high-order moment matching method respectively; the three are weighted and combined to obtain the mixed statistic distance of the inter-domain feature conditional distribution. The mixed statistic distance of the inter-domain feature marginal distribution is added to the mixed statistic distance of the inter-domain feature conditional distribution to obtain the inter-domain feature statistic distance. The overall loss function of the transfer learning model is calculated according to the classification loss of the source domain data and the inter-domain feature statistic distance, and the parameters of the transfer learning model are updated to obtain a new transfer learning model, and the new transfer learning model is used to predict the test samples to obtain the prediction probabilities of the corresponding categories of the test samples.

[0071] The present invention accurately measures the inter-domain feature distribution by simultaneously calculating the multi-order statistical information of the inter-domain feature marginal distribution and the conditional distribution. When the present invention is applied to the transfer learning algorithm, the performance of the algorithm can be effectively improved. In the setting of the present invention, the target domain samples are completely unlabeled. Therefore, the present invention calculates the soft centroids of the target domain features using the prediction output of the transfer learning model for the target domain data, and uses the soft centroids as the clustering center points of the target domain features to cluster the target domain features, and assigns pseudo-labels to the target domain samples according to the clustering results, which can effectively improve the accuracy of the pseudo-labels, and then calculate the conditional distribution difference of the inter-domain feature distribution, and measure the multi-order statistic distance of the inter-domain feature distribution. Compared with the existing measurement methods that only use the single-order moment, the multi-order statistics of the features can more accurately reflect the true distribution of the features and improve the performance of the present invention in terms of inter-domain conditional distribution adaptation. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 is a network structure diagram for implementing the feature distribution measurement method based on hybrid measurement;

[0073] Figure 2 is a flowchart of the present invention; DETAILED DESCRIPTION OF THE INVENTION

[0074] DETAILED DESCRIPTION OF THE INVENTION I: In combination with Figure 1 - Figure 2To illustrate this embodiment, the feature distribution measurement method based on hybrid metrics in this embodiment includes the following steps:

[0075] During the implementation of this method, it is added to the objective function of the deep learning network in the form of a loss function, aiming to improve the classification accuracy of the trained transfer learning model for the target domain data.

[0076] S1. Obtain a certain number of pictures, divide the pictures into labeled training samples and unlabeled test samples, with the training samples as the source domain and the test samples as the target domain.

[0077] Given n s labeled source domains and n t unlabeled target domains where X s and Y s represent the sample set of the source domain and its corresponding label set respectively, and x s and y s represent the sample feature vector of the source domain and the corresponding label respectively; X t and Y t represent the sample set of the target domain and its corresponding label set respectively, and x t and y t represent the sample feature vector of the target domain and the corresponding label respectively. The source domain samples are from 2817 commodity pictures collected on the online shopping website Amazon.com, and the target domain samples are from 795 photos taken by a low-resolution camera. The above photos contain 31 categories of items commonly seen in office scenarios, such as: laptop computers, filing cabinets, projectors, etc. All picture sizes are cropped to 224*224.

[0078] S2. Build a transfer learning model, use the pictures in the source domain to train the transfer learning model, and output the predicted probability of the object category in the picture until the loss remains unchanged, to obtain the trained transfer learning model.

[0079] The transfer learning model successively includes a feature extractor and a classifier. The feature extractor G uses the pre-trained ResNet-50 on the ImageNet dataset as the backbone network. The input of this network is an image of 224*224, which is input into a convolutional layer with a convolutional kernel size of 7*7 and a stride of 2, and then connected to a max-pooling layer with a size of 3*3 and a stride of 2. Then it is connected to four residual convolutional modules, and finally connected to an output layer of 1000 dimensions. During the model construction, the output layer of the backbone network is removed and replaced with a bottleneck layer of dimension 256, and a feature normalization layer is added after the bottleneck layer. The classifier F of the model consists of two fully connected layers, and the number of nodes in each layer is 256 and 31 respectively. Among them, the feature extractor G is responsible for mapping the original image into a feature space of dimension 256, and this process can be expressed as h s = G(x s ), h s = G(x s ), h s and h t respectively represent the features for measuring the distribution difference between the source domain and the target domain, and G(·) represents the functional form. The classifier is responsible for classifying the features into the corresponding categories. During the training process of the transfer learning model, the source domain and the target domain share model parameters during the training process. For the network structure details, see Figure 1 . The structure of the feature extractor G in the figure is simplified.

[0080] S3. Calculate the classification loss of the source domain data according to the trained transfer learning model. The specific process is as follows:

[0081]

[0082] Among them, represents the classification loss on the source domain data, J(·) represents the cross-entropy loss function, and i = 1, 2, 3, …, n s .

[0083] S4. Use the maximum mean discrepancy to calculate the first-order statistical distance of the marginal distribution difference of the inter-domain features.

[0084] The inter-domain features are the features between the source domain feature h s and the target domain feature h t . The first-order statistical distance of the inter-domain features is calculated using the maximum mean discrepancy (MMD), and its definition is the mean distance of h s and h t in the infinite-dimensional kernel space. Its calculation method is expressed as:

[0085]

[0086] Among them, n s and n t represent hs With h t The number of samples in, j = 1, 2, 3, …, n t , Φ(·): Is a mapping used to map the original features to the Reproducing Kernel Hilbert Space (RKHS). In practical applications, the calculation method of the above formula is:

[0087]

[0088] Among them, k(·,·) is the Gaussian kernel function, so there is Among them, i′, j′ represent the sample indices of the source domain and the target domain, and γ is the bandwidth parameter.

[0089] S5. Use the Correlation Alignment method (CORAL) to calculate the second-order statistic distance of the inter-domain feature marginal distribution difference.

[0090] The second-order statistic distance of the inter-domain features is realized by calculating the distance of the inter-domain feature covariance matrix, expressed as:

[0091]

[0092] Among them, Represents the square of the matrix Frobenius norm, d represents h s With h t The dimension of the features, the two have the same dimension, Cov(h s ) and Cov(h t ) respectively represent the covariance matrices of h s With h t Its calculation method is:

[0093]

[0094]

[0095] Among them, 1 represents a column vector with all elements being 1.

[0096] S6. Use the Higher-Order Moment Matching method (HoMM) to calculate the third-order statistic distance of the inter-domain feature marginal distribution difference

[0097] The present invention adds the calculation of the high-order statistics of the inter-domain features on the basis of the first-order and second-order statistic distances. The calculation method of the third-order statistic distance of the inter-domain features is:

[0098]

[0099] Among them, represents the vector outer product, represents the third - order power, and its result is a third - order tensor. Since the space complexity of calculating the third - order tensor has reached so only this cut - off needs to be calculated, because it is difficult to implement the calculation of higher - order statistics in practical applications.

[0100] S7. Combine the first - order statistic distance, second - order statistic distance, and third - order statistic distance with weights to obtain the mixed statistic distance (mixed metric) of the marginal distribution of inter - domain features.

[0101] The present invention accurately measures the difference in the marginal distribution of inter - domain features by mixing the first - order, second - order, and third - order statistical distances of inter - domain features, which can be formally expressed as:

[0102]

[0103] where, is a hyperparameter used to balance the distances of each order of statistics and can be determined by grid search in practical applications.

[0104] S8. Obtain the soft labels of the target domain, calculate the initial soft centroids of the target - domain features using the soft labels, and then use the k - means algorithm with cosine similarity as the distance metric to obtain the pseudo - labels of the target - domain features

[0105] To achieve inter - domain distribution adaptation during the training process of the transfer - learning model, only adapting the marginal distribution of inter - domain features cannot obtain the transfer - learning performance that meets the application requirements, because the inter - domain discriminative classification surfaces may not be the same. Existing research points out that minimizing the difference in inter - domain conditional distributions is indispensable. Since the features of the target domain are completely unlabeled, it is impossible to directly measure the inter - domain conditional distribution. Therefore, the present invention generates pseudo - labels for the target domain using the target - domain soft centroids through a clustering algorithm. First, input the target - domain features into the classifier of the transfer - learning model to obtain the predicted probability f(h t ) of the target - domain features in the classifier, that is, obtain the soft labels of the target domain. Then, in the target - domain features, the initial soft centroid of class k can be calculated by the following formula:

[0106]

[0107] where, δ k (·) represents the k - th element output by the Softmax function of the classifier. Compared with the strategy of directly assigning hard centroids to the target - domain features using the classifier, the soft centroid can more accurately describe the clustering characteristics of the target - domain features. Use the initial soft centroid of the target domain to obtain the pseudo - labels of the target - domain samples

[0108]

[0109] Among them, d(·, ·) represents a function for calculating the distance between vectors x and y. The present invention uses cosine similarity calculation, which can be expressed as:

[0110]

[0111] Based on the pseudo-labels of the above target domain samples, the k-means algorithm can be used again to update the target domain pseudo-labels. The process is as follows:

[0112]

[0113]

[0114] Among them, is an indicator function, which has a value of 1 when and 0 otherwise. The above process is repeated multiple times to obtain the final target domain pseudo-labels. In practice, even if only one update is performed, target domain pseudo-labels with sufficiently high quality can usually be obtained.

[0115] S9. Use the target domain pseudo-labels and the maximum mean discrepancy to calculate the first-order statistic distance of the conditional distribution difference of the inter-domain features It is expressed as:

[0116]

[0117] Among them, h s,c and h t,c respectively represent the samples with category c in h s and h t The number of their samples is and

[0118] S10. Use the target domain pseudo-labels and the correlation alignment method to calculate the second-order statistic distance of the conditional distribution difference of the inter-domain features It is expressed as:

[0119]

[0120] Among them, Cov c (·) represents the covariance matrix of the features with category c, and its calculation method is:

[0121]

[0122]

[0123] S11. Use the target domain pseudo-labels and the high-order moment matching method to calculate the third-order statistic distance of the conditional distribution difference of the inter-domain features Expressed as:

[0124]

[0125] S12. Combine the first-order statistic distance, second-order statistic distance, and third-order statistic distance with weights to obtain the mixed statistic distance (mixed metric) of the conditional distribution of inter-domain features.

[0126] Based on the above conditional distribution distance metric method, the present invention combines the first-order, second-order, and third-order statistical distances of the mixed conditional distribution of inter-domain features to accurately measure the difference in the conditional distribution of inter-domain features, which can be formally expressed as:

[0127]

[0128] where β k represents a hyperparameter used to balance the statistical distances of each order,

[0129] S13. Add the mixed statistic distance of the marginal distribution of inter-domain features obtained in S7 to the mixed statistic distance of the conditional distribution of inter-domain features obtained in S12 to obtain the inter-domain feature statistic distance.

[0130] The present invention simultaneously considers measuring the differences in the marginal distribution and conditional distribution of inter-domain features, and its complete form can be expressed as:

[0131] D mixup (h s , h t ) = D marginal (h s , h t ) + D conditional (h s , h t )

[0132] S14. Calculate the overall loss function of the transfer learning model according to the classification loss of the source domain data in S3 and the inter-domain feature statistic distance in S13, and update the parameters of the transfer learning model to obtain a new transfer learning model.

[0133] According to the classification loss of the source domain and the feature distribution metric method based on the mixed metric proposed by the present invention, the optimization objective of the transfer learning model can be expressed as:

[0134]

[0135] S15. Use the new transfer learning model to predict the test samples to obtain the predicted sample labels. To evaluate the performance of the present invention, quantitatively evaluate the classification accuracy of the predicted sample labels, which is defined as follows:

[0136]

[0137] Among them, is the true label of is the predicted label of the model for and is an indicator function, which has a value of 1 when and 0 otherwise.

Claims

1. A feature distribution measurement method based on a hybrid metric, characterized in that: It includes the following steps: S1. Obtain a certain number of pictures, divide the pictures into training samples and test samples, use the training samples as the source domain, and the test samples as the target domain; S2. Construct a transfer learning model, use the pictures in the source domain to train the transfer learning model, output the predicted probability of the object categories in the pictures, until the loss remains unchanged, and obtain the trained transfer learning model; S3. Calculate the classification loss of the source domain data according to the trained transfer learning model; S4. Use the maximum mean discrepancy to calculate the first-order statistic distance of the inter-domain feature marginal distribution difference; S5. Use the correlation alignment method to calculate the second-order statistic distance of the inter-domain feature marginal distribution difference; S6. Use the high-order moment matching method to calculate the third-order statistic distance of the inter-domain feature marginal distribution difference; S7. Combine the first-order statistic distance, the second-order statistic distance, and the third-order statistic distance with weights to obtain the mixed statistic distance of the inter-domain feature marginal distribution; S8. Obtain the soft labels of the target domain, calculate the initial soft centroids of the target domain features using the soft labels, and then use the k-means algorithm with cosine similarity as the distance metric to obtain the pseudo-labels of the target domain features S8. Use the target domain pseudo-label and the maximum mean discrepancy to calculate the first-order statistic distance of the conditional distribution difference of the inter-domain features; S9. Use the target domain pseudo-label and the correlation alignment method to calculate the second-order statistic distance of the conditional distribution difference of the inter-domain features; S10. Use the target domain pseudo-label and the high-order moment matching method to calculate the third-order statistic distance of the conditional distribution difference of the inter-domain features; S11. Combine the first-order statistic distance, the second-order statistic distance, and the third-order statistic distance with weights to obtain the mixed statistic distance of the inter-domain feature conditional distribution; S12. Add the mixed statistic distance of the inter-domain feature marginal distribution obtained in S7 to the mixed statistic distance of the inter-domain feature conditional distribution obtained in S11 to obtain the inter-domain feature statistic distance; S13. Calculate the overall loss function of the transfer learning model according to the classification loss of the source domain data in S3 and the inter-domain feature statistic distance in S12, and update the parameters of the transfer learning model to obtain a new transfer learning model; S14. Use the new transfer learning model to predict the test samples, and obtain the predicted probability of the corresponding categories of the test samples.

2. The method for measuring feature distribution based on hybrid metrics according to claim 1, wherein: The transfer learning model in S2 successively includes a feature extractor and a classifier. The feature extractor successively includes an input layer, a convolutional layer, a pooling layer, four residual convolutional modules, a bottleneck layer, and a feature normalization layer; the classifier successively includes two fully connected layers.

3. A feature distribution measurement method based on a hybrid metric according to claim 2, characterized in that: In S3, calculate the classification loss of the source domain data according to the trained transfer learning model. The specific process is as follows: Among them, represents the classification loss of the source domain data, J(·) represents the cross-entropy loss function, and n s represents the number of samples in the source domain, x s and y s respectively represent the source domain sample feature vector and the corresponding label, i = 1, 2, 3, …, n s .

4. A feature distribution measurement method based on a hybrid metric according to claim 3, wherein: In S7, combine the first-order statistic distance, the second-order statistic distance, and the third-order statistic distance with weights to obtain the mixed statistic distance of the inter-domain feature marginal distribution. The specific process is as follows: First-order statistic distance: Among them, the inter-domain feature is the source-domain feature h s and the target-domain feature h t between features; n s and n t denote the number of samples in h s and h t respectively, where j = 1, 2, 3, …, n t ; k(·, ·) is the Gaussian kernel function, so there is γ is the bandwidth parameter, and i′ and j′ represent the source-domain and target-domain sample indices respectively; Second-order statistic distance: Among them, represents the square of the matrix Frobenius norm, and d represents the dimension of h s and h t features, and the two have the same dimension. Cov(h s ) and Cov(h t ) represent the covariance matrices of h s and h t respectively; The third-order statistic distance is: Among them, represents the vector outer product, represents the third power, and its result is a third-order tensor; Mixed statistic distance of the inter-domain feature marginal distribution: Among them, α k is a hyperparameter used to balance the distances of various order statistics, 5. A feature distribution measurement method based on a hybrid metric according to claim 4, wherein: Obtain the soft labels of the target domain in S8, calculate the initial soft centroids of the target domain features using the soft labels, and then use the k-means algorithm with cosine similarity as the distance metric to obtain the pseudo-labels of the target domain features The specific process is as follows: Input the target domain features into the classifier of the transfer learning model to obtain the predicted probability of the output target domain features of the classifier for the target domain features, that is, obtain the target domain soft label. Then, in the target domain features, the initial soft centroid of category k can be calculated by the following formula: where, δ k (·) represents the k-th element output by the classifier Softmax function; Obtaining pseudo-labels of target domain samples using the initial soft centroids of the target domain where d(·,·) represents a function for calculating the distance between vectors x and y, calculated using cosine similarity, and can be expressed as: Based on the pseudo-labels of the above target domain samples, the k-means algorithm can be used again to update the target domain pseudo-labels. The process is as follows: Among them, is an indicator function, which has a value of 1 when and 0 otherwise; the above process is repeated multiple times to obtain the final pseudo-labels in the target domain.

6. The method for measuring the feature distribution based on the hybrid metric according to claim 5, wherein: In S12, the first-order statistic distance, second-order statistic distance, and third-order statistic distance are weighted and combined to obtain the mixed statistic distance of the conditional distribution of inter-domain features. The specific process is as follows: First-order statistic distance Among them, h s,c and h t,c respectively represent the samples of class c in h s and h t The number of such samples is and Second-order statistic distance Among them, Cov c (·) represents the covariance matrix of the features of class c; Third-order statistic distance Mixed statistic distance of the conditional distribution of inter-domain features Among them, β k represents a hyperparameter used to balance the distances of various order statistics, 7. A feature distribution measurement method based on a hybrid metric according to claim 6, wherein: In S13, the mixed statistic distance of the marginal distribution of inter-domain features obtained in S7 is added to the mixed statistic distance of the conditional distribution of inter-domain features obtained in S12 to obtain the inter-domain feature statistic distance. The specific process is as follows: D mixup (h s ,h t ) = D marginal (h s ,h t ) + D conditional (h s ,h t )。 8. A feature distribution measurement method based on a hybrid metric according to claim 7, wherein: In S14, the overall loss function of the transfer learning model is calculated according to the classification loss of the source domain data in S3 and the inter-domain feature statistic distance in S13. The specific process is as follows:

Citation Information

Patent Citations

  • Deep transfer learning intelligent fault diagnosis method and device, storage medium and equipment

    CN111898095A

  • Picture classification method under extremely small number of training samples based on nonlinearity adaptive subdomain field adaptation

    CN113420775A