A domain adaptation image recognition classification method in a passive continuous scene, a storage medium and an electronic device

By constructing a negative sample dataset and quantizing sample quality through semantic reconstruction and invariant quantization methods, and combining it with a memory storage module, the distribution shift and forgetting problems of the model in passive continuous scenarios are solved, thereby improving the accuracy and robustness of image recognition.

CN120088538BActive Publication Date: 2025-11-28SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510055430.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-11-28
Estimated Expiration
2045-01-14

AI Technical Summary

Technical Problem

In passive continuous learning scenarios, existing technologies cannot effectively solve the performance degradation and catastrophic forgetting problems caused by the distribution shift between the target domain and the source domain, especially the inability to continuously learn and adapt to new environments under unsupervised conditions.

Method used

We employ semantic reconstruction and invariant quantization methods. By constructing a negative sample dataset that is semantically similar to the source domain, we quantify the quality of the target samples, assign weights to the samples, select high-quality samples to train the model, and combine a memory storage module to alleviate the forgetting problem.

Benefits of technology

The model's robustness and adaptability in multi-domain adaptation tasks were improved, catastrophic forgetting was reduced, and the accuracy of image recognition was increased, especially with average accuracy improvements of 4.9%, 7.3%, and 10.2% on the Office-31, Office-Home, and DomainNet datasets, respectively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120088538B_ABST
    Figure CN120088538B_ABST
Patent Text Reader

Abstract

The application relates to the field of machine learning and relates to a domain adaptation image recognition classification method in a passive continuous scene, a storage medium and an electronic device. The method comprises the following steps: performing source domain data enhancement processing and constructing a confusion matrix; performing semantic reorganization on the confusion matrix to obtain a negative sample dataset; training an image quality quantification model by using the negative sample dataset and the source domain data; performing invariance quantification processing on image samples of a target dataset; training a target model, performing feature extraction on target domain image data in a current incremental task at the end of each training round, and storing the extraction processing result; performing source label recognition; optimizing a total loss function of the target model, training and optimizing the target model, and obtaining a final target model to recognize target domain images in a passive continuous adaptive scene. The application solves the performance decline problem caused by domain offset in passive continuous domain adaptation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of machine learning, and particularly relates to a domain adaptation image recognition classification method in a source-free continual scenario, a storage medium and an electronic device. BACKGROUND

[0002] Although the current deep learning model has shown great potential in various applications, in practical applications, the model will be affected by distribution shift. That is, when the training source domain and the application target domain data come from different distributions, the performance of the model will decrease significantly when applied to a new target domain. Therefore, the unsupervised domain adaptation method for aligning the data distribution of the source domain and the target domain has become an important means to solve this challenge.

[0003] However, most unsupervised domain adaptation methods require access to source data, which is not applicable in the case of privacy protection or data corruption. Therefore, source-free unsupervised domain adaptation methods that adapt directly in the target domain without accessing source data have also been studied. However, when the model is in the process of continual learning, the source-free unsupervised domain adaptation method will have a catastrophic forgetting of the learned knowledge. In addition, although the traditional class-incremental learning method can learn new knowledge while retaining existing knowledge, thereby solving the forgetting problem, it cannot effectively deal with the domain shift problem.

[0004] Therefore, the source-free continual adaptation scenario, which can continuously learn and adapt to new environments without accessing source data, is very important for real-world applications. For example, the recognition system in autonomous driving may initially be trained based on urban environments, but when the vehicle is driving in rural or mountainous areas, the model needs to continuously adapt to new scenarios and learn new data unsupervisedly due to the significant difference between the target domain and the source domain (urban environment). At the same time, due to privacy or storage capacity limitations, the source data of the urban environment during training may not be available. This scenario actually requires the model to be able to continuously learn and adapt to object classification tasks in new environments without accessing source data. SUMMARY

[0005] The application provides a domain adaptation image recognition classification method in a source-free continual scene, a storage medium and an electronic device.

[0006] In an embodiment of the application, a domain adaptation image recognition classification method in a source-free continual scene comprises the following steps:

[0007] S1, performing enhancement processing on source domain data, inputting the enhanced samples into a source domain model to obtain a prediction result, and constructing a confusion matrix according to the prediction result;

[0008] S2, performing semantic restructuring on the confusion matrix to obtain a negative sample dataset similar to the semantics of the source domain; training an image quality quantification model using the negative sample dataset and the source domain data to obtain an image quality quantification model Mn with a divided decision boundary;

[0009] S3, performing invariance quantification processing on image samples of a target dataset, inputting any image sample of the target dataset into the quality quantification model Mn to obtain the probability of the input image sample being classified into each image category; further quantifying the quality of the inherent characteristics of the input image sample in each image category to measure the quality of the input image sample, and giving different weights to the input image sample according to the quality;

[0010] S4, training a target model, at the end of each training round, the target model extracts features from target domain image data in the current incremental task, calculates feature centers of each image category, and calculates the distance from each target domain image data to the feature center, and selects a preset amount of images with smaller distances for each image category for storage;

[0011] S5, accumulating the weights of all image samples classified into each image category to obtain a weight statistical value; comparing the weight statistical value with a preset threshold value, when the weight statistical value of any image category is greater than the preset threshold value, judging that the image samples of the corresponding image category exist in large quantities in the current batch, to identify the image categories most likely to be contained in each batch, and obtaining image sample labels;

[0012] S6, optimizing the total loss function of the target model, training and optimizing the target model, and obtaining a final target model to recognize target domain images in a source-free continual adaptation scene;

[0013] Wherein the total loss function includes the cross-entropy loss of the target domain image in the current incremental task, the contrastive learning loss of different category target domain images and the cross-entropy loss of the stored image in step S4.

[0014] Based on the same inventive concept, the domain adaptation image recognition classification system in the passive continuous scene in the embodiment of the application is realized based on the above classification method, and the classification system comprises:

[0015] The data enhancement module is used for enhancing the source domain dataset and constructing a confusion matrix.

[0016] The semantic reorganization module is used for reorganizing the semantic of the confusion matrix to obtain a negative sample dataset similar to the source domain semantic, training the image quality quantization model using the negative sample dataset and the source domain data to obtain the image quality quantization model Mn with a divided decision boundary.

[0017] The invariance quantization module is used for invariance quantization processing of the image samples of the target dataset, inputting an arbitrary image sample of the target dataset into the quality quantization model Mn to obtain the probability of the input image sample being divided into each image category, and quantizing the quality of the inherent features of the input image sample in each image category to measure the quality of the input image sample, and assigning different weights to the input image sample according to the quality.

[0018] The memory storage module is used for training the target model, and at the end of each training round, the target model extracts features of the target domain image data in the current incremental task, calculates the feature centers of each image category, and calculates the distance of each target domain image data to the feature center, and selects a preset amount of images with smaller distance for each image category for storage.

[0019] The source label recognition module is used for accumulating the weights of all image samples classified into each image category to obtain a weight statistical value, and comparing the weight statistical value with a preset threshold value, and when the weight statistical value of any image category is greater than the preset threshold value, it is judged that the image samples of the corresponding image category exist in large quantities in the current batch, so as to identify the image categories most likely to be contained in each batch to obtain the image sample label.

[0020] The prediction recognition module is used for optimizing the total loss function of the target model, training and optimizing the target model to obtain the final target model, and recognizing the target domain image in the passive continuous adaptive scene.

[0021] The storage medium of the embodiment of the application has computer instructions stored thereon, and the computer instructions are executed by the processor to realize the steps of the above classification method.

[0022] The electronic device of the embodiment of the application comprises a memory, a processor and a computer program stored on the memory, the computer program being executable on the processor, and the processor executes the steps of the classification method when executing the computer program.

[0023] Compared with the prior art, the application has the following advantages and effects:

[0024] 1. Semantic reconstruction is adopted, a negative sample dataset similar to the source domain semantics is constructed, the model can be trained on positive and negative samples at the same time, so as to accurately configure the decision boundary; through the participation of negative samples in the training of the model, the recognition ability of the model to negative classes is enhanced, the robustness of the model is improved, and high adaptability can be maintained in various domain adaptation tasks.

[0025] 2. Invariance quantification is adopted, the probabilities output by the pre-trained model are used for invariance quantification of the target sample, the sample is given a weight, the model can select high-quality samples for training, and it is ensured that both catastrophic forgetting and domain shift can be alleviated in a source-free environment; the catastrophic forgetting of the model in the continuous learning process is effectively reduced, and the long-term adaptability is improved.

[0026] 3. Experiments show that, compared with the prior art, the average accuracy of the application on the Office-31, Office-Home and DomainNet datasets is improved by 4.9%, 7.3% and 10.2% respectively. BRIEF DESCRIPTION OF DRAWINGS

[0027] Figure 1 It is a comparative schematic diagram of domain adaptation, source-free domain adaptation, incremental domain adaptation and source-free incremental domain adaptation.

[0028] Figure 2 It is a flowchart of the domain adaptation image recognition classification method in the source-free continuous scenario in the embodiment of the application.

[0029] Figure 3 It is a general framework schematic diagram of the domain adaptation image recognition classification system in the source-free continuous scenario in the embodiment of the application. DETAILED DESCRIPTION

[0030] The application will be described in further detail below with reference to the embodiments and the accompanying drawings, but the embodiments of the application are not limited thereto.

[0031] EMBODIMENT

[0032] In this embodiment, a domain adaptation image recognition classification method in a passive continuous scene is proposed, which is mainly realized through semantic reorganization and sample invariance quantization in passive continuous self-adaptation. The purpose is to accurately classify the unlabeled images in the target domain into the corresponding categories without accessing the source domain dataset, continuously learn new target domain images, reduce the catastrophic forgetting of historical images, and improve the robustness and generalization ability of the model.

[0033] Figure 1 The comparison of domain adaptation, passive domain adaptation, incremental domain adaptation and passive incremental domain adaptation is shown, wherein different boxes represent different tasks, and the lock represents that the corresponding arrow data cannot be used. Domain adaptation can use the source domain dataset and only needs to be trained for one task; incremental domain adaptation can use the source domain dataset and needs to be trained for multiple tasks; passive domain adaptation cannot use the source domain dataset and only needs to be trained for one task; passive incremental domain adaptation cannot use the source domain dataset and needs to be trained for multiple tasks. Some terms involved are described as follows:

[0034] (a) Domain Adaptation (DA)

[0035] The source domain data contains labeled images, and the source domain model is obtained by training. The target domain data is unlabeled image, and the image category is consistent with that of the source domain image. The source domain model needs to be continuously trained for the image of the target domain to achieve the purpose of accurately recognizing the unlabeled image of the target domain. The training stage can use the unlabeled target domain data and the labeled source domain data for training.

[0036] (b) Source-Free Domain Adaptation (SFDA)

[0037] The source domain data contains labeled images, and the source domain model is obtained by training. The target domain data is unlabeled image, and the image category is consistent with that of the source domain image. The source domain model cannot use the source domain data during the continuous training process for the image of the target domain, and can only use the target domain data for training.

[0038] (c) Class Incremental Domain Adaptation (CIDA)

[0039] The same as (a), the model can still use the source domain data during the target domain training stage after training. For the unlabeled target domain image, although the source domain data can be accessed during training, the target domain data can only be used in batches, and the training is divided into multiple stages, each stage is performed in turn, and each stage can only use part of the target domain data of the current stage for training, and cannot use the target domain data of the previous stage.

[0040] (d) Source-Free Continual Adaptation (SFCA)

[0041] The scenario is applicable to the present application. The source domain data contains labeled images, and the source domain model is obtained by training the model. Only the source domain model 3 can be used in the target domain training stage, and the source domain data cannot be used. For target domain data, training is divided into multiple stages, each stage is performed in turn, and each stage can only use part of the target domain data of the current stage for training, and the target domain data of the previous stage cannot be used any more.

[0042] The target domain data is unlabeled image. The training stage cannot use the labeled source domain data, only the source domain model can be used. And the same target domain data in (c) can only be used in batches. Finally, the performance of the model on all target domain data needs to be verified.

[0043] As shown in Figure 2 The steps of the embodiment specifically include:

[0044] Step 1, perform enhancement processing on the source domain data, input the enhanced samples into the source domain model to obtain a prediction result, and construct a confusion matrix according to the prediction result.

[0045] The source domain data X t After data enhancement, an enhanced image that is not the same as the belonging category in local features (such as rotating, scaling, changing color, etc. on the original image) is generated. The prediction result is obtained by inputting the enhanced sample into the source domain model Mp. Because of the similarity of these enhanced samples in features (such as the similarity between the pencil image and the pen image after changing color), the model will misclassify part of the enhanced images. According to the prediction result, a confusion matrix can be constructed. For any image category, the confusion matrix can provide the classification statistics of all image samples of the image category, so that the category that is most misclassified except for the self category (i.e. the category most similar to the current category) can be selected.

[0046] Step 2, semantic reconstruction: the semantic matrix is reorganized to obtain a negative sample data set similar to the source domain semantics; the image quality quantization model is trained using the negative sample data set and the source domain data to obtain an image quality quantization model Mn with divided decision boundary.

[0047] Through the confusion matrix in step 1, all categories with high similarity to the source domain category are selected, and multiple groups of similar category pairs where y s is the source category, the most similar class to the source class. Arbitrarily select one image from each of the similar class pairs, and cut the two images along the same split line to obtain half of the original image. The different halves of the two images are spliced to obtain the negative example dataset (i.e., the negative sample dataset).

[0048] The image quality quantification model is trained using the negative example dataset and the source domain data, and an image quality quantification model Mn with a divided decision boundary is obtained. Through the output result of the sample and the invariance quantification method, the sample quality can be measured during the training process, so that the target model is more inclined to train high-quality images, thereby improving the model performance.

[0049] Step 3, invariance quantification: the image samples of the target dataset are subjected to invariance quantification processing. Any image sample of the target dataset is input into the quality quantification model Mn to obtain the probability of the input image sample being classified into each image class. The quality of the inherent features of the input image sample in each image class is quantified to measure the quality of the input image sample, and different weights are assigned to the input image sample according to the quality.

[0050] Invariance quantification is a method for measuring image quality. Any image sample is input into the quality quantification model Mn obtained in step 2 to obtain the probability of the input image sample being classified into each image class. When the probability of a certain image class is high, for example, exceeding a predetermined probability value, it means that the input image sample contains a large number of inherent features (invariance) unique to the image class, for example, an image recognized as a class of "person" has clear facial features, torso and limbs. By quantifying the quality of the inherent features of the input image sample in each image class, the quality of the input image sample can be measured.

[0051] Specifically, different weights are assigned to the image sample according to its position in the feature space, as follows:

[0052]

[0053]

[0054] wherein x t is the image sample to be quantified, is the probability of the image sample being classified into the i-th class, C s is the source domain label set, C n is the negative class (i.e., negative sample) label set, is the sum of the probabilities of the image sample being classified into the negative class, and W n (x t) is an indicator measuring how far the image sample is from the decision boundary (the farther the image sample is from the decision boundary, the larger the indicator is), W p (x t ) is an indicator measuring how close the image sample is to the class feature center (the closer the image sample is to the feature center, the smaller the indicator is), W p (x t ) and W n (x t ) to obtain W(x t ) to measure the overall quality of the image sample.

[0055] When the image sample is outside the decision boundary, it means that the image sample lacks obvious classification features, the image sample quality is poor, W n (x t ) is high, W(x t ) is small, and the image sample is given a lower weight at this time. On the contrary, the closer the image sample is to the class feature center, the higher the image sample quality is, W p (x t ) is high, W(x t ) is large, and the image sample gets a higher weight.

[0056] Step 4, memory storage: the target model is trained, at the end of each training round, the target model extracts features from the target domain image data in the current incremental task, calculates the feature centers of each image category, and calculates the distance from the feature to the feature center. For each image category, select N images with smaller distance to store.

[0057] After the invariance quantization processing in step 3, the target model needs to store the target domain image data in the current incremental task. After each training, the target model first extracts the features of each target domain image data using the feature extractor G(·), then averages the features of all target domain image data belonging to the same image category to calculate the feature center μ of each image category, and calculates the distance from each target domain image data to the feature center μ. For each image category, select N images closest to the feature center (i.e. smaller distance) to store (i.e. higher quality images), the formula is as follows:

[0058]

[0059] Where μ k is the feature center of the kth image category, is the i-th image to be stored for the kth image category, D k is the image data set of the kth image category, x i is the image to be selected for storage, x jFor the stored images.

[0060] In the next training task, the target model is trained only on the target domain images in the current incremental task and the stored images to maintain the memory of old knowledge, thereby alleviating the catastrophic forgetting problem faced by the target model in the continual learning and improving the generalization ability of the target model.

[0061] Step 5, source label identification: the weights of all image samples classified into each image category are accumulated to obtain a weight statistical value; the weight statistical value is compared with a preset threshold value, and when the weight statistical value of any image category is greater than the preset threshold value, it is judged that the image samples of the corresponding image category exist in large quantities in the current batch, so as to identify the image categories most likely to be contained in each batch and obtain the image sample label.

[0062] To further reduce the influence of noise in the unlabeled images on the performance of the target model, the embodiment obtains a weight W(x t for each image sample through the formula and the quality quantification model Mn in step 3, and the weights of all image samples classified into each image category are accumulated to obtain a weight statistical value v k , where k represents the kth image category. When the weight statistical value v k of any image category is greater than a preset threshold value a, it is considered that the image samples of the kth category exist in large quantities in the current batch, so that the image categories most likely to be contained in each batch can be identified. This method can reduce the possibility of misidentification of images, thereby reducing training noise and improving sample quality.

[0063] Step 6, optimizing the total loss function of the target model, training and optimizing the target model to obtain the final target model to identify the target domain images in the source-free continual adaptive scene.

[0064] In combination with the above modules, the total loss function L includes the cross-entropy loss L CE of the target domain images in the current incremental task, the contrastive learning loss L con of different categories of target domain images, and the cross-entropy loss L bank of the stored images in step 4.

[0065] L=L CE +λL con +L bank

[0066]

[0067] Where X t is the image sample space of the current incremental task, x bank is the sample space of the stored images in step 4, and w(x t) is the corresponding image sample weight, y i is the corresponding image sample label, c b is the stored image sample label set, c + is the feature center of the category to which the image sample belongs, c i is the feature center of the remaining image categories; τ and λ are weight parameters for controlling the influence of the contrast learning loss. By training the target model to optimize the above loss function, the target model can accurately recognize the target domain images in the source-free continuous adaptive scene.

[0068] The embodiment realizes accurate classification of image sample categories on the unlabeled target domain through the above steps. Compared with the best method at present, the average accuracy on the Office-31, Office-Home and DomainNet data sets is improved by 4.9%, 7.3% and 10.2% respectively, and higher stability is shown in dealing with domain migration and catastrophic forgetting problems.

[0069] It can be seen that the embodiment proposes a new invariance quantification based on the source-free continuous adaptive (SFCA) framework, divides the decision boundary for the model by selecting pictures of higher similarity categories for image cropping and reconstruction, filters out pictures of higher quality using the invariance quantification method, stores historical high-quality images to reduce catastrophic forgetting of historical data, and identifies possible image categories in an unsupervised target domain, thereby realizing accurate classification of unlabeled target domain pictures. The embodiment solves the problem that the existing technology cannot simultaneously alleviate domain migration and catastrophic forgetting in a source-free continuous adaptive scene, thereby improving the robustness and generalization ability of the model, and achieving accurate recognition of images.

[0070] As Figure 3 shown, the embodiment also proposes a domain adaptation image recognition classification system in a source-free continuous scene, and the overall framework mainly includes a target model, a memory storage module (Memory Buffer), a source label identification module (Prototype Identification), a semantic restructuring module (Semantic Restruction) and an invariance quantification module (Invariance Quantification).

[0071] Data enhancement module: used for enhancing the source domain dataset (Source Datasets) and constructing a confusion matrix. The source domain dataset is used to train the source domain model Mp and construct a negative example dataset.

[0072] Semantic Restruction module: the semantic restructuring of the confusion matrix is performed to obtain a negative sample dataset similar to the source domain semantics; the image quality quantification model is trained using the negative sample dataset and the source domain data to obtain an image quality quantification model Mn with a divided decision boundary.

[0073] When the negative sample dataset is generated, similar categories are selected from the confusion matrix, and images of similar categories are cropped and recombined to construct the negative sample dataset.

[0074] The quality quantification model Mn is trained by the source domain data and the negative example data, and the image quality can be quantified through the decision boundary divided in the training process.

[0075] Invariance Quantification module: the image samples of the target dataset are subjected to invariance quantification processing, any image sample of the target dataset is input into the quality quantification model Mn, the probability of the input image sample being divided into each image category is obtained, the quality of the inherent features of the input image sample in each image category is quantified to measure the quality of the input image sample, and different weights are given to the input image sample according to the quality.

[0076] In this embodiment, the invariance quantification module gives different weights to different pictures according to the output of the model Mn (i.e. the position of the image feature in the space) and the quantification formula. When the image feature is outside the decision boundary of the model, it means that the image quality is low, and the formula gives the image a lower weight. On the contrary, the weight of the high-quality image is higher. In this way, the model is more inclined to learn high-quality images, and the robustness of the model is improved.

[0077] Memory Buffer module: the target model is trained, at the end of each training round, the target model extracts features from the target domain image data in the current incremental task, calculates the feature centers of each image category, and calculates the distance from each target domain image data to the feature center, and selects a preset amount of images with smaller distance for each image category for storage.

[0078] In this embodiment, the memory storage module is used to store the images of past batches for continuous training in subsequent tasks, and to alleviate the problem of catastrophic forgetting of historical images by the model due to the passage of time.

[0079] The source label identification module: the weight statistics of all image samples classified into each image category are accumulated to obtain weight statistics; the weight statistics are compared with a preset threshold, and when the weight statistics of any image category is greater than the preset threshold, it is judged that the image samples of the corresponding image category exist in the current batch, so as to identify the image categories most likely to be contained in each batch, and obtain the image sample labels.

[0080] Since the target domain image is unlabeled, the source label identification module can identify the image categories most likely to exist in each batch, thereby reducing label noise and improving sample quality.

[0081] The prediction identification module: the total loss function of the target model is optimized, the target model is trained and optimized, and the final target model is obtained to identify the target domain image in the sourceless continuous adaptive scene.

[0082] Based on the same inventive concept, the embodiment also provides a storage medium having computer instructions stored thereon, the computer instructions being executed by a processor to implement steps S1-S6 of the classification method of the embodiment.

[0083] Correspondingly, the embodiment also provides an electronic device including a memory, a processor, and a computer program stored on the memory, wherein the computer program can run on the processor, and when the processor executes the computer program, steps S1-S6 of the classification method of the embodiment are executed.

[0084] The technical solutions of the present application essentially or say the part that contributes to the prior art, or the whole or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), magnetic disk or optical disk, and various program code storage media.

[0085] The above is only the preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A domain-adaptive image recognition and classification method for passive continuous scenes, characterized in that, Includes the following steps: S1. Perform augmentation processing on the source domain data, input the augmented samples into the source domain model to obtain the prediction results, and construct the confusion matrix based on the prediction results; S2. Semantically reorganize the confusion matrix to obtain a negative sample dataset that is semantically similar to the source domain; The image quality quantization model is trained using negative sample datasets and source domain data to obtain an image quality quantization model Mn with defined decision boundaries; S3. Perform invariant quantization processing on the image samples of the target dataset. Input any image sample of the target dataset into the quality quantization model Mn to obtain the probability of the input image sample being assigned to each image category. Then quantify the quality of the inherent features of the input image sample in each image category to measure the quality of the input image sample. Assign different weights to the input image sample according to the quality. S4. Train the target model. At the end of each training round, the target model extracts features from the target domain image data in the current incremental task, calculates the feature center of each image category, and calculates the distance from the feature of each target domain image data to the feature center. Selects a preset number of images with smaller distances for each image category and stores them. S5. Accumulate the weights of all image samples classified into each image category to obtain the weight statistics. The weight statistics are compared with a preset threshold. When the weight statistics of any image category are greater than the preset threshold, it is determined that a large number of image samples of the corresponding image category exist in the current batch, so as to identify the image category most likely to be included in each batch and obtain the image sample label. S6. Optimize the total loss function of the target model, train and optimize the target model to obtain the final target model, so as to recognize the target domain image in the passive continuous adaptive scenario; The total loss function includes the cross-entropy loss of the target domain image in the current incremental task, the contrastive learning loss of target domain images of different categories, and the cross-entropy loss of the images stored in step S4.

2. The domain-adaptive image recognition and classification method according to claim 1, characterized in that, The process of obtaining the negative sample dataset in step S2 includes: After selecting all categories with high similarity to the source domain categories using the confusion matrix, multiple sets of similar category pairs are obtained. Where y s It is the source category. The category is the most similar to the source category. From a set of similar category pairs, one image is randomly selected from each pair. The two images are cropped along the same dividing line to obtain half of the original image. The different halves of the two images are spliced ​​and recombined to obtain the negative sample dataset.

3. The domain-adaptive image recognition and classification method according to claim 1, characterized in that, The invariance quantization process in step S3 includes: Any image sample is input into the quality quantization model Mn to obtain the probability of the input image sample being assigned to each image category; when the probability of a certain image category exceeds a preset probability value, the quality of the inherent features of the input image sample in each image category is quantified by a formula to measure the quality of the input image sample.

4. The domain-adaptive image recognition and classification method according to claim 3, characterized in that, The formula is: Where, x t For the image sample to be quantized, Let C be the probability that an image sample is assigned to the i-th image category. s For the source domain tag set, C n For negative sample label set, W is the sum of probabilities that an image sample is classified as a negative sample. n (x t W is an indicator used to measure whether an image sample falls outside the decision boundary. p (x t To measure the proximity of image samples to the center of class features, W is combined. p (x t ) and W n (x t ) to obtain W(x t This is used to measure the overall quality of image samples.

5. The domain-adaptive image recognition and classification method according to claim 1, characterized in that, The calculation formula for selecting and storing the image in step S4 is as follows: Where μ k For the feature center of the k-th image category, To store the i-th image for the k-th image category, D k For the image dataset of the k-th image category, x i To select and store the image, x j For images that have already been stored.

6. The domain-adaptive image recognition and classification method according to claim 1, characterized in that, In step S6, the total loss function L and the cross-entropy loss L of the target domain image in the current incremental task are... CE Contrast learning loss L for different categories of target domain images con And, the cross-entropy loss L of the stored image bank They are respectively: L=L CE +λL con +L bank Among them, X t For the image sample space of the current incremental task, X bank For the sample space of the image stored in step S4, w(x) t ) represents the corresponding image sample weight, y i C represents the corresponding image sample label. b For the stored image sample label set, c + c represents the feature center of the category to which the image sample belongs. i τ represents the feature centers for the remaining image categories; τ and λ are weight parameters used to control the influence of the contrastive learning loss.

7. A domain-adaptive image recognition and classification system for passive continuous scenes, characterized in that, The classification system is implemented based on any one of the classification methods in claims 1-6, and includes: Data augmentation module: used to augment the source domain dataset and construct a confusion matrix; The semantic recombination module performs semantic recombination on the confusion matrix to obtain a negative sample dataset that is semantically similar to the source domain; the negative sample dataset and the source domain data are used to train the image quality quantization model to obtain an image quality quantization model Mn with defined decision boundaries; Invariant Quantization Module: Performs invariant quantization processing on image samples of the target dataset. Inputs any image sample from the target dataset into the quality quantization model Mn to obtain the probability of the input image sample being assigned to each image category. Then, it quantifies the quality of the inherent features of the input image sample in each image category to measure the quality of the input image sample and assigns different weights to the input image sample according to the quality. Memory storage module: Train the target model. At the end of each training round, the target model extracts features from the target domain image data in the current incremental task, calculates the feature center of each image category, and calculates the distance from the feature of each target domain image data to the feature center. It then selects a preset number of images with smaller distances for each image category for storage. Source label recognition module: The weights of all image samples classified into each image category are accumulated to obtain a weight statistical value; the weight statistical value is compared with a preset threshold. When the weight statistical value of any image category is greater than the preset threshold, it is determined that a large number of image samples of the corresponding image category exist in the current batch, so as to identify the image category most likely to be included in each batch and obtain the image sample label. Prediction and Recognition Module: Optimizes the total loss function of the target model, trains and optimizes the target model to obtain the final target model, so as to recognize the target domain image in a passive continuous adaptive scenario.

8. A storage medium storing computer instructions thereon, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the classification method according to any one of claims 1-6.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory, said computer program being executable on the processor, characterized in that, When the processor executes the computer program, it performs the steps of the classification method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Cross-domain remote sensing scene classification and retrieval method based on self-supervised contrast learning

    CN115471739A

  • Self-adaptive model training method and device and terminal equipment

    CN119004236A