A context-aware intelligent retrieval method suitable for multi-domain heterogeneous data

By constructing domain-specific and shared encoders combined with contextual semantic learning and cross-domain semantic hashing retrieval models, the performance degradation of unsupervised domain adaptive hashing methods under cross-domain distribution differences is solved, improving retrieval performance and robustness while preserving image details and contextual information.

CN121301625BActive Publication Date: 2026-03-03SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511860418.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-03-03
Estimated Expiration
2045-12-11

AI Technical Summary

Technical Problem

Existing unsupervised domain adaptive hashing methods suffer from performance degradation under cross-domain distribution differences and lack utilization of the background context of the target domain image, resulting in poor retrieval performance.

Method used

A context-aware intelligent retrieval method is adopted. By constructing domain-specific and shared encoders, combining contextual semantic learning and cross-domain semantic hash retrieval models, the method utilizes domain-shared features and domain-specific features for fusion, and introduces mask consistency learning and pseudo-label update mechanisms to optimize the discrimination ability of hash codes.

Benefits of technology

It improves retrieval performance in cross-domain retrieval scenarios, achieves simple, adaptable and robust hash code generation, preserves image details and contextual relationships, and enhances the reliability of target domain pseudo-labels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121301625B_ABST
    Figure CN121301625B_ABST
Patent Text Reader

Abstract

The application relates to a context-aware intelligent retrieval method suitable for multi-domain heterogeneous data, relates to the technical field of intelligent retrieval and big data processing, combines domain semantic enhancement of context awareness with a cross-domain semantic hash retrieval model, and realizes effective alignment between a source domain and a target domain in a unified feature space. By constructing a domain-shared encoder and a domain-specific encoder, residual fusion strategy is adopted to integrate domain-shared features and domain-specific features, so that image detail information and context relationships are retained, and feature migration between domains is realized. In the training process, a domain classification loss and a distribution alignment strategy are used to ensure effective modeling of domain-specific information and domain-shared information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent retrieval and big data processing technology, specifically to a context-aware intelligent retrieval method applicable to multi-domain heterogeneous data. Background Technology

[0002] In recent years, with the explosive growth of multimodal and heterogeneous data on the Internet, achieving efficient and accurate similarity retrieval in large-scale heterogeneous data has become an important research direction in the field of information retrieval. Hash learning, due to its ability to map high-dimensional features to low-dimensional binary codes while balancing storage efficiency and retrieval speed, has been widely applied to tasks such as image retrieval and cross-modal retrieval. Compared with traditional real-valued retrieval methods, hashing not only reduces storage requirements but also enables fast similarity search through simple Hamming distance calculation, making it a practical solution for large-scale heterogeneous data retrieval tasks.

[0003] Hash methods can be categorized into supervised hashing and unsupervised hashing methods based on whether they contain labels. Supervised hashing methods utilize labeled information to train models, and due to the completeness of semantic information, the trained models typically perform better and have stronger retrieval performance. However, supervised hashing methods rely more heavily on labeled information, but in practice, labeled data is expensive, and unlabeled datasets are more common. Unsupervised hashing methods are more suitable for unlabeled scenarios and are less costly.

[0004] In practical applications, significant distributional differences often exist between the source and target domains, leading to a substantial performance degradation when directly applying hash models trained in the source domain to the target domain. To address this issue, researchers have proposed an unsupervised domain-adaptive hashing method that achieves knowledge transfer between labeled data in the source domain and unlabeled data in the target domain, thereby mitigating the performance degradation caused by cross-domain distributional differences. Using models trained on labeled data in the source domain, data in the target domain can be effectively retrieved. However, most existing methods primarily focus on domain-level distribution alignment and pseudo-label generation to guide learning. These methods largely concentrate on domain-level distribution alignment, rarely considering the contextual role of the background image and lacking other additional cues to aid training. In reality, the target domain image not only contains key subject parts, but its background also implicitly contains contextual cues that help correctly identify image content, especially prominent in complex image scenes. Summary of the Invention

[0005] In order to overcome the shortcomings of the above technologies, this invention provides a context-aware intelligent retrieval method applicable to multi-domain heterogeneous data that effectively improves retrieval performance and efficiency.

[0006] The technical solution adopted by this invention to overcome its technical problems is:

[0007] A context-aware intelligent retrieval method suitable for multi-domain heterogeneous data includes:

[0008] S1. Obtain the source domain dataset and source domain dataset All are categories Target domain dataset , , For the first Data from each source domain, , The number of data in the source domain. For the first Source domain data The corresponding tags , For the first Data for each target domain. , The number of data in the target domain;

[0009] S2. Transfer the target domain dataset Divided into training set and test set ;

[0010] S3. Transfer the source domain dataset The Middle Source domain data The input is fed into a domain-specific encoder to obtain source domain-specific features. , training set The Middle Data from each target domain The input is fed into a domain-specific encoder to obtain the target domain-specific features. , source domain dataset The Middle Source domain data The input is fed into the domain-shared encoder to obtain the source domain-shared features. , training set The Middle Data from each target domain The input is fed into the domain-shared encoder to obtain the target domain-shared features. ;

[0011] S4. Construct a contextual semantic learning model, incorporating source domain-specific features. Target domain specific features Source domain sharing characteristics Shared features of the target domain The input is fed into the contextual semantic learning model, and the output is the feature. and characteristics ;

[0012] S5. Utilizing Features and characteristics Obtain classification loss ;

[0013] S6. Utilizing Features and characteristics Obtain the domain classification loss ;

[0014] S7. Utilizing source domain sharing features and target domain shared features Obtain the domain alignment loss ;

[0015] S8. Construct a cross-domain semantic hash retrieval model to share features from the source domain. The input is fed into a cross-domain semantic hash retrieval model, and the output is a relaxed hash code. Shared features of the target domain The input is fed into a cross-domain semantic hash retrieval model, and the output is a relaxed hash code. ;

[0016] S9. Relaxed hash codes Binarization is performed to obtain a binary hash code. Using binary hash codes Retrieve the corresponding image;

[0017] S10. Utilizing Relaxed Hash Codes Relaxed hash codes Binary hash code Obtain hash loss ;

[0018] S11. Using the training set The Middle Data from each target domain Obtain mask consistency loss ;

[0019] S12. Through formula

[0020] The total loss was calculated. Using the Adam optimizer to achieve total loss Train the cross-domain semantic hash retrieval model to obtain the optimized cross-domain semantic hash retrieval model, where... , , , , All are weights.

[0021] Furthermore, in step S1, any two domains are randomly selected from the Artistic images (A), Clip Art (C), Product images (P), or Real-World images (R) domains of the Office-Home domain adaptation algorithm dataset as the source domain datasets. and target domain dataset .

[0022] Preferably, in step S2, the target domain dataset is... The training set was divided into two groups at a ratio of 9:1. and test set .

[0023] Furthermore, step S3 includes the following steps:

[0024] S3-1. The domain-specific encoder consists of a Vision Transformer model, a first linear layer, a first batch normalization (BN) layer, a ReLU activation function, a second linear layer, a second batch normalization (BN) layer, a dropout layer, and a third linear layer. The output dimension of the second linear layer is set to 512, and the dropout probability of the dropout layer is set to 0.5.

[0025] S3-2. Transfer the source domain dataset The Middle Source domain data The input is fed into a domain-specific encoder, and the output is the source domain-specific feature. , training set The Middle Data from each target domain The input is fed into a domain-specific encoder, and the output is the target domain-specific feature. ;

[0026] S3-3. The domain-shared encoder consists of a Vision Transformer model, a first linear layer, a first batch normalization (BN) layer, a ReLU activation function, a second linear layer, a second batch normalization (BN) layer, a dropout layer, and a third linear layer. The output dimension of the second linear layer is set to 1024, and the dropout probability of the dropout layer is set to 0.5.

[0027] S3-4. Transfer the source domain dataset The Middle Source domain data The input is fed into a domain-shared encoder, and the output is the source domain-shared feature. , training set The Middle Data from each target domain The input is fed into a domain-shared encoder, and the output is the target domain-shared feature. .

[0028] Furthermore, step S4 includes the following steps:

[0029] S4-1. The context semantic learning model consists of a first linear layer, a first batch normalization (BN) layer, a ReLU activation function, a second linear layer, a second batch normalization (BN) layer, and a third linear layer.

[0030] S4-2. Source domain specific features Features shared with the source domain After concatenation, the data is input into the context semantic learning model, and the output is the feature. , will feature Features shared with the source domain Perform feature fusion to obtain features ;

[0031] S4-3. Target domain specific features Sharing features with the target domain After concatenation, the data is input into the context semantic learning model, and the output is the feature. , will feature Sharing features with the target domain Perform feature fusion to obtain features .

[0032] Furthermore, step S5 includes the following steps:

[0033] S5-1. Construct the first classifier, which consists of a first linear layer, a first BN layer, a ReLU activation function, a Dropout layer, and a second linear layer in sequence.

[0034] S5-2. Features The input is fed into the first classifier, and the output is the label value. , will feature The input is fed into the first classifier, and the output is the label value. ;

[0035] S5-3. Training set The Middle Data from each target domain We obtain the initial pseudo-labels using weighted k-means clustering. Through formula The initial centroid is calculated. In the formula For training set The amount of data in the middle;

[0036] S5-4. Through formula The pseudo-labels of the target domain image are calculated. ;

[0037] S5-5. Through formula The centroid of the target domain updated by the pseudo-label is calculated. In the formula For indicator functions, when hour, ,when hour, ;

[0038] S5-6. Through formula The updated pseudo-labels of the target domain image are calculated. ;

[0039] S5-7. Calculate the label value With the Source domain data Corresponding tags The cross-entropy loss is used to obtain the loss value. Calculate label value Pseudo-labels of the updated target domain image The cross-entropy loss is used to obtain the loss value. Through formula The classification loss was calculated. .

[0040] Furthermore, step S6 includes the following steps:

[0041] S6-1. Construct a second classifier, which consists of a first linear layer, a first BN layer, a second linear layer, a ReLU activation function, a Dropout layer, and a third linear layer in sequence.

[0042] S6-2. Features The input is fed into the second classifier, and the output is the label value. , will feature The input is fed into the second classifier, and the output is the label value. ;

[0043] S6-3. Calculate the label value With the Source domain data Corresponding tags The cross-entropy loss is used to obtain the loss value. Calculate label value Pseudo-labels of the updated target domain image The cross-entropy loss is used to obtain the loss value. Through formula Calculate the domain classification loss .

[0044] Furthermore, step S7 includes the following steps:

[0045] S7-1. Construct a shared domain classifier, which consists of a first linear layer, a BN layer, a ReLU activation function, a second linear layer, and a Softmax function.

[0046] S7-2. Sharing Source Domain Features The input is fed into a shared-domain classifier, and the output is the value. ;

[0047] S7-3. Sharing features in the target domain The input is fed into a shared-domain classifier, and the output is the value. ;

[0048] S7-4. Calculated Values AND value The binary cross-entropy loss is used to obtain the domain alignment loss. ;

[0049] Furthermore, step S8 includes the following steps:

[0050] S8-1. The cross-domain semantic hash retrieval model consists of a first linear layer, a BN layer, a ReLU activation function, a second linear layer, and a Tanh activation function.

[0051] S8-2. Sharing Source Domain Features The input is fed into a cross-domain semantic hash retrieval model, and the output is a relaxed hash code. Shared features of the target domain The input is fed into a cross-domain semantic hash retrieval model, and the output is a relaxed hash code. .

[0052] Furthermore, step S10 includes the following steps:

[0053] S10-1. Through formula Calculate the similarity ;

[0054] S10-2. Through formula

[0055] Calculate the hash loss In the formula For training set The amount of data, It is the L2 norm. To calculate cosine similarity, For hyperparameters, The value is 0.0001.

[0056] Furthermore, step S11 includes the following steps:

[0057] S11-1. Construction and Training Set The Middle Data from each target domain Binary mask matrices of the same dimension binary mask matrix The value of each element in the array is either 0 or 1;

[0058] S11-2. Transfer the training set The Middle Data from each target domain With binary mask matrix Perform a multiplication operation to obtain the mask image. , mask image The input is fed into the contextual semantic learning model, and the output is the feature. ;

[0059] S11-3. Construct a third classifier, which consists of a first linear layer, a Batch Normalization (BN) layer, a ReLU activation function, a Dropout layer, and a second linear layer, sequentially processing the features. The input is fed into a third classifier, and the output is the predicted label of the masked image. ;

[0060] S11-4. Transfer the training set The Middle Data from each target domain The input is fed into a domain-specific encoder, and the output is the feature. , mask image The input is fed into a domain-shared encoder, and the output is the feature. , will feature With features Perform a splicing operation to obtain features. ;

[0061] S11-5. Construct a projection layer, which is composed of a first linear layer, a first batch normalization (BN) layer, a ReLU activation function, a second linear layer, a second batch normalization (BN) layer, and a third linear layer, in sequence, to project the features. The input is fed into the projection layer, and the output is the projected feature. ;

[0062] S11-6. Construct the fourth classifier, which consists of a first linear layer, a BN layer, a ReLU activation function, a Dropout layer, and a second linear layer in sequence.

[0063] S11-7. Features With projection features Perform a fusion operation to obtain features , will feature The input is fed into the fourth classifier, and the output is the predicted label of the masked image. Predict labels The input is fed into the Softmax function, and the output is the weight. ;

[0064] S11-8. Through formula The mask consistency loss was calculated. In the formula This is a transpose.

[0065] The beneficial effects of this invention are: combining context-aware domain semantic enhancement with a cross-domain semantic hashing retrieval model to achieve effective alignment between the source and target domains in a unified feature space. By constructing a domain-shared encoder and a domain-specific encoder, a residual fusion strategy is used to integrate domain-shared features and domain-specific features, thereby preserving image detail information and contextual relationships, and achieving cross-domain feature transfer. During training, domain classification loss and distribution alignment strategies are used to ensure effective modeling of domain-specific and domain-shared information. Simultaneously, this application introduces mask consistency learning, forcing the model to use local and contextual information for reasoning, enhancing the reliability of target domain pseudo-labels. Furthermore, a self-supervised pseudo-label update mechanism is adopted to gradually optimize the target domain category centroid and pseudo-label quality, thereby improving the discriminative power of the hash code. Finally, hash learning is performed in the domain-shared feature representation space to generate hash codes that maintain the similarity relationship between cross-domain and single-domain samples. The method of this application can effectively improve retrieval performance in complex cross-domain retrieval scenarios and has the advantages of simple implementation, strong adaptability, and good robustness. Attached Figure Description

[0066] Figure 1 This is a network structure diagram of the present invention. Detailed Implementation

[0067] The following is in conjunction with the appendix Figure 1 The present invention will be further described below.

[0068] A context-aware intelligent retrieval method suitable for multi-domain heterogeneous data includes:

[0069] S1. Obtain the source domain dataset and source domain dataset All are categories Target domain dataset , , For the first Data from each source domain, , The number of data in the source domain. For the first Source domain data The corresponding tags , For the first Data for each target domain. , The number of data in the target domain.

[0070] S2. Transfer the target domain dataset Divided into training set and test set .

[0071] S3. Transfer the source domain dataset The Middle Source domain data The input is fed into a domain-specific encoder to obtain source domain-specific features. , training set The Middle Data from each target domain The input is fed into a domain-specific encoder to obtain the target domain-specific features. , source domain dataset The Middle Source domain data The input is fed into the domain-shared encoder to obtain the source domain-shared features. , training set The Middle Data from each target domain The input is fed into the domain-shared encoder to obtain the target domain-shared features. .

[0072] S4. Construct a contextual semantic learning model, incorporating source domain-specific features. Target domain specific features Source domain sharing characteristics Shared features of the target domain The input is fed into the contextual semantic learning model, and the output is the feature. and characteristics .

[0073] S5. Utilizing Features and characteristics Obtain classification loss .

[0074] S6. Utilizing Features and characteristics Obtain the domain classification loss .

[0075] S7. Utilizing source domain sharing features and target domain shared features Obtain the domain alignment loss .

[0076] S8. Construct a cross-domain semantic hash retrieval model to share features from the source domain. The input is fed into a cross-domain semantic hash retrieval model, and the output is a relaxed hash code. Shared features of the target domain The input is fed into a cross-domain semantic hash retrieval model, and the output is a relaxed hash code. .

[0077] S9. Relaxed hash codes Binarization is performed to obtain a binary hash code. Using binary hash codes Retrieve the corresponding image.

[0078] S10. Utilizing Relaxed Hash Codes Relaxed hash codes Binary hash code Obtain hash loss .

[0079] S11. Using the training set The Middle Data from each target domain Obtain mask consistency loss .

[0080] S12. Through formula

[0081] The total loss was calculated. Using the Adam optimizer to achieve total loss Train the cross-domain semantic hash retrieval model to obtain the optimized cross-domain semantic hash retrieval model, where... , , , , All are weights. In one embodiment of the present invention, preferably... The value is 0.6. The value is 0.6. The value is 1.0. The value is 2.0. The value is 0.5.

[0082] Finally, we can use the test set The Middle Data from each target domain The input is fed into the optimized cross-domain semantic hash retrieval model to obtain a binary hash code. Using binary hash codes Retrieve the corresponding image.

[0083] In one embodiment of the present invention, in step S1, any two domains are randomly selected from the Artistic images (A) domain, Clip Art (C) domain, Product images (P) domain, or Real-Worldimages (R) domain of the domain adaptation algorithm dataset Office-Home as source domain datasets. and target domain dataset .

[0084] In one embodiment of the present invention, step S2 involves processing the target domain dataset. The training set was divided into two groups at a ratio of 9:1. and test set .

[0085] In one embodiment of the present invention, step S3 includes the following steps:

[0086] S3-1. The domain-specific encoder consists of a Vision Transformer model, a first linear layer, a first batch normalization (BN) layer, a ReLU activation function, a second linear layer, a second batch normalization (BN) layer, a dropout layer, and a third linear layer. The output dimension of the second linear layer is set to 512, and the dropout probability of the dropout layer is set to 0.5.

[0087] S3-2. Transfer the source domain dataset The Middle Source domain data The input is fed into a domain-specific encoder, and the output is the source domain-specific feature. , training set The Middle Data from each target domain The input is fed into a domain-specific encoder, and the output is the target domain-specific feature. .

[0088] S3-3. The domain-shared encoder consists of a Vision Transformer model, a first linear layer, a first batch normalization (BN) layer, a ReLU activation function, a second linear layer, a second batch normalization (BN) layer, a dropout layer, and a third linear layer. The output dimension of the second linear layer is set to 1024, and the dropout probability of the dropout layer is set to 0.5.

[0089] S3-4. Transfer the source domain dataset The Middle Source domain data The input is fed into a domain-shared encoder, and the output is the source domain-shared feature. , training set The Middle Data from each target domain The input is fed into a domain-shared encoder, and the output is the target domain-shared feature. .

[0090] In one embodiment of the present invention, step S4 includes the following steps:

[0091] S4-1. The contextual semantic learning model consists of a first linear layer, a first batch normalization (BN) layer, a ReLU activation function, a second linear layer, a second batch normalization (BN) layer, and a third linear layer.

[0092] S4-2. Source domain specific features Features shared with the source domain After concatenation, the data is input into the context semantic learning model, and the output is the feature. , will feature Features shared with the source domain Perform feature fusion to obtain features .

[0093] S4-3. Target domain specific features Sharing features with the target domain After concatenation, the data is input into the context semantic learning model, and the output is the feature. , will feature Sharing features with the target domain Perform feature fusion to obtain features .

[0094] In one embodiment of the present invention, step S5 includes the following steps:

[0095] S5-1. Construct the first classifier, which consists of a first linear layer, a first BN layer, a ReLU activation function, a Dropout layer, and a second linear layer.

[0096] S5-2. Features The input is fed into the first classifier, and the output is the label value. , will feature The input is fed into the first classifier, and the output is the label value. .

[0097] S5-3. Training set The Middle Data from each target domain We obtain the initial pseudo-labels using weighted k-means clustering. First, initial pseudo-labels for the target domain image are obtained using a method that most closely approximates the category features of the source domain. Due to domain offset, the initial pseudo-labels obtained based on the source domain are noisy. Therefore, self-supervised pseudo-label updates for the target domain are required. Specifically, this is achieved through the formula... The initial centroid is calculated. In the formula For training set The amount of data in the middle.

[0098] S5-4. Through formula The pseudo-labels of the target domain image are calculated. . No. Source domain data Corresponding tags and pseudo-labels All are in one-hot encoding format.

[0099] S5-5. Through formula The centroid of the target domain updated by the pseudo-label is calculated. In the formula For indicator functions, when hour, ,when hour, .

[0100] S5-6. Through formula The updated pseudo-labels of the target domain image are calculated. .

[0101] S5-7. Calculate the label value With the Source domain data Corresponding tags The cross-entropy loss is used to obtain the loss value. Calculate label value Pseudo-labels of the updated target domain image The cross-entropy loss is used to obtain the loss value. Through formula The classification loss was calculated. .

[0102] In one embodiment of the present invention, step S6 includes the following steps:

[0103] S6-1. Construct a second classifier, which consists of a first linear layer, a first BN layer, a second linear layer, a ReLU activation function, a Dropout layer, and a third linear layer.

[0104] S6-2. Features The input is fed into the second classifier, and the output is the label value. , will feature The input is fed into the second classifier, and the output is the label value. .

[0105] S6-3. Calculate the label value With the Source domain data Corresponding tags The cross-entropy loss is used to obtain the loss value. Calculate label value Pseudo-labels of the updated target domain image The cross-entropy loss is used to obtain the loss value. Through formula Calculate the domain classification loss .

[0106] In one embodiment of the present invention, step S7 includes the following steps:

[0107] S7-1. Construct a shared domain classifier, which consists of a first linear layer, a BN layer, a ReLU activation function, a second linear layer, and a Softmax function.

[0108] S7-2. Sharing Source Domain Features The input is fed into a shared-domain classifier, and the output is the value. ;

[0109] S7-3. Sharing features in the target domain The input is fed into a shared-domain classifier, and the output is the value. ;

[0110] S7-4. Calculated Values AND value The binary cross-entropy loss is used to obtain the domain alignment loss. ;

[0111] In one embodiment of the present invention, step S8 includes the following steps:

[0112] S8-1. The cross-domain semantic hash retrieval model consists of a first linear layer, a BN layer, a ReLU activation function, a second linear layer, and a Tanh activation function.

[0113] S8-2. Sharing Source Domain Features The input is fed into a cross-domain semantic hash retrieval model, and the output is a relaxed hash code. Shared features of the target domain The input is fed into a cross-domain semantic hash retrieval model, and the output is a relaxed hash code. .

[0114] In one embodiment of the present invention, step S10 includes the following steps:

[0115] S10-1. Through formula Calculate the similarity .

[0116] S10-2. Through formula

[0117] Calculate the hash loss In the formula For training set The amount of data, It is the L2 norm. To calculate cosine similarity, For hyperparameters, The value is 0.0001.

[0118] In one embodiment of the present invention, step S11 includes the following steps:

[0119] S11-1. Construction and Training Set The Middle Data from each target domain Binary mask matrices of the same dimension binary mask matrix The value of each element in the array is either 0 or 1.

[0120] S11-2. Transfer the training set The Middle Data from each target domain With binary mask matrix Perform a multiplication operation to obtain the mask image. , mask image The input is fed into the contextual semantic learning model, and the output is the feature. .

[0121] S11-3. Construct a third classifier, which consists of a first linear layer, a Batch Normalization (BN) layer, a ReLU activation function, a Dropout layer, and a second linear layer, sequentially processing the features. The input is fed into a third classifier, and the output is the predicted label of the masked image. .

[0122] S11-4. Transfer the training set The Middle Data from each target domain The input is fed into a domain-specific encoder, and the output is the feature. , mask image The input is fed into a domain-shared encoder, and the output is the feature. , will feature With features Perform a splicing operation to obtain features. .

[0123] S11-5. Construct a projection layer, which is composed of a first linear layer, a first batch normalization (BN) layer, a ReLU activation function, a second linear layer, a second batch normalization (BN) layer, and a third linear layer, in sequence, to project the features. The input is fed into the projection layer, and the output is the projected feature. .

[0124] S11-6. Construct the fourth classifier, which consists of a first linear layer, a BN layer, a ReLU activation function, a Dropout layer, and a second linear layer.

[0125] S11-7. Features With projection features Perform a fusion operation to obtain features , will feature The input is fed into the fourth classifier, and the output is the predicted label of the masked image. Predict labels The input is fed into the Softmax function, and the output is the weight. .

[0126] S11-8. Through formula The mask consistency loss was calculated. In the formula This is a transpose.

[0127] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A context-aware intelligent retrieval method suitable for multi-domain heterogeneous data, characterized in that, Comprising: S1. Obtain the source domain dataset and source domain dataset All are categories Target domain dataset , , For the first Data from each source domain, , The number of data in the source domain. For the first Source domain data The corresponding tags , For the first Data for each target domain. , The number of data in the target domain; S2. divide the target domain dataset into a training set and a test set ;​​ S3. Transfer the source domain dataset The Middle Source domain data The input is fed into a domain-specific encoder to obtain source domain-specific features. , training set The Middle Data from each target domain The input is fed into a domain-specific encoder to obtain the target domain-specific features. , source domain dataset The Middle Source domain data The input is fed into the domain-shared encoder to obtain the source domain-shared features. , training set The Middle Data from each target domain The input is fed into the domain-shared encoder to obtain the target domain-shared features. ; S4. Constructing a contextual semantic learning model, inputting source domain specific features , target domain specific features , source domain shared features , target domain shared features into the contextual semantic learning model, and outputting features and features ; S5. Utilizing features and features Obtaining classification loss ; S6. Utilizing features and features Obtaining domain classification loss ; S7. Utilize source domain shared features and target domain shared features to obtain domain alignment loss ; S8. Constructing a cross-domain semantic hash retrieval model, inputting the source domain shared features into the cross-domain semantic hash retrieval model, and outputting to obtain a relaxed hash code , inputting the target domain shared features into the cross-domain semantic hash retrieval model, and outputting to obtain a relaxed hash code ; S9. binarizing the relaxed hash code to obtain a binary hash code , and searching for the corresponding image by using the binary hash code ; S10. Utilizing the relaxed hash code , the relaxed hash code , the binary hash code , the hash loss ; S11. Using the training set The Middle Data from each target domain Obtain mask consistency loss ; S12. Through the formula The total loss is calculated The cross-domain semantic hash retrieval model is trained by using an Adam optimizer through the total loss to obtain an optimized cross-domain semantic hash retrieval model, wherein , , , , are weights.

2. The context-aware intelligent retrieval method suitable for multi-domain heterogeneous data according to claim 1, characterized in that: In step S1, any two domains are selected from the Artistic images (A) domain or the Clip Art (C) domain or the Product images (P) domain or the Real-World images (R) domain of the domain adaptation algorithm dataset Office-Home as the source domain dataset and the target domain dataset, respectively and the target domain dataset .

3. The context-aware intelligent retrieval method suitable for multi-domain heterogeneous data according to claim 1, characterized in that: The target domain dataset is divided in step S2 into a training set and a test set in a ratio of 9:1 and test set .​ 4. The context-aware intelligent retrieval method suitable for multi-domain heterogeneous data according to claim 1, characterized in that, Step S3 includes the following steps: S3-1. The domain-specific encoder is sequentially composed of a Vision Transformer model, a first linear layer, a first BN layer, a ReLU activation function, a second linear layer, a second BN layer, a Dropout layer, and a third linear layer, the output dimension of the second linear layer is set to 512, and the dropout probability of the Dropout layer is set to 0.5; S3-2. The source domain dataset is input into the domain-specific encoder, and the output is obtained as source domain-specific features The training set is input into the domain-specific encoder, and the output is obtained as target domain-specific features ;​​​​ S3-3. The domain-shared encoder is sequentially composed of a Vision Transformer model, a first linear layer, a first BN layer, a ReLU activation function, a second linear layer, a second BN layer, a Dropout layer, and a third linear layer, the output dimension of the second linear layer is set to 1024, and the dropout probability of the Dropout layer is set to 0.5; S3-4. The source domain dataset is input into the domain-shared encoder, and the source domain shared feature is output. The training set is input into the domain-shared encoder, and the target domain shared feature is output. is input into the domain-shared encoder, and the target domain shared feature is output. .

5. The context-aware intelligent retrieval method suitable for multi-domain heterogeneous data according to claim 1, characterized in that, Step S4 includes the following steps: S4-1. The context semantic learning model is sequentially composed of a first linear layer, a first BN layer, a ReLU activation function, a second linear layer, a second BN layer, and a third linear layer; S4-2. The source domain-specific features shared with the source domain are input into the context semantic learning model after the splicing operation, and the features are output. shared with the source domain are input into the context semantic learning model after the splicing operation, and the features are output. S4-3. The target domain specific features The target domain shared features The features are input into the context semantic learning model after the splicing operation, and the output is obtained The features are input into the context semantic learning model after the splicing operation, and the output is obtained The target domain shared features The features are input into the context semantic learning model after the splicing operation, and the output is obtained .

6. The context-aware intelligent retrieval method suitable for multi-domain heterogeneous data according to claim 1, characterized in that, Step S5 includes the following steps: S5-1. A first classifier is constructed, and the first classifier is sequentially composed of a first linear layer, a first BN layer, a ReLU activation function, a Dropout layer, and a second linear layer; S5-2. The features are input into the first classifier, and the output gets a label value , the features are input into the first classifier, and the output gets a label value ; S5-3. Obtain the initial pseudo-labels of the training set S5-4. Calculate the initial centroids of the target domain data using weighted k-means clustering , and obtain the initial pseudo-labels of the target domain data using the formula , where is the number of data in the training set .​ S5-4. Calculate the pseudo label of the target domain image by the formula S5-4. Calculate the pseudo label of the target domain image by the formula ; S5-5. The pseudo-label update target domain centroid is calculated by the formula S5-5. The pseudo-label update target domain centroid is calculated by the formula , wherein is an indicator function, when , , when , ; S5-6. Calculate the pseudo label of the updated target domain image by the formula ;​ S5-7. Calculate the label value The cross-entropy loss of the corresponding label of the first source domain data The cross-entropy loss of the corresponding label of the first source domain data The cross-entropy loss of the corresponding label of the first source domain data The cross-entropy loss of the corresponding label of the first source domain data The cross-entropy loss of the corresponding label of the first source domain data The cross-entropy loss of the corresponding label of the first source domain data The cross-entropy loss of the corresponding label of the first source domain data The cross-entropy loss of the corresponding label of the first source domain data The cross-entropy loss of the corresponding label of the first source domain data​ 7. The context-aware intelligent retrieval method suitable for multi-domain heterogeneous data according to claim 6, characterized in that, Step S6 includes the following steps: S6-1. A second classifier is constructed, and the second classifier is sequentially composed of a first linear layer, a first BN layer, a second linear layer, a ReLU activation function, a Dropout layer, and a third linear layer; S6-2. The features are input into the second classifier, and the label value is output , the features are input into the second classifier, and the label value is output ; S6-3. Calculate the label value The cross-entropy loss of the label corresponding to the first source domain data The cross-entropy loss of the label corresponding to the first source domain data The cross-entropy loss of the label corresponding to the first source domain data The cross-entropy loss of the label corresponding to the first source domain data The cross-entropy loss of the label corresponding to the first source domain data The cross-entropy loss of the label corresponding to the first source domain data The cross-entropy loss of the label corresponding to the first source domain data The cross-entropy loss of the label corresponding to the first source domain data The cross-entropy loss of the label corresponding to the first source domain data​ 8. The context-aware intelligent retrieval method suitable for multi-domain heterogeneous data according to claim 1, characterized in that: Step S7 includes the following steps: S7-1. A shared domain classifier is constructed, and the shared domain classifier is sequentially composed of a first linear layer, a BN layer, a ReLU activation function, a second linear layer, and a Softmax function; S7-2. The source domain shared features are input into the shared domain classifier, and the output values are obtained. S7-3. Target domain shared features input into the shared domain classifier, and the output gets a value ; S7-4. Calculated values With values Binary cross-entropy loss of ; Step S8 includes the following steps: S8-1. A cross-domain semantic hash retrieval model is sequentially composed of a first linear layer, a BN layer, a ReLU activation function, a second linear layer, and a Tanh activation function; S8-2. source domain shared features input into the cross-domain semantic hash retrieval model, and output to obtain a relaxed hash code target domain shared features input into the cross-domain semantic hash retrieval model, and output to obtain a relaxed hash code .

9. The context-aware intelligent retrieval method suitable for multi-domain heterogeneous data according to claim 6, characterized in that: Step S10 includes the following steps: S10-1. Calculate the similarity by the formula ;​ S10-2. Through the formula Computing the hash loss where is the training set number of data, is the L2 norm, is the cosine similarity, is a hyperparameter, with a value of 0.0001.

10. The context-aware intelligent retrieval method suitable for multi-domain heterogeneous data according to claim 4, characterized in that, Step S11 includes the following steps: S11-1. Constructing and training the set the target domain data in the middle of the same dimension binary mask matrix , each element in the binary mask matrix has a value of 0 or 1; S11-2. Transfer the training set The Middle Data from each target domain With binary mask matrix Perform a multiplication operation to obtain the mask image. , mask image The input is fed into the contextual semantic learning model, and the output is the feature. ; S11-3. Constructing a third classifier, the third classifier is sequentially composed of a first linear layer, a BN layer, a ReLU activation function, a Dropout layer, and a second linear layer, and the features are input into the third classifier, and the output is a predicted label of the mask image ; S11-4. Transfer the training set The Middle Data from each target domain The input is fed into a domain-specific encoder, and the output is the feature. , mask image The input is fed into a domain-shared encoder, and the output is the feature. , will feature With features Perform a splicing operation to obtain features. ; S11-5. Constructing a projection layer composed of a first linear layer, a first BN layer, a ReLU activation function, a second linear layer, a second BN layer, and a third linear layer in sequence, inputting the feature to the projection layer, and outputting a projection feature ; S11-6. A fourth classifier is constructed, and the fourth classifier is sequentially composed of a first linear layer, a BN layer, a ReLU activation function, a Dropout layer, and a second linear layer; S11-7. The feature is fused with the projected feature to obtain a feature , which is input into the fourth classifier to output a predicted label of the mask image ; the predicted label is input into a Softmax function to output a weight ; and the weight is output. S11-8. The mask consistency loss is calculated by the formula is the transpose.​​

Citation Information

Patent Citations

  • Cross-domain medical image classification system and method based on domain self-adaption

    CN112767368A

  • Image retrieval method based on unsupervised domain adaptive hash

    CN117874277A