A domain adaptation retrieval method, device, equipment and medium

By generating class-specific subspaces and target domain projections in image retrieval and combining them with discriminative hash code learning, the problem of sample classification difficulties in cross-domain adaptation is solved, achieving better domain-adaptive retrieval results and accuracy.

CN116662597BActive Publication Date: 2025-11-25GUANGDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310782859.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2025-11-25
Estimated Expiration
2043-06-28

AI Technical Summary

Technical Problem

In existing technologies, image retrieval methods are prone to failing to effectively classify target domain samples during cross-domain adaptation, and the lack of labels leads to unsatisfactory retrieval results.

Method used

By acquiring an image dataset, feature extraction is performed to generate feature vectors for the source and target domains. Class-specific learning is then conducted using a preset initial subspace. The number of iterations is counted in real time. Discriminative hash code learning is performed, and the hash code and projection matrix are output. The objective function loss value is calculated until the number of iterations reaches a preset number or the loss value converges. The target subspace and projection matrix are then determined, and domain-adaptive retrieval is performed.

Benefits of technology

It effectively learns similar samples into the same subspace, enhancing classification advantages, mitigating negative transfer problems, and improving the performance of domain-adaptive retrieval. Furthermore, it dynamically selects target domain samples through a selective pseudo-label strategy, improving the reliability of pseudo-labels and enhancing retrieval accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116662597B_ABST
    Figure CN116662597B_ABST
Patent Text Reader

Abstract

The application discloses a domain adaptation retrieval method and device, equipment and medium, including acquiring image data set, performing feature extraction on the image data set, determining a source domain vector and a target domain vector; inputting the source domain vector and the target domain vector into a preset initial subspace for learning, generating a source domain projection and a target domain projection, and statistically counting an iteration number in real time; performing hash code learning on the source domain projection and the target domain projection, outputting a hash code and a projection matrix, and combining the source domain vector, the target domain vector, the preset initial subspace, the source domain projection and the target domain projection to calculate a target function loss value; if the iteration number reaches a preset number or the target function loss value converges, a target subspace and a target projection matrix are determined; and the target domain query sample is retrieved by using the target subspace and the target projection matrix, and a domain adaptation retrieval result is output. The technical problem that the effect of domain adaptation retrieval is not ideal due to the distribution of unknown category target domain samples in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image retrieval, and in particular to a domain adaptation retrieval method, device, equipment and medium. BACKGROUND

[0002] In recent years, with the development of the Internet and the popularity of social media, the scale of digital image data shows an explosive growth, and the demand for image retrieval has also increased significantly, for example, in the online shopping scenario, users upload pictures of goods they are interested in, and query the corresponding goods from the platform by matching with the pictures in the retrieval database.

[0003] Due to the difference in image acquisition sources, the retrieval performance improvement encounters more realistic challenges-the images in the query are often from different domains than the images in the retrieval pool, that is, due to the influence of light, angle, background, etc., there is a significant difference in the data distribution of the images, which is called domain shift. At the present stage, domain adaptation retrieval can alleviate the domain shift between different domains and improve the retrieval performance.

[0004] In the existing domain adaptation retrieval method, most of them reduce the domain difference to alleviate the adverse effects caused by the domain interval, and at the same time, when solving the cross-domain problem, all samples learn a domain-common class subspace under the supervision of a similarity matrix constructed by labels, but this easily makes the target domain samples of the same class that are not near the source domain samples in the subspace cannot be well classified, and due to the lack of labels in the target domain samples, it is easy to distribute the target domain samples of unknown classes, resulting in unsatisfactory domain adaptation retrieval effect. SUMMARY

[0005] The present application provides a domain adaptation retrieval method, device, equipment and medium, which solves the technical problem that in the prior art, the target domain samples of the same class that are not near the source domain samples in the subspace cannot be well classified, and due to the lack of labels in the target domain samples, it is easy to distribute the target domain samples of unknown classes, resulting in unsatisfactory domain adaptation retrieval effect.

[0006] The first aspect of the present application provides a domain adaptation retrieval method, comprising:

[0007] Obtaining an image data set, performing feature extraction on the image data set, and determining a first feature vector set, the first feature vector set comprising a plurality of source domain vectors and a plurality of target domain vectors;

[0008] Inputting the source domain vectors and the target domain vectors into a preset initial subspace for class-specific learning, generating source domain projections and target domain projections, and real-time counting the number of iterations;

[0009] learning discriminative hash codes for the source domain projection and the target domain projection, outputting hash codes and a projection matrix, and combining the source domain vector, the target domain vector, the preset initial subspace, the source domain projection and the target domain projection to calculate a target function loss value;

[0010] When the number of iterations reaches a preset number or the target function loss value converges, a target subspace and a target projection matrix are determined;

[0011] The target domain query sample is queried and retrieved using the target subspace and the target projection matrix, and a domain adaptive retrieval result is output.

[0012] Optionally, the hash codes include source domain hash codes and target domain hash codes; the step of learning discriminative hash codes for the source domain projection and the target domain projection, outputting hash codes and a projection matrix, and combining the source domain vector, the target domain vector, the preset initial subspace, the source domain projection and the target domain projection to calculate a target function loss value includes:

[0013] Based on the plurality of source domain projections corresponding to all the source domain vectors, the plurality of target domain projections corresponding to all the target domain vectors and all the source domain vectors, a plurality of target pseudo labels corresponding to all the target domain vectors are determined;

[0014] The target function loss value is calculated using a target pseudo label matrix associated with all the target pseudo labels, a source domain label matrix associated with the source domain vectors, the source domain hash codes, the target domain hash codes, the projection matrix, the source domain vector, the target domain vector, the preset initial subspace, the source domain projection and the target domain projection;

[0015] The target function corresponding to the target function loss value is:

[0016]

[0017]

[0018] In the formula, is a target function loss value; K is the number of categories; n s is the number of samples in the source domain vector set s; n t is the number of samples in the target domain vector set t; Y ik is a source domain label matrix; is the i-th source domain vector in the source domain vector set s; U k is the preset initial subspace of the k-th category; is the i-th source domain projection of the k-th category in the source domain vector set s; W jk is a target pseudo label matrix; is the jth target domain vector in the target domain vector set t; is the jth target domain projection of the kth category in the target domain vector set t; λ is a penalty factor; Z k is the set of source domain projections and target domain projections of the kth category; is the source domain hash code of the kth category in the source domain vector set s; P k is the projection matrix of the kth category; is the source domain projection matrix of the kth category in the source domain vector set s; is the target domain hash code of the kth category in the target domain vector set t; is the target domain projection matrix of the kth category in the target domain vector set t; is the orthogonal constraint; I is the identity matrix; is the transpose of U k is the transpose of U s is the source domain hash code matrix; B t is the target domain hash code matrix; is the Frobenius norm.

[0019] Optionally, the step of determining the plurality of target pseudo labels corresponding to all the target domain vectors based on the plurality of source domain projections corresponding to all the source domain vectors, the plurality of target domain projections corresponding to all the target domain vectors, and all the source domain vectors comprises:

[0020] determining a plurality of source domain category cluster centers and a plurality of first probabilities corresponding to all the target domain vectors by performing operations on the plurality of source domain projections, the plurality of target domain projections, and a plurality of source domain labels corresponding to all the source domain vectors according to a preset first formula;

[0021] outputting a plurality of initial target domain cluster centers based on the plurality of target domain projections and the plurality of source domain labels;

[0022] generating a plurality of target domain cluster centers by performing distance matching on the plurality of source domain category cluster centers and the plurality of initial target domain cluster centers according to a preset matching matrix condition;

[0023] outputting a plurality of second probabilities corresponding to all the target domain vectors by performing operations on the plurality of target domain cluster centers and the plurality of target domain projections according to a preset second formula;

[0024] determining a plurality of target probabilities and a plurality of target pseudo labels corresponding to all the target domain vectors by performing operations on the plurality of first probabilities and the plurality of second probabilities according to a preset third formula;

[0025] The preset third formula is specifically:

[0026]

[0027] wherein p(y k |x t ) is a target probability; p1(y k |x t ) is a first probability; p2(y k |x t ) is a second probability; is a target pseudo label; y k is a label of a source domain sample of a kth category; K is a category number; x t is a target domain vector in a target domain vector set t.

[0028] Optionally, the step of performing query retrieval on a target domain query sample by using the target subspace and the target projection matrix and outputting a domain adaptive retrieval result comprises:

[0029] determining a query hash code based on the target subspace, the target projection matrix and the target domain query sample;

[0030] constructing a retrieval pool by using all hash codes associated with the target projection matrix;

[0031] calculating a Hamming distance between the query hash code and the retrieval pool and outputting a domain adaptive retrieval result;

[0032] a calculation formula of the query hash code is:

[0033]

[0034] wherein y is the query hash code; is the target projection matrix; is the target subspace; x test is the target domain query sample; is a cluster center of a hash code of a kth category; is an L2 norm.

[0035] Optionally, when the iteration number does not reach the preset number and the target function loss value does not converge, a plurality of initial target domain vector elements corresponding to the target pseudo label of any category in the target pseudo label matrix are selected;

[0036] a sample selection value is calculated by using the iteration number, a number value of the initial target domain vector elements and the preset number;

[0037] all the initial target domain vector elements are sorted in descending order according to target probabilities associated with all the initial target domain vector elements;

[0038] sequentially select multiple target domain vector elements of the sample selection value in all the initial target domain vector elements, and update the preset initial subspace by using all the target domain vector elements;

[0039] Then jump to perform the step of inputting the source domain vector and the target domain vector into a preset initial subspace for class-specific learning, generating a source domain projection and a target domain projection, and statistically counting an iteration number in real time until the iteration number reaches a preset number or the target function loss value converges.

[0040] Optionally, the preset first formula is specifically:

[0041]

[0042] In the formula, y is a source domain class cluster center of the kth class; n s is a sample number in a source domain vector set s; Z si is a source domain projection; y k is a source domain sample label of the kth class; and δ() is an indicator function. is a source domain label; p1(y k |x t ) is a first probability; Z t is a target domain projection corresponding to a target domain vector in a target domain vector set t; and K is a class number.

[0043] The preset second formula is specifically:

[0044]

[0045] In the formula, p2(y k |x t ) is a second probability; Z t is a target domain projection corresponding to a target domain vector in a target domain vector set t. is a target domain cluster center of the kth class; K is a class number; and y k is a source domain sample label of the kth class.

[0046] The second aspect of the present application provides a domain adaptation retrieval device, comprising:

[0047] An acquisition data module is configured to acquire an image data set, perform feature extraction on the image data set, and determine a first feature vector set, wherein the first feature vector set comprises a plurality of source domain vectors and a plurality of target domain vectors.

[0048] A projection generation module is configured to input the source domain vectors and the target domain vectors into a preset initial subspace for class-specific learning, generate a source domain projection and a target domain projection, and statistically count an iteration number in real time.

[0049] a computing loss value module, configured to perform discriminative hash code learning on the source domain projection and the target domain projection, output a hash code and a projection matrix, and calculate a target function loss value in combination with the source domain vector, the target domain vector, the preset initial subspace, the source domain projection and the target domain projection;

[0050] a determining data module, configured to determine a target subspace and a target projection matrix when the number of iterations reaches a preset number or the target function loss value converges;

[0051] an output result module, configured to perform query retrieval on a target domain query sample by using the target subspace and the target projection matrix, and output a domain adaptive retrieval result.

[0052] Optionally, the hash code comprises a source domain hash code and a target domain hash code; and the computing loss value module comprises:

[0053] a determining pseudo label sub-module, configured to determine a plurality of target pseudo labels corresponding to all the target domain vectors based on the plurality of source domain projections corresponding to all the source domain vectors, the plurality of target domain projections corresponding to all the target domain vectors and all the source domain vectors;

[0054] a determining loss value sub-module, configured to calculate a target function loss value by using a target pseudo label matrix associated with all the target pseudo labels, a source domain label matrix associated with the source domain vector, the source domain hash code, the target domain hash code, the projection matrix, the source domain vector, the target domain vector, the preset initial subspace, the source domain projection and the target domain projection;

[0055] the target function corresponding to the target function loss value is:

[0056]

[0057]

[0058] in the formula, is a target function loss value; K is a category number; n s is a sample number in a source domain vector set s; n t is a sample number in a target domain vector set t; Y ik is a source domain label matrix; is an i-th source domain vector in the source domain vector set s; U k is a preset initial subspace of a k-th category; is an i-th source domain projection of a k-th category in the source domain vector set s; W jk is a target pseudo label matrix; is a j-th target domain vector in the target domain vector set t; is the jth target domain projection for the kth class in the target domain vector set t; λ is a penalty factor; Z k is the set of source domain projection and target domain projection for the kth class; is the source domain hash code for the kth class in the source domain vector set s; P k is the projection matrix for the kth class; is the source domain projection matrix for the kth class in the source domain vector set s; is the target domain hash code for the kth class in the target domain vector set t; is the target domain projection matrix for the kth class in the target domain vector set t; is the orthogonal constraint; I is the identity matrix; is the transpose of U k is the transpose of U s is the source domain hash code matrix; B t is the target domain hash code matrix; is the Frobenius norm.

[0059] The third aspect of the present application provides an electronic device, comprising a memory and a processor, the memory stores a computer program, and the computer program is executed by the processor to make the processor execute the steps of the domain adaptation retrieval method according to any one of the above aspects.

[0060] The fourth aspect of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed to implement the domain adaptation retrieval method according to any one of the above aspects.

[0061] From the above technical solutions, the present application has the following advantages:

[0062] 1. The present application proposes to learn different domain common subspaces for different classes to enhance the difference significance between classes, which can further alleviate the negative transfer problem. Unlike the traditional method of directly learning a shared subspace without distinguishing different class samples, the subspaces learned by the present application for different classes are equivalent to classifiers in function, and the projections of each sample on the subspace can be obtained at the same time. The advantage is that the same class samples from different domains can be learned and concentrated in the same subspace, thereby effectively avoiding considering the domain difference of samples in the same class subspace, so that the present application has stronger classification advantage for different class samples and can further reduce the domain difference between the same class samples, thereby obtaining better domain adaptation retrieval effect.

[0063] 2、The application proposes a subspace gradual learning process based on a selective pseudo-label strategy. Unlike the static selection of the traditional hard pseudo-label strategy, the selective pseudo-label strategy has the advantage that target domain samples can be dynamically selected to join the training in each iteration. By selecting target domain samples carrying better pseudo-labels in the iteration process, on the one hand, the estimation of the pseudo-labels is more reliable, and on the other hand, the quality reduction caused by the accumulation of errors in the hard pseudo-label strategy can be avoided. Finally, the gradual learning of the subspace is realized through repeated iteration adjustment.

[0064] 3、The application first initializes multiple class-specific subspaces from the source domain samples under the supervision of the source domain sample labels. Then, since the key of the selective pseudo-label is to select a small part of samples with the highest pseudo-label accuracy in each round to join the training in the next round, it means that a part of pseudo-label reliable target domain samples will be selected to join the learning of the subspace in each round, so as to adjust and refine the subspace learned from the source domain samples. In this way, the learned subspace is domain-common, that is, the cross-domain problem is solved in this step; and the subspace itself is class-specific, and the samples will only participate in the learning of the same class subspace, so the pattern collapse problem will be greatly alleviated. The selective pseudo-label strategy used in the application introduces a pseudo-label through structured prediction, and the quality of the final pseudo-label is greatly improved, so the target domain pseudo-labels participating in the subspace learning can be considered reliable. Finally, the application directly uses the projection of the sample on the subspace to learn the hash code, and since each class has a different subspace, the hash code learned by using the projection also has certain discriminativeness. BRIEF DESCRIPTION OF DRAWINGS

[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, hereinafter, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0066] Figure 1 A step flow chart of a domain adaptation retrieval method provided for the embodiments of the present application;

[0067] Figure 2 A schematic diagram of a training framework of a domain adaptation retrieval method provided for the embodiments of the present application;

[0068] Figure 3 A step flow chart of another domain adaptation retrieval method provided for the embodiments of the present application;

[0069] Figure 4 A structural block diagram of a domain adaptation retrieval device provided for the embodiments of the present application. DETAILED DESCRIPTION

[0070] The embodiment of the present application provides a domain adaptation retrieval method, device, equipment and medium, which are used for solving the technical problems that the existing technology can easily cause the target domain samples of the same kind which are not located near the source domain samples in the subspace to be not well classified, and the target domain samples of unknown categories are easily distributed due to the lack of labels in the target domain samples, so that the effect of domain adaptation retrieval is not ideal.

[0071] In order to make the invention purpose, features and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the following described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0072] Please refer to Figure 1 , Figure 1 The present application provides a kind of for the embodiment of the present application.

[0073] The present application provides a kind of domain adaptation retrieval method, comprising:

[0074] Step 101, obtain an image data set, perform feature extraction on the image data set, determine a first feature vector set, and the first feature vector set includes a plurality of source domain vectors and a plurality of target domain vectors.

[0075] The first feature vector set includes a source domain vector set and a target domain vector set, the source domain vector set includes a plurality of source domain vectors, and the target domain vector set includes a plurality of target domain vectors.

[0076] It is worth mentioning that, first, a cross-domain data set is obtained, then 10% of the target domain images are randomly selected as test set data, feature extraction is performed on the test set data to obtain a test vector set, the remaining images are used as training set data, i.e. image data set, and feature extraction is performed on all images in the image data set to obtain a first feature vector set, i.e. source domain vectors corresponding to each source domain image and target domain vectors corresponding to each target domain image, wherein the cross-domain data set includes a source domain image set and a target domain image set, and the test vector set includes a plurality of target domain query samples.

[0077] Exemplarily, it is assumed that there are n s labeled source domain and target domain t with n samples is the feature vector of the two-domain sample, d is the feature dimension and represents the source domain label corresponding to the source domain sample. is the target domain pseudo label. Assuming the distributions of the source and target domains follow p and q respectively, then p≠q, i.e. following two unequal distributions, the present application is the source domain D s learning a set of hash codes and is the target domain D t learning a set of hash codes wherein, is the hash code corresponding to the i-th source domain vector of the source domain; is the hash code corresponding to the i-th target domain vector of the target domain; r is the length of the hash code. The entire retrieval pool can be expressed as B = [B s ,B t ]∈{-1,1} r×n wherein, B s is the source domain retrieval pool; B t is the target domain retrieval pool.

[0078] In the present embodiment, an image dataset is acquired, feature extraction is performed on the image dataset, and a first feature vector set is determined, the first feature vector set including a plurality of source domain vectors and a plurality of target domain vectors.

[0079] In step 102, the source domain vectors and the target domain vectors are input to a preset initial subspace for class-specific learning, to generate source domain projections and target domain projections, and to count the number of iterations in real time.

[0080] It is worth mentioning that, assuming that the source domain samples and the target domain samples share K class-specific domain common subspaces corresponding to K classes, each subspace corresponding to one class, these shared subspaces serve as a bridge for knowledge transfer, transferring knowledge from the source domain with sufficient sample quantity and labeled information supervision to the target domain with less sample quantity and no labeled information. The K subspaces finally learned can be regarded as K class classifiers, which are used to classify the test samples U K and the learned projection matrix P k for more accurate retrieval.

[0081] Further, since the source domain labels are known, we first learn an initial shared subspace U = {U1,…,U K} from the source domain samples, i.e. using all source domain vectors to initialize the subspace to obtain a preset subspace, the present application selects k subspace learning as the target of subspace learning, and uses squared distance measurement to measure the gap between x and U k , wherein, U is a three-dimensional variable, which can be understood as a combination of K two-dimensional variables, U k is the K-th two-dimensional variable among them, i.e. to A basis of the subspace k with dimension D is defined, and then the subspace is gradually refined by selecting target domain samples with reliable pseudo labels.

[0082] In the embodiment, the source domain vector and the target domain vector are input into a preset initial subspace for class-specific learning, the source domain projection and the target domain projection are generated, and the iteration number is counted in real time.

[0083] In step 103, discriminative hash code learning is performed on the source domain projection and the target domain projection, and a hash code and a projection matrix are output, and a target function loss value is calculated in combination with the source domain vector, the target domain vector, the preset initial subspace, the source domain projection and the target domain projection.

[0084] It is worth mentioning that, to obtain binary hash codes, the most direct method is to use the sign function sgn(·) to quantize the data points into the nearest vertex of the Hamming cube. However, this scheme usually leads to serious local information loss. The projection Z of the sample on its category subspace can be considered to retain the feature information of the sample and have class discriminability, so the projection Z of each domain sample can be directly used to learn the hash code, thereby establishing the connection between the hash code and the sample feature. Therefore, the quantization loss is represented as follows:

[0085]

[0086] In the formula, is the source domain hash code of the kth category in the source domain vector set s; P k is the projection matrix of the kth category; is the source domain projection matrix of the kth category in the source domain vector set s; is the target domain hash code of the kth category in the target domain vector set t; is the target domain projection matrix of the kth category in the target domain vector set t; B s is the source domain hash code matrix; B t is the target domain hash code matrix; is the Frobenius norm; B is the hash code variable; P is the projection matrix variable.

[0087] Further, the target function corresponding to the target function loss value is:

[0088]

[0089]

[0090] In the formula, is the target function loss value; K is the number of categories; n s is the number of samples in the source domain vector set s; n t is the number of samples in the target domain vector set t; Yik is a source domain label matrix; is the i-th source domain vector in the source domain vector set s; U k is a preset initial subspace of the k-th class; is the i-th source domain projection of the k-th class in the source domain vector set s; W jk is a target pseudo label matrix; is the j-th target domain vector in the target domain vector set t; is the j-th target domain projection of the k-th class in the target domain vector set t; λ is a penalty factor; Z k is a set of source domain projections and target domain projections of the k-th class; is a source domain hash code of the k-th class in the source domain vector set s; P k is a projection matrix of the k-th class; is a source domain projection matrix of the k-th class in the source domain vector set s; is a target domain hash code of the k-th class in the target domain vector set t; is a target domain projection matrix of the k-th class in the target domain vector set t; is an orthogonal constraint; I is an identity matrix; is a transpose of U k ; B s is a source domain hash code matrix; B t is a target domain hash code matrix; is a Frobenius norm.

[0091] In the embodiment, discriminative hash code learning is performed on the source domain projection and the target domain projection, and a hash code and a projection matrix are output, and a target function loss value is calculated in combination with a source domain vector, a target domain vector, a preset initial subspace, a source domain projection and a target domain projection.

[0092] In step 104, when the number of iterations reaches a preset number or the target function loss value converges, a target subspace and a target projection matrix are determined.

[0093] It is worth mentioning that each variable in the target function is updated by iteration until the target function converges or the number of iterations reaches a maximum iteration number T, and the required output is determined, that is, the projection matrix corresponding to the current iteration number and the preset subspace are taken as the target projection matrix and the target subspace, and all hash codes obtained in the iteration update process associated with the target projection matrix.

[0094] In the embodiment, when the number of iterations reaches a preset number or the target function loss value converges, a target subspace and a target projection matrix are determined.

[0095] Step 105, performing query retrieval on the target domain query sample by using the target subspace and the target projection matrix, and outputting a domain adaptive retrieval result.

[0096] It is worth mentioning that the target domain query sample is inputted by using the learned target projection matrix, the target subspace and all the hash codes obtained in the update iteration process, and a domain adaptive retrieval result is outputted.

[0097] In this embodiment, the target domain query sample is inputted by using the target subspace and the target projection matrix, and a domain adaptive retrieval result is outputted.

[0098] Please refer to Figure 2 , for example, first, the source domain image and the target domain image are inputted into a convolutional neural network (CNN) for feature extraction, and corresponding source domain vectors X s and target domain vectors X t are obtained, then the source domain vectors X s , the source domain vectors X s , the corresponding source domain labels Y s and the target domain vectors X t are subjected to class-specific subspace learning, and the source domain projection Z s and the target domain projection Z t are outputted; then the source domain projection Z s and the target domain projection Z t are subjected to discriminative hash code learning, and the source domain hash code B s and the target domain hash code B t are generated; at the same time, based on the selective pseudo label strategy, the source domain projection Z s and the target domain projection Z t are predicted to determine the target pseudo label matrix Y corresponding to the target pseudo label, and the target pseudo label matrix Y is used to update the subspace.

[0099] In the embodiment of the present application, an image data set is acquired, feature extraction is performed on the image data set, a first feature vector set is determined, the first feature vector set includes a plurality of source domain vectors and a plurality of target domain vectors; the source domain vectors and the target domain vectors are input to a preset initial subspace for class-specific learning, a source domain projection and a target domain projection are generated, and the number of iterations is counted in real time; discriminative hash code learning is performed on the source domain projection and the target domain projection, a hash code and a projection matrix are output, and a target function loss value is calculated in combination with the source domain vectors, the target domain vectors, the preset initial subspace, the source domain projection and the target domain projection; when the number of iterations reaches a preset number or the target function loss value converges, a target subspace and a target projection matrix are determined; the target domain query sample is searched by using the target subspace and the target projection matrix, and a domain adaptive retrieval result is output. The technical problem that in the prior art, the same class target domain samples that are not located near the source domain samples in the subspace cannot be well classified, and due to the lack of labels in the target domain samples, the unknown class target domain samples are easily distributed, resulting in an unsatisfactory domain adaptive retrieval effect is solved.

[0100] Please refer to Figure 3 , Figure 3 The flowchart of steps of another domain adaptive retrieval method provided by the embodiment of the present application is shown in FIG. 4.

[0101] The domain adaptive retrieval method provided by the present application comprises the following steps:

[0102] In step 301, an image data set is acquired, feature extraction is performed on the image data set, a first feature vector set is determined, and the first feature vector set includes a plurality of source domain vectors and a plurality of target domain vectors.

[0103] In the embodiment, an image data set is acquired, feature extraction is performed on the image data set, a first feature vector set is determined, and the first feature vector set includes a plurality of source domain vectors and a plurality of target domain vectors.

[0104] In step 302, the source domain vectors and the target domain vectors are input to a preset initial subspace for class-specific learning, a source domain projection and a target domain projection are generated, and the number of iterations is counted in real time.

[0105] In the embodiment, the source domain vectors and the target domain vectors are input to a preset initial subspace for class-specific learning, a source domain projection and a target domain projection are generated, and the number of iterations is counted in real time.

[0106] In step 303, discriminative hash code learning is performed on the source domain projection and the target domain projection, a hash code and a projection matrix are output, and a target function loss value is calculated in combination with the source domain vectors, the target domain vectors, the preset initial subspace, the source domain projection and the target domain projection.

[0107] The hash code includes a source domain hash code and a target domain hash code.

[0108] Further, step 303 can include the following sub-steps:

[0109] S31, based on the plurality of source domain projections corresponding to all source domain vectors, the plurality of target domain projections corresponding to all target domain vectors and all source domain vectors, determine the plurality of target pseudo labels corresponding to all target domain vectors.

[0110] It is worth mentioning that the labeling of unlabeled target domain vectors can be mutually promoted with the learning of subspace U, so the projections Z s 、Z t of the source domain vectors and the target domain vectors in the subspace are used as the original sample representation in the subspace, and the selective pseudo label strategy used in the application combines nearest class prototype prediction and structured prediction to predict target pseudo labels.

[0111] S32, using the target pseudo label matrix associated with all target pseudo labels, the source domain label matrix associated with the source domain vectors, the source domain hash code, the target domain hash code, the projection matrix, the source domain vectors, the target domain vectors, the preset initial subspace, the source domain projection and the target domain projection, calculate the target function loss value.

[0112] The target function corresponding to the target function loss value is:

[0113]

[0114]

[0115] In the formula, is the target function loss value; K is the number of categories; n s is the number of samples in the source domain vector set s; n t is the number of samples in the target domain vector set t; Y ik is the source domain label matrix; is the i-th source domain vector in the source domain vector set s; U k is the preset initial subspace of the k-th category; is the I-th source domain projection of the k-th category in the source domain vector set s; W jk is the target pseudo label matrix; is the j-th target domain vector in the target domain vector set t; is the j-th target domain projection of the k-th category in the target domain vector set t; λ is a penalty factor; Z k is the set of source domain projections and target domain projections of the k-th category; is the source domain hash code of the k-th category in the source domain vector set s; P k is the projection matrix of the k-th category; is the source domain projection matrix of the k-th category in the source domain vector set s; is the target domain hash code of the k-th class in the target domain vector set t; is the target domain projection matrix of the k-th class in the target domain vector set t; is the orthogonal constraint; I is the unit matrix; is U k is the transpose of U; B s is the source domain hash code matrix; B t is the target domain hash code matrix; is the Frobenius norm.

[0116] Further, S31 can include the following sub-steps:

[0117] S311, according to a preset first formula, using a plurality of source domain projections, a plurality of target domain projections and a plurality of source domain labels corresponding to all source domain vectors to perform operation, to determine a plurality of source domain class cluster centers corresponding to all target domain vectors and a plurality of first probabilities.

[0118] It is worth mentioning that the nearest class prototype tends to output high probability to the sample close to the source domain cluster center. The main operation is to centralize (i.e. mean subtraction, is the mean of all source and target domain sample representations) and normalize the target domain projection with the source cluster center to facilitate the separability of different classes in the subspace. Exemplarily, for any label y in the label set Y, its class prototype is defined as the average vector of the projection (i.e. Z s ) of the source sample with label y on its subspace.

[0119] Further, the preset first formula is specifically:

[0120]

[0121] In the formula, is the source domain class cluster center of the k-th class; n s is the number of samples in the source domain vector set s; Z si is the source domain projection; y k is the source domain sample label of the k-th class; δ() is the indicator function; is the source domain label; p1(y k |x t ) is the first probability; Z t is the target domain projection corresponding to the target domain vector in the target domain vector set t; K is the number of classes.

[0122] S312, based on the plurality of target domain projections and the plurality of source domain labels, output a plurality of initial target domain cluster centers.

[0123] The operation process of the initial target domain cluster center is:

[0124]

[0125] wherein, is the i-th initial target domain cluster center; n s is the number of samples in the source domain vector set s; Z ti is the target domain projection; y k is the source domain sample label of the k-th class; δ() is an indicator function; is the source domain label.

[0126] S313, distance matching is performed on the plurality of source domain class cluster centers and the plurality of initial target domain cluster centers by a preset matching matrix condition, to generate a plurality of target domain cluster centers.

[0127] It is worth mentioning that the internal structure of the target domain sample provides a lot of effective information for the classification of the target domain sample, and the structured prediction mode considers the structural information of the target domain sample. Specifically, |K| clusters are generated on the target sample projection using k-means, and the cluster centers are calculated in the same way as the average vector calculated from the source sample projection. Then, one-to-one matching is performed between the clusters from the target domain and the classes from the source domain, and the distance between the matching pairs is pulled closer. This results in more concentrated samples of the same class, regardless of whether the samples are from the source domain or the target domain, where A∈{0, 1} K×K represents a one-to-one matching matrix, for example, A kj = 1 indicates that the i-th target domain cluster is matched with the j-th source domain class.

[0128] The preset matching matrix condition is specifically:

[0129]

[0130]

[0131] wherein, A ij is a matching matrix of i rows and j columns; d() is a matching function; is the j-th source domain class cluster center; is the i-th initial target domain cluster center.

[0132] S314, a plurality of second probabilities corresponding to all target domain vectors are output by performing operation on the plurality of target domain cluster centers and the plurality of target domain projections according to a preset second formula.

[0133] The preset second formula is specifically:

[0134]

[0135] wherein, p2(y k |xt ) is the second probability; Z t is the target domain projection corresponding to the target domain vector in the target domain vector set t; is the target domain cluster center of the kth category; K is the number of categories; y k is the source domain sample label of the kth category.

[0136] S315, according to a preset third formula, a plurality of first probabilities and a plurality of second probabilities are operated to determine a plurality of target probabilities and a plurality of target pseudo labels corresponding to all target domain vectors.

[0137] It is worth mentioning that after obtaining the target pseudo label based on the above operation, the pseudo label is selectively updated in the process of learning the category subspace, so as to gradually select the target domain sample with reliable pseudo label to join the category subspace to learn to obtain an optimal subspace U and target domain pseudo label.

[0138] The preset third formula is specifically:

[0139]

[0140] In the formula, p (y k |x t ) is the target probability; p1 (y k |x t ) is the first probability; p2 (y k |x t ) is the second probability; is the target pseudo label; y k is the source domain sample label of the kth category; K is the number of categories; x t is the target domain vector in the target domain vector set t.

[0141] In this embodiment, discriminative hash code learning is performed on the source domain projection and the target domain projection, and the hash code and the projection matrix are output, and the target function loss value is calculated in combination with the source domain vector, the target domain vector, the preset initial subspace, the source domain projection and the target domain projection.

[0142] Step 304, when the number of iterations reaches a preset number or the target function loss value converges, the target subspace and the target projection matrix are determined.

[0143] In this embodiment, when the number of iterations reaches a preset number or the target function loss value converges, the target subspace and the target projection matrix are determined.

[0144] Step 305, the target domain query sample is queried and retrieved by using the target subspace and the target projection matrix, and a domain adaptive retrieval result is output.

[0145] Further, step 305 can include the following substeps:

[0146] S51, determining a query hash code based on the target subspace, the target projection matrix and the target domain query sample.

[0147] The calculation formula of the query hash code is:

[0148]

[0149] In the formula, is the query hash code; is the target projection matrix; is the target subspace; x test is the target domain query sample; is the cluster center of the hash code of the kth category; is the L2 norm.

[0150] S52, constructing a retrieval pool by using all hash codes associated with the target projection matrix.

[0151] The retrieval pool is constructed by using all hash codes associated with the target projection matrix, i.e., all source domain hash codes and all target domain hash codes learned in the iterative updating process are respectively taken as a source domain retrieval pool and a target domain retrieval pool. For cross-domain retrieval, the source domain retrieval pool is used for retrieval, and for single-domain retrieval, the target domain retrieval pool is used for retrieval.

[0152] S53, calculating the Hamming distance between the query hash code and the retrieval pool, and outputting a domain adaptive retrieval result.

[0153] It is worth mentioning that the Hamming distance between the query hash code and the entire retrieval pool learned is calculated, and a domain adaptive retrieval result is outputted. Finally, the retrieval precision is calculated to evaluate the single-domain / cross-domain retrieval performance of the entire model.

[0154] In the embodiment, the target domain query sample is retrieved by using the target subspace and the target projection matrix, and a domain adaptive retrieval result is outputted.

[0155] Step 306, when the number of iterations does not reach the preset number and the target function loss value does not converge, selecting a plurality of initial target domain vector elements corresponding to any one target pseudo label in the target pseudo label matrix.

[0156] It is worth mentioning that after the target pseudo label corresponding to each target domain vector is calculated, it can be known that there are several categories of vectors in the target domain vector set; the target domain vector with the target pseudo label is used to update the initialized target pseudo label matrix, and all initial target domain vector elements corresponding to a category of vectors, i.e., target domain sample vectors, are randomly selected in the target pseudo label matrix.

[0157] In the embodiment, when the iteration number does not reach the preset number and the target function loss value does not converge, a plurality of initial target domain vector elements corresponding to any class target pseudo label in the target pseudo label matrix are selected.

[0158] In step 307, the sample selection value is calculated by using the iteration number, the initial target domain vector element number value and the preset number.

[0159] It is worth mentioning that the sample selection value needs to be calculated, and the target sample is selected from all initial target domain vector elements corresponding to a class vector to update the preset subspace according to the sample selection value. The calculation formula of the sample selection value is: Wherein, l is the sample selection value; t is the iteration number; is the initial target domain vector element number value of the kth class; T is the preset number.

[0160] In the embodiment, the sample selection value is calculated by using the iteration number, the initial target domain vector element number value and the preset number.

[0161] In step 308, all initial target domain vector elements are sorted in descending order according to the target probability associated with all initial target domain vector elements.

[0162] It is worth mentioning that the initial target domain vector elements, i.e. the target probability of the target domain vector with the target pseudo label, are sorted from large to small according to the size of the target probability.

[0163] For example, in order to select more accurate target domain pseudo labels for training, after generating the pseudo label in the first iteration, for any class c∈Y, first select the target domain sample with the pseudo label c, i.e. the initial target domain vector element of the cth class. Then, select target domain samples of this class from the higher probability to form a subset S k , which is the target domain sample and its pseudo label participating in learning in the next iteration.

[0164] In the embodiment, all initial target domain vector elements are sorted in descending order according to the target probability associated with all initial target domain vector elements.

[0165] In step 309, a plurality of target domain vector elements of the sample selection value are sequentially selected from all initial target domain vector elements, and all target domain vector elements are used to update the preset initial subspace.

[0166] It is worth mentioning that the target domain sample is selected to join the corresponding class subspace under the indication of the target pseudo label matrix corresponding to the target domain vector, and the target function of the preset subspace learning is represented as follows:

[0167]

[0168] In the formula, Y ik The source domain label matrix; U is the i-th source domain vector in the source domain vector set s; k This is the preset initial subspace for the k-th class; W is the source domain projection of the k-th class in the source domain vector set s; jk The target pseudo-label matrix; Let be the j-th target domain vector in the target domain vector set t; Z is the target domain projection of the k-th class in the target domain vector set t; λ is the penalty factor; k It is the set of source domain projections and target domain projections; U is the Frobinius norm; U is the subspace variable; Z is the projection variable.

[0169] Furthermore, as the number of iterations increases, depending on the selective pseudo-labeling strategy used in the method, each category in round t will have... One sample was selected, along with its newly learned pseudo-label matrix, to participate in the next round of neutron space U. k The learning process proceeds iteratively, alternating between different learning methods. During this process, since the selection criterion is the probability value of the learned pseudo-labels, the target domain samples participating in each round of learning the subspace have high-quality pseudo-labels. This results in less error accumulation during subspace learning, making it more conducive to learning the optimal subspace U. k When the number of iterations t reaches the pre-set maximum number of iterations T, each category will be selected. All samples participate in the final round of learning. The subspace U obtained in the final round... k This is the optimal subspace U that we are looking for. k .

[0170] In this embodiment, multiple target domain vector elements of the sample selection value are sequentially selected from all initial target domain vector elements, and the preset initial subspace is updated using all target domain vector elements.

[0171] Step 310: Next, jump to execute the steps of inputting the source domain vector and the target domain vector into the preset initial subspace for class-specific learning, generating the source domain projection and the target domain projection, and counting the number of iterations in real time, until the number of iterations reaches the preset number or the objective function loss value converges.

[0172] It is worth mentioning that the preset initial subspace is updated with all elements of the target domain vector, and then the process returns to step 302, which is to jump to the step of inputting the source domain vector and the target domain vector into the preset initial subspace for class-specific learning, generating the source domain projection and the target domain projection, and counting the number of iterations in real time, until the objective function loss value converges.

[0173] In the embodiment, the source domain vector and the target domain vector are input to the preset initial subspace for class-specific learning, the source domain projection and the target domain projection are generated, and the iteration number is counted in real time until the iteration number reaches a preset number or a target function loss value converges.

[0174] In the embodiment, an image data set is obtained, feature extraction is performed on the image data set, a first feature vector set is determined, the first feature vector set includes a plurality of source domain vectors and a plurality of target domain vectors; the source domain vector and the target domain vector are input to a preset initial subspace for class-specific learning, a source domain projection and a target domain projection are generated, and an iteration number is counted in real time; discriminative hash code learning is performed on the source domain projection and the target domain projection, a hash code and a projection matrix are output, and a target function loss value is calculated in combination with the source domain vector, the target domain vector, the preset initial subspace, the source domain projection and the target domain projection; when the iteration number reaches a preset number or the target function loss value converges, a target subspace and a target projection matrix are determined; the target domain query sample is searched by using the target subspace and the target projection matrix, and a domain adaptive retrieval result is output. The technical problem that in the prior art, the same class target domain samples that are not located near the source domain samples in the subspace cannot be well classified, and due to the lack of labels in the target domain samples, the unknown class target domain samples are easily distributed, resulting in an unsatisfactory domain adaptive retrieval effect is solved.

[0175] Please refer to Figure 4 , Figure 4 The structure block diagram of the domain adaptive retrieval device provided in the embodiment is shown in FIG. 4.

[0176] The data acquisition module 401 is configured to obtain an image data set, perform feature extraction on the image data set, determine a first feature vector set, and the first feature vector set includes a plurality of source domain vectors and a plurality of target domain vectors.

[0177] The projection generation module 402 is configured to input the source domain vector and the target domain vector to a preset initial subspace for class-specific learning, generate a source domain projection and a target domain projection, and count an iteration number in real time.

[0178] The loss value calculation module 403 is configured to perform discriminative hash code learning on the source domain projection and the target domain projection, output a hash code and a projection matrix, and calculate a target function loss value in combination with the source domain vector, the target domain vector, the preset initial subspace, the source domain projection and the target domain projection.

[0179] The data determination module 404 is configured to determine a target subspace and a target projection matrix when the iteration number reaches a preset number or the target function loss value converges.

[0180] The output results module 405 is used to query and retrieve the target domain query samples using the target subspace and the target projection matrix, and output the domain-adapted retrieval results.

[0181] Furthermore, the loss calculation module 403 includes:

[0182] The pseudo-label determination submodule is used to determine multiple target pseudo-labels corresponding to all target domain vectors based on multiple source domain projections corresponding to all source domain vectors, multiple target domain projections corresponding to all target domain vectors, and all source domain vectors.

[0183] The calculation submodule is used to calculate the objective function loss value using the target pseudo-label matrix associated with all target pseudo-labels, the source domain label matrix associated with the source domain vector, the source domain hash code, the target domain hash code, the projection matrix, the source domain vector, the target domain vector, the preset initial subspace, the source domain projection, and the target domain projection.

[0184] The objective function corresponding to the loss value is:

[0185]

[0186]

[0187] In the formula, The objective function loss value; K is the number of classes; n s n is the number of samples in the source domain vector set s; t Y represents the number of samples in the target domain vector set t; ik The source domain label matrix; Let u be the i-th source domain vector in the source domain vector set s; k This is the preset initial subspace for the k-th class; W is the source domain projection of the k-th class in the source domain vector set s; jk The target pseudo-label matrix; Let be the j-th target domain vector in the target domain vector set t; Z is the target domain projection of the k-th class in the target domain vector set t; λ is the penalty factor; k Let be the set of source domain projections and target domain projections for the k-th class; P is the source domain hash code of the k-th class in the source domain vector set s; k Let be the projection matrix of the k-th class; Let be the source domain projection matrix of the k-th class in the source domain vector set s; Let be the target domain hash code of the k-th category in the target domain vector set t; Let be the target domain projection matrix of the k-th class in the target domain vector set t; For orthogonal constraints; I is the identity matrix; is the transpose of U k is the source domain hash code matrix; B s is the target domain hash code matrix; t is the transpose of U is the Frobenius norm.

[0188] Further, the pseudo-label determining module comprises:

[0189] a first operation unit, configured to perform operation on the plurality of source domain projections, the plurality of target domain projections and the plurality of source domain labels corresponding to the plurality of source domain vectors according to a preset first formula, to determine a plurality of source domain class cluster centers corresponding to the plurality of target domain vectors and a plurality of first probabilities;

[0190] a second operation unit, configured to output a plurality of initial target domain cluster centers based on the plurality of target domain projections and the plurality of source domain labels;

[0191] a third operation unit, configured to perform distance matching on the plurality of source domain class cluster centers and the plurality of initial target domain cluster centers through a preset matching matrix condition, to generate a plurality of target domain cluster centers;

[0192] a fourth operation unit, configured to perform operation on the plurality of target domain cluster centers and the plurality of target domain projections according to a preset second formula, to output a plurality of second probabilities corresponding to the plurality of target domain vectors;

[0193] a fifth operation unit, configured to perform operation on the plurality of first probabilities and the plurality of second probabilities according to a preset third formula, to determine a plurality of target probabilities and a plurality of target pseudo-labels corresponding to the plurality of target domain vectors;

[0194] The preset third formula is specifically:

[0195]

[0196] wherein, p(y k |x t ) is the target probability; p1(y k |x t ) is the first probability; p2(y k |x t ) is the second probability; is the target pseudo-label; y k is the source domain sample label of the kth class; K is the number of classes; x t is the target domain vector in the target domain vector set t.

[0197] Further, the output result module 405 comprises:

[0198] a hash code calculating sub-module, configured to determine a query hash code based on the target subspace, the target projection matrix and the target domain query sample;

[0199] The retrieval pool construction submodule is configured to construct a retrieval pool by using all hash codes associated with the target projection matrix;

[0200] The output submodule is configured to calculate the Hamming distance between the query hash code and the retrieval pool and output the domain adaptive retrieval result;

[0201] The calculation formula of the query hash code is as follows:

[0202]

[0203] In the formula, is the query hash code; is the target projection matrix; is the target subspace; x test is the target domain query sample; is the cluster center of the hash code of the kth category; is the L2 norm.

[0204] Further, the method further comprises the following steps:

[0205] The selection module is configured to select multiple initial target domain vector elements corresponding to any target pseudo label in the target pseudo label matrix when the number of iterations does not reach the preset number and the target function loss value does not converge;

[0206] The second operation module is configured to calculate a sample selection value by using the number of iterations, the number of initial target domain vector elements, and the preset number;

[0207] The sorting module is configured to sort all initial target domain vector elements in descending order according to the target probability associated with all initial target domain vector elements;

[0208] The updating module is configured to sequentially select multiple target domain vector elements with the sample selection value from all initial target domain vector elements and update the preset initial subspace by using all target domain vector elements;

[0209] The jump module is configured to jump to the step of inputting the source domain vector and the target domain vector into the preset initial subspace for category-specific learning, generating the source domain projection and the target domain projection, and real-time counting the number of iterations until the number of iterations reaches the preset number or the target function loss value converges.

[0210] Further, the preset first formula is specifically as follows:

[0211]

[0212] In the formula, is the source domain category cluster center of the kth category; n s is the number of samples in the source domain vector set s; andsi is the source domain projection; y k is the label of the kth class of the source domain sample; δ() is an indicator function; is the source domain label; p1(y k |x t ) is the first probability; Z t is the target domain projection corresponding to the target domain vector in the target domain vector set t; K is the number of classes;

[0213] The preset second formula is specifically:

[0214]

[0215] In the formula, p2(y k |x t ) is the second probability; Z t is the target domain projection corresponding to the target domain vector in the target domain vector set t; is the target domain cluster center of the kth class; K is the number of classes; y k is the label of the kth class of the source domain sample.

[0216] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the apparatus, module, sub-module and unit described above can refer to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0217] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the apparatus embodiments described above are only schematic. For example, the division of the units is only a logical function division, and actual implementation can have another division manner. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.

[0218] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.

[0219] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0220] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the entire or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0221] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A domain adaptation retrieval method, characterized in that, The method comprises the following steps: acquiring an image data set, performing feature extraction on the image data set, determining a first feature vector set, and the first feature vector set comprising a plurality of source domain vectors and a plurality of target domain vectors; inputting the source domain vectors and the target domain vectors into a preset initial subspace for class-specific learning, generating source domain projections and target domain projections, and counting the number of iterations in real time; performing discriminative hash code learning on the source domain projections and the target domain projections, outputting hash codes and projection matrices, and calculating a target function loss value in combination with the source domain vectors, the target domain vectors, the preset initial subspace, the source domain projections and the target domain projections; when the number of iterations reaches a preset number or the target function loss value converges, determining a target subspace and a target projection matrix; using the target subspace and the target projection matrix to perform query retrieval on a target domain query sample, and outputting a domain adaptive retrieval result; the hash codes comprise source domain hash codes and target domain hash codes; the step of performing discriminative hash code learning on the source domain projections and the target domain projections, outputting hash codes and projection matrices, and calculating a target function loss value in combination with the source domain vectors, the target domain vectors, the preset initial subspace, the source domain projections and the target domain projections comprises the following steps: determining a plurality of target pseudo-labels corresponding to all the target domain vectors based on a plurality of source domain projections corresponding to all the source domain vectors, a plurality of target domain projections corresponding to all the target domain vectors and all the source domain vectors; calculating a target function loss value by using a target pseudo-label matrix associated with all the target pseudo-labels, a source domain label matrix associated with the source domain vectors, the source domain hash codes, the target domain hash codes, the projection matrices, the source domain vectors, the target domain vectors, the preset initial subspace, the source domain projections and the target domain projections; the target function corresponding to the target function loss value is: ; In the formula, The loss value is the objective function value. Number of categories; For the source domain vector set The number of samples in the sample; For the target domain vector set The number of samples in the sample; The source domain label matrix; For the source domain vector set The first in One source domain vector; For the first Preset initial subspace for each class; Source domain vector set The first in The first category Projection of each source domain; The target pseudo-label matrix; For the target domain vector set The first in One target domain vector; For the target domain vector set The first in The first category Projection of each target domain; As a penalty factor; For the first A set of source domain projections and target domain projections for each class; For the source domain vector set The first in Source domain hash codes for each category; For the first Projection matrices for each class; For the source domain vector set The first in Source domain projection matrices for each category; For the target domain vector set The first in The target domain hash code for each category; For the target domain vector set The first in Projection matrices of the target domain for each category; Orthogonal constraint; It is the identity matrix; for Transpose of; The source domain hash code matrix; The target domain hash code matrix; It is the Frobinius norm.

2. The domain adaptation retrieval method of claim 1, wherein, the step of determining a plurality of target pseudo-labels corresponding to all the target domain vectors based on a plurality of source domain projections corresponding to all the source domain vectors, a plurality of target domain projections corresponding to all the target domain vectors and all the source domain vectors comprises the following steps: determining a plurality of source domain class cluster centers and a plurality of first probabilities corresponding to all the target domain vectors by performing operations on a plurality of the source domain projections, a plurality of the target domain projections and a plurality of source domain labels corresponding to all the source domain vectors according to a preset first formula; outputting a plurality of initial target domain cluster centers based on a plurality of the target domain projections and a plurality of the source domain labels; generating a plurality of target domain cluster centers by distance matching a plurality of the source domain class cluster centers and a plurality of the initial target domain cluster centers through a preset matching matrix condition; outputting a plurality of second probabilities corresponding to all the target domain vectors by performing operations on a plurality of the target domain cluster centers and a plurality of the target domain projections according to a preset second formula; determining a plurality of target probabilities and a plurality of target pseudo-labels corresponding to all the target domain vectors by performing operations on a plurality of the first probabilities and a plurality of the second probabilities according to a preset third formula; the preset third formula is specifically: ; wherein is a target probability; is a first probability; is a second probability; is a target pseudo-label; is a source domain sample label of the th class; is a class number; is a target domain vector in a target domain vector set is a target domain vector.

3. The domain adaptation retrieval method of claim 1, wherein, The step of performing query retrieval on the target domain query sample by using the target subspace and the target projection matrix to output a domain adaptive retrieval result comprises: Based on the target subspace, the target projection matrix and the target domain query sample, a query hash code is determined; A retrieval pool is constructed by using all the hash codes associated with the target projection matrix; The Hamming distance between the query hash code and the retrieval pool is calculated, and a domain adaptive retrieval result is outputted; The calculation formula of the query hash code is: ; In the formula, is a query hash code; is a target projection matrix; is a target subspace; is a target domain query sample; is a cluster center of the hash code of the th category; is a norm.

4. The domain adaptation retrieval method of claim 2, wherein, Further comprising: When the number of iterations does not reach the preset number and the target function loss value does not converge, a plurality of initial target domain vector elements corresponding to the target pseudo label of any class in the target pseudo label matrix are selected; The number of iterations, the number of initial target domain vector elements and the preset number are used to calculate a sample selection value; All the initial target domain vector elements are sorted in descending order according to the target probability associated with all the initial target domain vector elements; A plurality of target domain vector elements of the sample selection value are sequentially selected from all the initial target domain vector elements, and all the target domain vector elements are used to update the preset initial subspace; Then jump to execute the step of inputting the source domain vector and the target domain vector into the preset initial subspace for class-specific learning, generating source domain projection and target domain projection, and real-time counting the number of iterations until the number of iterations reaches the preset number or the target function loss value converges.

5. The domain adaptation retrieval method of claim 2, wherein, The preset first formula is specifically: ; In the formula, For the first Each category of source domain cluster center; Source domain vector set The number of samples in the sample; Projection to the source domain; For the first Source domain sample labels for each category; For indicator functions; For source domain tags; The first probability; For the target domain vector set The target domain projection corresponding to the target domain vector in the target domain; Number of categories; The preset second formula is specifically: ; wherein is a second probability; is a target domain vector set is a target domain projection corresponding to a target domain vector in is a target domain cluster center of a th class; is a class number; is a source domain sample label of a th class.

6. A domain adaptation retrieval apparatus characterized by comprising: Comprising: An acquisition data module is configured to acquire an image data set, perform feature extraction on the image data set, determine a first feature vector set, and the first feature vector set comprises a plurality of source domain vectors and a plurality of target domain vectors; A projection generation module is configured to input the source domain vector and the target domain vector into a preset initial subspace for class-specific learning, generate source domain projection and target domain projection, and real-time count the number of iterations; A loss value calculation module is configured to perform discriminative hash code learning on the source domain projection and the target domain projection, output a hash code and a projection matrix, and calculate a target function loss value in combination with the source domain vector, the target domain vector, the preset initial subspace, the source domain projection and the target domain projection; A determination data module is configured to determine a target subspace and a target projection matrix when the number of iterations reaches a preset number or the target function loss value converges; An output result module is configured to perform query retrieval on a target domain query sample by using the target subspace and the target projection matrix to output a domain adaptive retrieval result; The hash code comprises a source domain hash code and a target domain hash code; The loss value calculation module comprises: A pseudo label determination sub-module is configured to determine a plurality of target pseudo labels corresponding to all the target domain vectors based on a plurality of source domain projections corresponding to all the source domain vectors, a plurality of target domain projections corresponding to all the target domain vectors and all the source domain vectors; A loss value determining sub-module is configured to calculate a target function loss value by using the target pseudo label matrix associated with all the target pseudo labels, the source domain label matrix associated with the source domain vectors, the source domain hash codes, the target domain hash codes, the projection matrix, the source domain vectors, the target domain vectors, the preset initial subspace, the source domain projection, and the target domain projection. The target function corresponding to the target function loss value is: ; In the formula, The loss value is the objective function value. Number of categories; Source domain vector set The number of samples in the sample; For the target domain vector set The number of samples in the sample; The source domain label matrix; Source domain vector set The first in One source domain vector; For the first Preset initial subspace for each class; Source domain vector set The first in The first category Projection of each source domain; The target pseudo-label matrix; For the target domain vector set The first in One target domain vector; For the target domain vector set The first in The first category Projection of each target domain; As a penalty factor; For the first A set of source domain projections and target domain projections for each class; Source domain vector set The first in Source domain hash codes for each category; For the first Projection matrices for each class; Source domain vector set The first in Source domain projection matrices for each category; For the target domain vector set The first in The target field hash code for each category; For the target domain vector set The first in Projection matrices of the target domain for each category; Orthogonal constraint; It is the identity matrix; for transpose; The source domain hash code matrix; The target domain hash code matrix; It is the Frobinius norm.

7. An electronic device, comprising: A computer program product includes a memory and a processor, the memory storing a computer program, and the computer program being executed by the processor to cause the processor to perform the steps of the domain adaptation retrieval method according to any one of claims 1-5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed to implement the domain adaptation retrieval method according to any one of claims 1-5. The computer program is executed to implement the domain adaptation retrieval method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Automatic driving system domain self-adaption method based on iterative search optimization hash algorithm

    CN110334682A

  • Multi-label image retrieval method and equipment based on direct-push type zero sample hash

    CN110795590A