Passive field adaptive image recognition method based on transferable semantic knowledge
By constructing a network model based on transferable semantic knowledge in passive domain adaptive image recognition, and using confidence sample selection and multi-granularity contrastive learning strategies, the problem of lack of guidance in target domain alignment is solved, and the image classification accuracy and recognition ability are improved. .
Patent Information
- Application Number
- CN202410750577.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-10
AI Technical Summary
In passive domain adaptive image recognition, due to the lack of source domain samples and the lack of guidance for target domain alignment, existing methods fail to make full use of the semantic knowledge of the source domain model, resulting in insufficient model recognition capabilities and the influence of pseudo label noise, which in turn affects clustering. class structure.
By constructing a passive domain adaptive network model based on transferable semantic knowledge, using confidence sample selection strategy and multi-granularity contrastive learning strategy, semantic knowledge is learned from the source domain model to guide target domain training, and self-supervised contrastive learning is introduced to improve Model recognition ability.
It effectively aligns the semantic structures of the source domain and the target domain, improves the accuracy of image classification in the target domain, enhances the recognition ability of the model, and improves the clustering structure through weighted category association through multi-granularity contrast loss.
Smart Images

Figure CN118628813A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer vision transfer learning domain adaptation image recognition, and specifically is a passive domain adaptive image recognition method based on transferable semantic knowledge. Background Art
[0002] In recent years, with the development of deep convolutional neural networks (CNNs), many computer vision models based on rich labeled data have achieved significant performance improvements. However, the performance of these models is often affected by the distribution differences between different datasets. For example, sketches usually lack detailed color information, while real-world photos show rich colors. Due to the domain bias, the network trained on sketches performs poorly when processing real photos. To alleviate the domain bias problem, an effective way is to obtain a large amount of annotated data in the new domain. However, this method is usually not feasible due to the high cost. Therefore, it is particularly important to reduce the domain gap during the training stage. In recent years, domain adaptation (DA) has become the main method to solve the domain gap problem, and its goal is to transfer the labeled source domain knowledge to the unlabeled target domain. However, since some data needs to be hidden and stored due to its particularity, data security has become a hot topic. In the process of domain adaptation, it is necessary to access the source domain samples, which may violate the relative data privacy policy. Therefore, passive domain adaptation (SFDA) has been widely studied. Researchers cannot obtain source domain samples, but can obtain the source domain model trained by the source domain samples to adapt to the target domain, so as to recognize the target domain samples.
[0003] In the passive domain adaptation process, due to the lack of source domain samples, the alignment of the target domain lacks guidance. Some previous methods only focus on the category structure of the target domain itself and cluster the target domain, without fully utilizing the source domain model trained by the source domain samples to guide the target domain. Since the source domain model has learned the semantic structure in the source domain, the source domain model can be further explored to learn transferable semantic knowledge to assist the training of target domain samples. In addition, in the early stage of training, due to the insufficient recognition ability of the model for the target domain samples, some noisy pseudo-labels may be generated, thus affecting the clustering structure. Previous methods selected all the target domain pseudo-labels to assist model training, which would cause the model to generate negative transfer on the target domain. At present, most methods have not explored how to select the correct pseudo-labels based on the model recognition ability. Summary of the invention
[0004] The present invention aims to address the deficiencies of the above-mentioned prior art and proposes a passive domain adaptive image recognition method based on transferable semantic knowledge, in order to efficiently learn transferable semantic knowledge from the source model to guide the target domain training by selecting target domain confident pseudo-labels from easy to difficult, thereby improving the accuracy of target domain image classification.
[0005] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme:
[0006] The passive domain adaptive image recognition method based on transferable semantic knowledge of the present invention is characterized in that it comprises the following steps:
[0007] Step 1: Define the domain adaptive image dataset as D = {D s ,D t}, D s Denotes the source domain image set with category labels, D t represents the target domain image set without category labels, where x s Represents any labeled source domain image in the source domain image set, let y s Represents x s The category label, y s ∈{1,2,...,K}; K represents the total number of categories; (x s ,y s )∈D s , let n s represents the total number of source domain images; let represents the i-th target domain image without labels, Let n t Represents the total number of target domain images; and the source domain and target domain belong to the same label space; i∈n t ;
[0008] Step 2: Construct a passive domain adaptation network model based on transferable semantic knowledge, including: feature extraction network E, source domain specific classifier C s , target domain specific classifier C t ;
[0009] The source domain image x s Input into the feature extraction network E for processing, and obtain the source domain feature f accordingly s ;
[0010] The source domain feature f s Input the source domain specific classifier C s In the process, the source domain image x is obtained s The output category probability prediction distribution p(y' s |C s (E(xs ))); where y' s Represents x s The predicted class label of
[0011] Step 3: Use formula (1) to establish the source domain specific classifier C s The cross entropy loss function L ce , and use stochastic gradient descent to derive the feature extraction network E and the source domain specific classifier C s Pre-training is performed until L ce Until convergence, the pre-trained feature extraction network E' and the source domain specific classifier C' are obtained. s And fix the pre-trained network weights;
[0012]
[0013] Step 4: Construct a training strategy for the passive domain adaptation network model based on transferable semantic knowledge, including: a confident sample selection strategy and a multi-granularity contrastive learning strategy;
[0014] Step 4.1: The i-th target domain image Input the pre-trained feature extraction network E' and source domain specific classifier C' s In order to construct the target domain specific classifier C corresponding to the confident sample selection strategy t The cross entropy loss function
[0015] Step 4.2: Construct the multi-granularity contrastive learning loss L corresponding to the multi-granularity contrastive learning strategy MsNCE ;
[0016] Step 5: Self-supervised contrastive learning:
[0017] Step 5.1: Use two enhancement methods to Perform enhancement processing to obtain the i-th enhanced first target domain image and the second target domain image And then sent to the pre-trained feature extraction network E' and the target domain specific classifier C t is processed and the corresponding The class probability prediction distribution of and The class probability prediction distribution of
[0018] Step 5.2: Use formula (12) to establish the self-supervised contrast loss L ssl :
[0019]
[0020] In formula (11), p” j Represents the jth unlabeled target domain image The second target domain image after enhancement After the pre-trained feature extraction network E' and the target domain specific classifier C t The predicted distribution of class probabilities after ;
[0021] Step 6: Model training:
[0022] Step 6.1: Use formula (13) to construct the overall loss function L overall :
[0023]
[0024] In formula (13), λ1 and λ2 are two weight parameters;
[0025] Step 6.2: Target domain image dataset D based on passive domain adaptation t , using stochastic gradient descent to train the pre-trained feature extraction network E' and the source domain specific classifier C' s and the target domain specific classifier C t Train until the overall loss function L overall Until convergence, the optimal passive domain adaptive network model is obtained to realize the classification of target domain images.
[0026] The passive domain adaptive image recognition method based on transferable semantic knowledge described in the present invention is also characterized in that:
[0027] The feature extraction network E is based on the ResNet-50 structure, which is composed of an input convolution layer, a maximum pooling layer, M downsampling convolution layers, Q residual convolution blocks, and an average pooling layer in sequence; and each convolution layer is connected to a batch normalization layer and a ReLU activation function;
[0028] The source domain specific classifier C s and the target domain specific classifier C t It is composed of H layers of fully connected networks, and the first layer of fully connected networks is followed by a batch normalization layer and a ReLU activation function.
[0029] The convolutional layers and fully connected layers in the transferable semantic knowledge domain adaptive network model are initialized with Xavier initialization.
[0030] The step 4.1 comprises:
[0031] Step 4.1.1: The i-th target domain image Input the pre-trained feature extraction network E' for processing, and obtain the corresponding target domain feature f t i ;
[0032] Using formula (2), we can get the target domain image set D t The initial prototype of the kth category
[0033]
[0034] In formula (2), δ k Represents the operation of taking the kth element in the softmax maximum output of the K-dimensional vector;
[0035] Step 4.1.2: Calculate using formula (3) and The distance between i,k , thus obtaining Minimum distance from the initial prototype
[0036]
[0037] Step 4.1.3: Set prototype pseudo-label threshold if Then The prototype pseudo label of for The corresponding category; otherwise, let Empty; mean means the mean operation, std means the variance operation;
[0038] Step 4.1.4: Set f t i Input the pre-trained source domain specific classifier C' s Processed in The class probability prediction distribution of Thus we get exist The maximum probability
[0039] Step 4.1.5: Set the probability pseudo-label threshold if Then The probability pseudo label of for The corresponding category; otherwise, let is empty;
[0040] like Then Pseudo labels and will and its pseudo labels Add confidence sample set Otherwise, do not add D R middle;
[0041] Step 4.1.6: Based on the confidence sample set D R , use formula (4) to calculate the target domain image set D t The base prototype c of the kth category k ;
[0042]
[0043] In formula (4), represents the indicator function; when hour, is 1, otherwise, is 0;
[0044] Step 4.1.7: The target domain feature f t i Input the target domain specific classifier C t is processed and obtained The output class probability prediction distribution Among them, y' t express The predicted class label of
[0045] Step 4.1.8: Use equation (6) to establish the target domain specific classifier C t The cross entropy loss function
[0046]
[0047] In formula (6), n r Denotes the confidence sample set D R The total number of target domain images in .
[0048] The step 4.2 comprises:
[0049] Step 4.2.1: Let the pre-trained source domain specific classifier C' s The weight is W s , the target domain specific classifier C t The weight is W t , and then use formula (7) to calculate the element r in the kth row and k'th column of the category association matrix R k,k' :
[0050]
[0051] In formula (7), W s The weights of the kth row and the k'th row in ; W t The weights of the kth row and the k'th row in ;
[0052] Step 4.2.2: Use formula (8) to construct a multi-granularity contrast loss for the target domain prototype
[0053]
[0054] In formula (8), is the equilibrium parameter; c k' Denotes the target domain image set D t The prototype of the k'th category; sim represents the cosine similarity calculation operation;
[0055] Step 4.2.3: Use equation (9) to construct a multi-granularity contrast loss for the source classifier weights
[0056]
[0057] Step 4.2.4: Use formula (10) to construct the first term of multi-granularity contrastive learning loss
[0058]
[0059] Step 4.2.5: Use equation (11) to establish the second term of the multi-granularity contrast loss
[0060]
[0061] Step 4.2.6: Use formula (12) to construct the multi-granularity contrastive learning loss L MsNCE :
[0062]
[0063] The electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the passive field adaptive image recognition method, and the processor is configured to execute the program stored in the memory.
[0064] The present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program executes the steps of the passive domain adaptive image recognition method when the computer program is executed by a processor.
[0065] Compared with the prior art, the present invention has the following beneficial effects:
[0066] 1. In order to solve the problem of lack of guidance in target domain alignment due to lack of source domain samples in passive scenarios, the present invention explores the use of source domain model classifier weights to characterize domain-invariant semantic structures. The transferable semantic knowledge from the model is introduced into the target domain training to assist model learning. Then, the target domain pseudo-labels are selected from easy to difficult, so that the model can effectively align the source domain and target domain semantic structures, thereby improving the model's recognition ability in the target domain.
[0067] 2. The present invention introduces multi-granularity contrast loss to learn the semantic structure of the target domain from different perspectives, and constructs a category association matrix to represent the similarity association between categories, and weights the loss. The source category representation is aligned with the target domain prototype at a coarse granularity, and the internal clustering structure of the target domain is learned at a fine granularity, thereby improving the model's ability to distinguish target domain images. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 is a training flow chart of the method of the present invention;
[0069] Figure 2 This is the overall model diagram of the present invention. DETAILED DESCRIPTION
[0070] In this embodiment, Figure 1 As shown in FIG, a passive domain adaptive image recognition method based on transferable semantic knowledge is performed in the following steps:
[0071] Step 1: Define the domain adaptive image dataset as D = {D s ,D t}, D s Denotes the source domain image set with category labels, D t represents the target domain image set without category labels, where x s Represents any labeled source domain image in the source domain image set, let y s Represents x s The category label, y s ∈{1,2,...,K}; K represents the total number of categories; (x s ,y s )∈D s , let n s represents the total number of source domain images; let represents the i-th target domain image without labels, Let n t Represents the total number of target domain images; and the source domain and target domain belong to the same label space; i∈n tIn this embodiment, all the normalized training images are randomly cropped to a pixel size of 224×224, and the test images are center cropped to a pixel size of 224×224.
[0072] In this embodiment, the present invention evaluates the method on three public datasets, namely Office-31, OfficeHome, and VisDA-2017;
[0073] Office-31 is a commonly used benchmark dataset, which is widely used in domain adaptation (DA) tasks. It contains a total of 4110 images, divided into 31 categories, covering three different domains: Amazon (A), DSLR (D), and Webcam (W). In this dataset, there are 6 different combinations of migration tasks, with one domain as the source domain and the other as the target domain.
[0074] The Office-Home dataset consists of 15,500 images distributed across four domains, each containing 65 different categories; the four domains are art, clipart, products, and real world, with a total of 12 transfer tasks;
[0075] VisDA-2017 is a large-scale domain adaptation benchmark dataset, which includes synthetic image domain and real image domain, with a total of 12 categories; the synthetic image domain contains 152,409 images, while the real image domain contains 55,400 images; during the evaluation, the present invention uses synthetic images as the source domain and real images as the target domain to train the model;
[0076] Step 2: If Figure 2 As shown in Figure 2, a passive domain adaptation network model based on transferable semantic knowledge is constructed, including: feature extraction network E, source domain specific classifier C s , target domain specific classifier C t ;
[0077] In this embodiment, the feature extraction network E is based on the ResNet-50 structure, and is composed of an input convolution layer, a maximum pooling layer, M downsampling convolution layers, Q residual convolution blocks, and an average pooling layer in sequence; and each convolution layer is connected to a batch normalization layer and a ReLU activation function; the output feature dimension of the feature extraction network E is 256, and the image is input into the feature extraction network E to output the features used for training;
[0078] Source domain specific classifier C s and the target domain specific classifier C tIt is composed of H layers of fully connected networks, and the first layer of fully connected networks is connected to a batch normalization layer and a ReLU activation function; in order to match the classification task, the output dimension of the last fully connected layer is specific to the total number of categories in the dataset;
[0079] The convolutional layers and fully connected layers in the domain adaptation network model with transferable semantic knowledge are initialized with Xavier initialization.
[0080] Source domain image x s Input into the feature extraction network E for processing, and obtain the source domain feature f accordingly s ; The feature dimension is 256;
[0081] The source domain feature f s Input source domain specific classifier C s In the process, the source domain image x is obtained s The output category probability prediction distribution p(y' s |C s (E(x s ))); where y' s Represents x s The predicted class label of .
[0082] Step 3: Use formula (1) to build a source domain specific classifier C s The cross entropy loss function L ce , and use stochastic gradient descent to train the feature extraction network E and the source domain specific classifier C s Pre-training is performed until L ce Until convergence, the pre-trained feature extraction network E' and the source domain specific classifier C' are obtained. s And fix the network weights after pre-training; pre-train the source domain model. After the pre-training is completed, the source domain image set will no longer be used. Only the target domain image set without category labels will be trained based on the trained source domain model;
[0083]
[0084] Step 4: Construct a training strategy for the passive domain adaptation network model based on transferable semantic knowledge, including: a confident sample selection strategy and a multi-granularity contrastive learning strategy;
[0085] Step 4.1: Construct a confident sample selection strategy:
[0086] Step 4.1.1: i-th target domain image Input the pre-trained feature extraction network E' for processing and obtain the corresponding target domain feature f t i ;
[0087] Using formula (2), we can get the target domain image set D t The initial prototype of the kth category
[0088]
[0089] In formula (2), δ k It represents the operation of taking the kth element in the softmax maximum output of the K-dimensional vector; the category prototype can robustly and reliably characterize the average feature distribution of all image features in different categories in the target domain image set.
[0090] Step 4.1.2: Calculate using formula (3) and The distance between i,k , thus obtaining Minimum distance from the initial prototype If a target domain image is closest to a certain category prototype, it can be considered that the image also belongs to this category with a high probability;
[0091]
[0092] Step 4.1.3: Set prototype pseudo-label threshold if Then The prototype pseudo label of for The corresponding category; otherwise, let Empty; mean means the mean operation, and std means the variance operation.
[0093] Step 4.1.4: Set f t i Input the pre-trained source domain specific classifier C' s Processed in The class probability prediction distribution of Thus we get exist The maximum probability
[0094] Step 4.1.5: Set the probability pseudo-label threshold if Then The probability pseudo label of for The corresponding category; otherwise, let is empty;
[0095] like Then Pseudo labels and will and its pseudo labels Add confidence sample set Otherwise, do not add D R When target domain images with accurate pseudo labels are selected, they can better assist model training and improve the model's recognition ability in the target domain.
[0096] Step 4.1.6: Based on the confidence sample set D R , use formula (4) to calculate the target domain image set D t The base prototype c of the kth category k :
[0097]
[0098] In formula (4), represents the indicator function; when hour, is 1, otherwise, is 0; the basic prototype is further calculated by extracting the target domain image from the confidence sample set, which is more accurate than the initial prototype.
[0099] Step 4.1.7: Transform the target domain features f t i Input target domain specific classifier C t is processed and obtained The output class probability prediction distribution Among them, y' t express The predicted class label of
[0100] Step 4.1.8: Use equation (6) to build a target domain specific classifier C t The cross entropy loss function
[0101]
[0102] In formula (6), n r Denotes the confidence sample set D R The total number of target domain images in ; the weight of the target domain specific classifier trained by the target domain confident sample set represents the category representation of the target domain sample set to a certain extent.
[0103] Step 4.2: Multi-granularity contrast learning strategy:
[0104] Step 4.2.1: Let the pre-trained source domain specific classifier C' s The weight is W s , target domain specific classifier C t The weight is W t, and then use formula (7) to calculate the element r in the kth row and k'th column of the category association matrix R k,k' :
[0105]
[0106] In formula (7), W s The weights of the kth row and the k'th row in ; W t The weights of the kth and k'th rows in ; the weights of the classifier can describe the category representation, which is a cross-domain domain-invariant representation; by calculating the similarity between category weight pairs, the association between categories can be revealed; the elements on the diagonal represent the similarity within the same category, which is usually close to 1; the higher the similarity, the larger the corresponding value in the category association matrix; vice versa; the model expects to learn the differences between category pairs with larger values, thereby improving the model's discrimination ability.
[0107] Step 4.2.2: Use formula (8) to construct a multi-granularity contrast loss for the target domain prototype
[0108]
[0109] In formula (8), is the equilibrium parameter; c k' Denotes the target domain image set D t The prototype of the k'th category; sim represents the cosine similarity calculation operation; the source classifier weight can describe the source domain category representation, and the model uses the source category representation and the target domain prototype to achieve coarse-grained class structure alignment; the model constructs a loss function to constrain the source category representation and the target domain prototype of the same category to be close to each other, and different categories to be far away from each other; and introduces the category association matrix as a weight in the loss function, so that similar category pairs with larger values are separated more.
[0110] Step 4.2.3: Similarly, use formula (9) to construct a multi-granularity contrast loss for the source classifier weights
[0111]
[0112] Step 4.2.4: Use formula (10) to construct the first term of multi-granularity contrastive learning loss
[0113]
[0114] Step 4.2.5: Use equation (11) to establish the second term of the multi-granularity contrast loss
[0115]
[0116] The model constructs a loss between the confident sample set and the target domain prototype to achieve fine-grained clustering features of the samples, so that the model can learn a better clustering structure; constrains the confident samples to be close to the target domain prototype of the category corresponding to their pseudo-labels, and keeps them far away from all other prototypes; and introduces the category association matrix as a weight in the loss function.
[0117] Step 4.2.6: Use formula (12) to construct the multi-granularity contrastive learning loss L MsNCE :
[0118]
[0119] Step 5: Self-supervised contrastive learning:
[0120] Step 5.1: Use two enhancement methods to Perform enhancement processing to obtain the i-th enhanced first target domain image and the second target domain image And then fed into the pre-trained feature extraction network E' and the target domain specific classifier C t is processed and the corresponding The class probability prediction distribution of and The class probability prediction distribution of
[0121] Step 5.2: Introducing self-supervised contrast loss into the model helps the model learn individual discriminative features; the self-supervised contrast loss uses two enhanced versions of the same sample as positive sample pairs and the enhanced versions of all other samples as negative sample pairs; the self-supervised contrast loss L is established using formula (12): ssl :
[0122]
[0123] In formula (11), p” j Represents the jth unlabeled target domain image The second target domain image after enhancement The pre-trained feature extraction network E' and the target domain specific classifier C t The predicted distribution of class probabilities after .
[0124] Step 6: Model training:
[0125] Step 6.1: Use formula (13) to construct the overall loss function L overall :
[0126]
[0127] In formula (13), λ1 and λ2 are two weight parameters, which are set to 0.7 and 0.1 respectively;
[0128] Step 6.2: Target domain image dataset D based on passive domain adaptation t , use stochastic gradient descent to train the pre-trained feature extraction network E' and the source domain specific classifier C' s and the target domain specific classifier C t Train until the overall loss function L overall Until convergence, the optimal passive domain adaptive network model is obtained to realize the classification of target domain images.
[0129] In this embodiment, an electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the above method, and the processor is configured to execute the program stored in the memory.
[0130] In this embodiment, a computer-readable storage medium stores a computer program on the computer-readable storage medium, and the computer program executes the steps of the above method when executed by a processor.
Claims
1. A passive domain adaptive image recognition method based on transferable semantic knowledge, characterized in that: The following steps are involved: Step 1: Define the domain adaptive image dataset as D = {D s ,D t }, D s Denotes the source domain image set with category labels, D t represents the target domain image set without category labels, where x s Represents any labeled source domain image in the source domain image set, let y s Represents x s The category label, y s ∈{1,2,...,K}; K represents the total number of categories; (x s ,y s )∈D s , let n s represents the total number of source domain images; let represents the i-th target domain image without labels, Let n t Represents the total number of target domain images; and the source domain and target domain belong to the same label space; i∈n t ; Step 2: Construct a passive domain adaptation network model based on transferable semantic knowledge, including: feature extraction network E, source domain specific classifier C s , target domain specific classifier C t ; The source domain image x s Input into the feature extraction network E for processing, and obtain the source domain feature f accordingly s ; The source domain feature f s Input the source domain specific classifier C s In the process, the source domain image x is obtained s The output category probability prediction distribution p(y' s |C s (E(x s ))); where y' s Represents x s The predicted class label of Step 3: Use formula (1) to establish the source domain specific classifier C s The cross entropy loss function L ce , and use stochastic gradient descent to derive the feature extraction network E and the source domain specific classifier C s Pre-training is performed until L ce Until convergence, the pre-trained feature extraction network E' and the source domain specific classifier C' are obtained. s And fix the pre-trained network weights; Step 4: Construct a training strategy for the passive domain adaptation network model based on transferable semantic knowledge, including: a confident sample selection strategy and a multi-granularity contrastive learning strategy; Step 4.1: The i-th target domain image Input the pre-trained feature extraction network E' and source domain specific classifier C' s In order to construct the target domain specific classifier C corresponding to the confident sample selection strategy t The cross entropy loss function Step 4.2: Construct the multi-granularity contrastive learning loss L corresponding to the multi-granularity contrastive learning strategy MsNCE ; Step 5: Self-supervised contrastive learning: Step 5.1: Use two enhancement methods to Perform enhancement processing to obtain the i-th enhanced first target domain image and the second target domain image And then sent to the pre-trained feature extraction network E' and the target domain specific classifier C t is processed and the corresponding The class probability prediction distribution of and The class probability prediction distribution of Step 5.2: Use formula (12) to establish the self-supervised contrast loss L ssl : In formula (11), p” j Represents the jth unlabeled target domain image The second target domain image after enhancement After the pre-trained feature extraction network E' and the target domain specific classifier C t The predicted distribution of class probabilities after ; Step 6: Model training: Step 6.1: Use formula (13) to construct the overall loss function L overall : In formula (13), λ1 and λ2 are two weight parameters; Step 6.2: Target domain image dataset D based on passive domain adaptation t , using stochastic gradient descent to train the pre-trained feature extraction network E' and the source domain specific classifier C' s and the target domain specific classifier C t Train until the overall loss function L overall Until convergence, the optimal passive domain adaptive network model is obtained to realize the classification of target domain images.
2. The passive domain adaptive image recognition method based on transferable semantic knowledge according to claim 1, characterized in that: The feature extraction network E is based on the ResNet-50 structure, which is composed of an input convolution layer, a maximum pooling layer, M downsampling convolution layers, Q residual convolution blocks, and an average pooling layer in sequence; and each convolution layer is connected to a batch normalization layer and a ReLU activation function; The source domain specific classifier C s and the target domain specific classifier C t It is composed of H layers of fully connected networks, and the first layer of fully connected networks is followed by a batch normalization layer and a ReLU activation function. The convolutional layers and fully connected layers in the transferable semantic knowledge domain adaptive network model are initialized with Xavier initialization.
3. The passive domain adaptive image recognition method based on transferable semantic knowledge according to claim 1, characterized in that: The step 4.1 comprises: Step 4.1.1: The i-th target domain image Input the pre-trained feature extraction network E' for processing, and obtain the corresponding target domain feature f t i ; Using formula (2), we can get the target domain image set D t The initial prototype of the kth category In formula (2), δ k Represents the operation of taking the kth element in the softmax maximum output of the K-dimensional vector; Step 4.1.2: Calculate using formula (3) and The distance between i,k , thus obtaining Minimum distance from initial prototype Step 4.1.3: Set prototype pseudo-label threshold if Then The prototype pseudo label of for The corresponding category; otherwise, let Empty; mena means the mean operation, std means the variance operation; Step 4.1.4: Set f t i Input the pre-trained source domain specific classifier C' s Processed in The class probability prediction distribution of Thus we get exist The maximum probability Step 4.1.5: Set the probability pseudo-label threshold if Then The probability pseudo label of for The corresponding category; otherwise, let is empty; like Then Pseudo-labels and will and its pseudo labels Add confidence sample set Otherwise, do not add D R middle; Step 4.1.6: Based on the confidence sample set D R , use formula (4) to calculate the target domain image set D t The base prototype c of the kth category k ; In formula (4), represents the indicator function; when hour, is 1, otherwise, Step 4.1.7: The target domain feature f t i Input the target domain specific classifier C t is processed and obtained The output class probability prediction distribution Among them, y' t express The predicted class label of Step 4.1.8: Use equation (6) to establish the target domain specific classifier C t The cross entropy loss function In formula (6), n r Denotes the confidence sample set D R The total number of target domain images in .
4. The passive domain adaptive image recognition method based on transferable semantic knowledge according to claim 3 is characterized in that: The step 4.2 comprises: Step 4.2.1: Let the pre-trained source domain specific classifier C' s The weight is W s , the target domain specific classifier C t The weight is W t , and then use formula (7) to calculate the element r in the kth row and k'th column of the category association matrix R k,k' : In formula (7), W s The weights of the kth row and the k'th row in ; W t The weights of the kth row and the k'th row in ; Step 4.2.2: Use formula (8) to construct a multi-granularity contrast loss for the target domain prototype In formula (8), is the equilibrium parameter; c k' Denotes the target domain image set D t The prototype of the k'th category; sim represents the cosine similarity calculation operation; Step 4.2.3: Use equation (9) to construct a multi-granularity contrast loss for the source classifier weights Step 4.2.4: Use formula (10) to construct the first term of multi-granularity contrastive learning loss Step 4.2.5: Use equation (11) to establish the second term of the multi-granularity contrast loss Step 4.2.6: Use formula (12) to construct the multi-granularity contrastive learning loss L MsNCE :
5. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the passive domain adaptive image recognition method according to any one of claims 1 to 4, and the processor is configured to execute the program stored in the memory.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the passive domain adaptive image recognition method according to any one of claims 1 to 4 are executed.
Citation Information
Cited By
Multi-source-domain human body posture recognition migration model construction method and device
CN119005295A
A method and device for constructing a multi-source domain human posture recognition migration model
CN119005295B
Image quality evaluation system and method based on domain self-adaption
CN119648639A
Self-training-based passive domain adaptive remote sensing image scene classification method and system
CN119785117A
Passive field adaptive target identification method
CN120495769A
