Model extraction training method and device of high-resolution image classification model, terminal and medium
By employing a multi-cooperative selection mechanism and a superpixel gradient alignment algorithm, the overfitting problem in the training of high-resolution image classification models is solved, thereby improving training efficiency and model accuracy, and enhancing the model's generalization ability.
Patent Information
- Application Number
- CN202511379812.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-09-25
AI Technical Summary
Existing technologies are prone to overfitting when training alternative models for high-resolution image classification, leading to a decline in model performance.
We employ a multi-cooperative screening mechanism and a model training algorithm based on superpixel gradient alignment. By sampling for diversity, uncertainty, and differences, we select the data samples with the greatest gain effect and use superpixel gradient alignment to provide rich supervision information to prevent model overfitting.
It improves the training efficiency and generalization ability of the model, reduces the number of queries to the target model, and enhances the accuracy of feature extraction and the consistency of the model.
Smart Images

Figure CN120852896B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a model extraction training method and device of a high-resolution image classification model, a terminal and a medium. BACKGROUND
[0002] Model extraction training can promote complex model migration and knowledge reuse. Through extraction training, a training party obtains a substitute model at a lower training cost. However, the current extraction training method for image classification models mainly targets low-resolution images, such as the CIFAR-10 image dataset (e.g., image resolution ≦ 32x32), and for image classification models (target models) that process low-resolution images, a substitute model with similar functions to the target model can be trained by using only the classification label information output by the target model and through simple cross-entropy loss function optimization, that is, by directly reusing the classification label information output by the target model, without additional annotation data or complex annotation processes, the data preparation cost can be significantly reduced, thereby simplifying the training process.
[0003] However, compared with low-resolution images, high-resolution images (e.g., resolution ≧ 224x224) contain exponentially increasing features in terms of quantity and complexity, while the supervision information provided by the classification label remains unchanged. Therefore, when training a model with similar functions to the target model for an image classification model (target model) that processes high-resolution images through the above method, overfitting is likely to occur, resulting in a significant decline in the performance of the model.
[0004] Therefore, the prior art has defects and needs to be improved and developed. SUMMARY
[0005] The technical problem to be solved by the present application is to provide a model extraction training method and device of a high-resolution image classification model, a terminal and a medium, which can solve the problem that relying only on target model prediction labels and cross-entropy loss may cause overfitting of a substitute model when training a substitute model for a high-resolution image classification task.
[0006] The technical solution adopted by the present application to solve the technical problem is as follows:
[0007] In a first aspect, the present application discloses a model extraction training method of a high-resolution image classification model, wherein the method comprises:
[0008] Step S1, determining an initial model with partial knowledge of a target model as a current model to be trained, and determining a current queried sample; the target model is a trained image classification model;
[0009] Step S2, a current unquery sample set not containing the current queried sample is constructed, and a plurality of screening mechanisms are used to screen the current unquery sample set to obtain a target unquery sample set; the plurality of screening mechanisms are screening mechanisms for sampling based on diversity, uncertainty and difference which are constructed in advance;
[0010] Step S3, the target model is queried by using the target unquery sample set to obtain a prediction label of a current query round, and an active learning query set of the current query round is constructed based on the prediction label of the current query round and the target unquery sample set;
[0011] Step S4, the current to-be-trained model is trained based on the active learning query set of the current query round and by using a model training algorithm based on superpixel gradient alignment to obtain a trained model;
[0012] Step S5, it is judged whether the current query round reaches a preset query round;
[0013] Step S6, when the current query round does not reach the preset query round, the trained model is determined as the current to-be-trained model, and the samples in the active learning query set of the current query round are determined as the current queried sample, and steps S2 to S5 are executed again until the current query round reaches the preset query round, and the trained model is determined as a trained replacement model.
[0014] Optionally, before the initial model with part of the knowledge of the target model is determined as the current to-be-trained model, the method further comprises:
[0015] obtaining a public data set coupled with a scene of the target model;
[0016] extracting corresponding data from the public data set to obtain initial query samples;
[0017] querying the target model by using the initial query samples to obtain initial prediction labels, and constructing an initial query set based on the initial query samples and the initial prediction labels;
[0018] initializing the to-be-trained model by using the initial query set to obtain an initial model with part of the knowledge of the target model;
[0019] The current queried sample is determined, comprising:
[0020] the samples in the initial query set are determined as the current queried sample;
[0021] And the current unquery sample set not containing the current queried sample is constructed, comprising:
[0022] Filtering the current queried sample in the public data set to obtain a current unqueried sample set.
[0023] Optionally, the current unqueried sample set is subjected to multiple screening by using the multiple cooperative screening mechanism to obtain a target unqueried sample set, comprising:
[0024] The current unqueried sample set is determined as a current to-be-screened sample set.
[0025] The sample in the current to-be-screened sample set is input into an initial model to obtain a classification probability vector of the sample, and the highest classification probability in the classification probability vector is determined.
[0026] The class label corresponding to the highest classification probability is determined as a target class label corresponding to the unqueried sample.
[0027] Samples with the same target class label are classified to obtain an unqueried sample subset corresponding to each target class label.
[0028] A first preset number of samples are screened from each unqueried sample subset to obtain a diversity sample set.
[0029] The diversity sample set is taken as the current to-be-screened sample set, and the steps of inputting the sample in the current to-be-screened sample set into the initial model to obtain the classification probability vector of the sample and determining the highest classification probability in the classification probability vector are re-executed.
[0030] The edge probability of the sample is determined based on the highest classification probability, and the sample is sorted in ascending order based on the edge probability to obtain a current sorted to-be-screened sample set.
[0031] A first sample number in the diversity sample set is determined, and a first screening number is determined based on the first sample number.
[0032] The first screening number of samples are screened from the current sorted to-be-screened sample set to obtain an uncertainty sample set.
[0033] An active learning query set of a previous query round is obtained, and a prediction query difference degree of each sample in the active learning query set of the previous query round is calculated.
[0034] Each sample in the active learning query set of the previous query round is sorted in descending order based on the prediction query difference degree, and the first second preset number of samples are selected from the sorted active learning query set of the previous query round to obtain a to-be-compared sample set.
[0035] determine sample feature similarities between each sample in the sample set to be compared and each sample in the uncertainty sample set, and sort the samples in the uncertainty sample set in descending order based on the sample feature similarities to obtain a sorted uncertainty sample set;
[0036] determine a second sample number in the uncertainty sample set, and determine a second screening number based on the second sample number;
[0037] screen the first second screening number of samples from the sorted uncertainty sample set to obtain a target unqueried sample set.
[0038] Optionally, the active learning query set of the current query round is used to train the current to-be-trained model by using a model training algorithm based on superpixel gradient alignment to obtain a trained model, and the method comprises the following steps:
[0039] select an image sample from the active learning query set of the current query round in sequence, and perform superpixel segmentation on the image sample to obtain a superpixel set;
[0040] calculate a superpixel gradient of the image sample for the target model based on the superpixel set to obtain a first superpixel gradient;
[0041] calculate a superpixel gradient of the image sample for the current to-be-trained model based on the superpixel set to obtain a second superpixel gradient;
[0042] calculate a gradient alignment loss between the first superpixel gradient and the second superpixel gradient;
[0043] calculate a classification loss of the image sample for the target model and the current to-be-trained model;
[0044] determine a target loss based on the gradient alignment loss and the classification loss, and train the current to-be-trained model based on the target loss to obtain a trained model.
[0045] Optionally, the superpixel segmentation on the image sample to obtain a superpixel set comprises the following steps:
[0046] calculate the kernel density corresponding to each pixel on the image sample, and determine the neighborhood pixels of each pixel and the neighborhood distance therebetween;
[0047] for each pixel, the neighborhood pixels corresponding to the kernel density greater than the kernel density corresponding to the pixel and satisfying the preset distance condition are determined as the parent nodes corresponding to each pixel; wherein each pixel points to the parent node corresponding thereto to form a directed tree;
[0048] determine a spatial distance between the parent node and the child node in the directed tree, and determine whether the spatial distance between the parent node and the child node exceeds a preset spatial distance threshold;
[0049] when the spatial distance between the parent node and the child node exceeds the preset spatial distance threshold, split an edge corresponding to the parent node and the child node to decompose the directed tree into a plurality of sub-trees, and obtain a super-pixel set; each sub-tree corresponds to a super-pixel block.
[0050] Optionally, the calculating the super-pixel gradient of the image sample based on the super-pixel set comprises:
[0051] adding the same perturbation to all pixels in each super-pixel block in the super-pixel set;
[0052] estimating the super-pixel gradient of each super-pixel block based on the perturbation added to each super-pixel block;
[0053] determining the super-pixel gradient of the image sample based on the super-pixel gradient of each super-pixel block, and obtaining a first super-pixel gradient;
[0054] And the calculating the super-pixel gradient of the image sample based on the super-pixel set comprises:
[0055] inputting the image sample into the current to-be-trained model to obtain a query label, and calculating a prediction loss of the current to-be-trained model on the query label;
[0056] calculating a pixel-level gradient of the image sample on each channel according to the prediction loss;
[0057] determining a pixel gradient of each super-pixel block in the super-pixel set according to the pixel-level gradient of the image sample on each channel;
[0058] aggregating the pixel gradients of all super-pixel blocks to obtain a second super-pixel gradient.
[0059] Optionally, after the calculating the super-pixel gradient of the image sample based on the super-pixel set comprises:
[0060] performing gradient purification on the first super-pixel gradient to obtain a purified first super-pixel gradient;
[0061] wherein the performing gradient purification on the first super-pixel gradient to obtain a purified first super-pixel gradient comprises:
[0062] obtain a positive gradient maximum value and a negative gradient minimum value in the superpixel gradient of each channel;
[0063] filter a positive gradient signal in the superpixel gradient of each channel based on the positive gradient maximum value in the superpixel gradient of each channel and a preset proportion hyperparameter, and normalize a first filtered superpixel gradient to obtain a first normalized superpixel gradient;
[0064] filter a negative gradient signal in the superpixel gradient of each channel based on the negative gradient minimum value in the superpixel gradient of each channel and the preset proportion hyperparameter, and normalize a second filtered superpixel gradient to obtain a second normalized superpixel gradient;
[0065] merge the first normalized superpixel gradient and the second normalized superpixel gradient to obtain a purified first superpixel gradient.
[0066] In a second aspect, the present application further discloses a model training device, wherein the device comprises:
[0067] a model determination module configured to determine an initial model with partial knowledge of a target model as a current to-be-trained model, and determine a current queried sample; the target model is a trained image classification model;
[0068] a sample screening module configured to construct a current unqueried sample set not containing the current queried sample, and perform multiple screening on the current unqueried sample set by using a multiple cooperative screening mechanism to obtain a target unqueried sample set; the multiple cooperative screening mechanism is a pre-constructed screening mechanism based on diversity, uncertainty and difference sampling;
[0069] a label acquisition module configured to query the target model by using the target unqueried sample set to obtain a prediction label of a current query round, and construct an active learning query set of the current query round based on the prediction label of the current query round and the target unqueried sample set;
[0070] a model training module configured to train the current to-be-trained model based on the active learning query set of the current query round and by using a model training algorithm based on superpixel gradient alignment to obtain a trained model;
[0071] a round judgment module configured to judge whether the current query round reaches a preset query round;
[0072] If the current query round does not reach the preset query round, the trained model is determined as the current to-be-trained model, and the samples in the active learning query set of the current query round are determined as the current queried samples, the step of constructing the current unqueried sample set not containing the current queried samples and subsequent steps are re-executed until the current query round reaches the preset query round, and the trained model is determined as the trained substitute model.
[0073] In a third aspect, the present application discloses a terminal, comprising a memory, a processor, and a model training program stored in the memory and executable on the processor, and the model training program implements the steps of the model extraction training method of the high-resolution image classification model when executed by the processor.
[0074] In a fourth aspect, the present application discloses a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program can be executed to implement the steps of the model extraction training method of the high-resolution image classification model.
[0075] The model extraction training method, device, terminal and medium of the high-resolution image classification model provided by the present application, the model extraction training method of the high-resolution image classification model comprises: determining an initial model with partial knowledge of a target model as a current to-be-trained model, and determining current queried samples; the target model is a trained image classification model; constructing a current unqueried sample set not containing the current queried samples, and performing multiple screening on the current unqueried sample set by using a multiple cooperative screening mechanism to obtain a target unqueried sample set; the multiple cooperative screening mechanism is a pre-constructed screening mechanism based on diversity, uncertainty and difference sampling; querying the target model by using the target unqueried sample set to obtain a prediction label of a current query round, and constructing an active learning query set of the current query round based on the prediction label of the current query round and the target unqueried sample set; training the current to-be-trained model based on the active learning query set of the current query round and by using a model training algorithm based on superpixel gradient alignment to obtain a trained model; determining whether the current query round reaches a preset query round; if the current query round does not reach the preset query round, the trained model is determined as the current to-be-trained model, and the samples in the active learning query set of the current query round are determined as the current queried samples, the step of constructing the current unqueried sample set not containing the current queried samples and subsequent steps are re-executed until the current query round reaches the preset query round, and the trained model is determined as the trained substitute model.
[0076] Therefore, the multiple cooperative screening mechanism based on diversity, uncertainty and difference can screen out data samples with the most gain effect on model training, ensure that the model can fully learn the high-quality samples screened out, thereby greatly improving the training efficiency, and through the model training algorithm based on superpixel gradient alignment, the superpixel gradient of the target model and the substitute model is synchronized to provide more rich supervision information for the substitute model, effectively prevent the model from overfitting, and under the premise of ensuring the accuracy of gradient estimation, the required target model query times are significantly reduced, thereby improving the generalization ability and feature extraction precision of the model. BRIEF DESCRIPTION OF DRAWINGS
[0077] Figure 1 is a flowchart of a preferred embodiment of the model extraction and training method of the high-resolution image classification model in the present application;
[0078] Figure 2 is a logic schematic diagram of the multiple cooperative screening mechanism in the present application;
[0079] Figure 3 is a logic schematic diagram of the model training algorithm based on superpixel gradient alignment in the present application;
[0080] Figure 4 is a logic schematic diagram of a preferred embodiment of the model extraction and training method of the high-resolution image classification model in the present application;
[0081] Figure 5 is a functional principle block diagram of a preferred embodiment of the model training device in the present application;
[0082] Figure 6 is a functional principle block diagram of a preferred embodiment of the terminal in the present application. DETAILED DESCRIPTION
[0083] To make the objectives, technical solutions and advantages of the present application clearer and more explicit, the present application is further described in detail below with reference to the drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0084] Please refer to Figure 1 , Figure 1 is a flowchart of the model extraction and training method of the high-resolution image classification model in the present application. As shown in Figure 1 , the model extraction and training method of the high-resolution image classification model in the embodiment of the present application comprises:
[0085] Step S1, determine an initial model with part of the knowledge of the target model as the current to-be-trained model, and determine the current queried sample; the target model is a trained image classification model.
[0086] Wherein, the trained image classification model can be an image classification model for processing low-resolution images or an image classification model for processing high-resolution images, and the definition is different for low-resolution images and high-resolution images in different fields. For example, in the general display field, images below 640x480 pixels (such as 320x240) are usually considered as low-resolution images, and images above 1280x720 pixels can be considered as high-resolution images. For example, in the field of remote sensing and professional images, satellite images with a spatial resolution of more than 10 meters / pixel are classified as low-resolution, and in medical images, MRI data with 256x256 pixels can be considered as low-resolution due to insufficient details, and in medical images, CT / MRI data above 512x512 pixels are usually considered as high-resolution.
[0087] Before the initial model with partial knowledge of the target model is determined as the current to-be-trained model in the embodiment, the method can further include: obtaining a public data set coupled with a scene of the target model; extracting corresponding data from the public data set to obtain initial query samples; querying the target model using the initial query samples to obtain initial predicted labels, and constructing an initial query set based on the initial query samples and the initial predicted labels; and initializing training of the to-be-trained model using the initial query set to obtain the initial model with partial knowledge of the target model. It can be understood that the initial model is a model with partial knowledge of the target model obtained by initializing training of an original replacement model used to replace the target model.
[0088] Wherein, the current queried sample is determined, which can include: determining the sample in the initial query set as the current queried sample.
[0089] For example, first, a public data set coupled with a scene of the target model is selected . According to the task scene, the structure of the replacement model is selected, and the parameters thereof are initialized. From the public data set , a plurality of samples are extracted as initial query samples, which are used to query the target model , and obtain predicted labels , wherein, represents the parameters of . The query samples and the predicted labels constitute an initial query set The replacement model is trained for a plurality of rounds, so that the replacement model masters a part of the knowledge of the target model, and the queried samples .
[0090] Step S2, constructing a current unqueried sample set not containing the current queried sample, and performing multiple screening on the current unqueried sample set by using a multiple cooperative screening mechanism to obtain a target unqueried sample set; the multiple cooperative screening mechanism is a pre-constructed screening mechanism based on diversity, uncertainty and difference sampling.
[0091] In this embodiment, the current unqueried sample set not containing the current queried sample is constructed, specifically including: filtering the current queried sample in the public data set to obtain the current unqueried sample set. For example, filtering the queried sample in the public data set to obtain the current unqueried sample set .
[0092] It should be pointed out that in the actual substitute model training scene, the training data distribution of the target model cannot be known, and with the continuous increase in the number of high-resolution image data, it is necessary to sample and construct a query sample set from a large amount of public data. A simple random sampling strategy often leads to insufficient sample information value, resulting in a large number of query requests initiated by the substitute model to the target model, significantly increasing the query cost. Therefore, to solve the above problems, the prior art generally uses an active learning method to screen and optimize the public data. Using the active learning method to screen the query sample can reduce the training cost and speed up the convergence of the substitute model.
[0093] Among them, the active learning mechanism can effectively reduce the number of queries required by the substitute model by allowing the model to autonomously select the most informationally valuable data for learning during the training process. However, in the prior art, sample screening is only based on a single standard (such as simply considering feature diversity or prediction information entropy). This single-dimensional screening standard may result in inaccurate sample selection, affecting the overall efficiency of model training. Moreover, when the target model is an image classification model for high-resolution images, the computational overhead (such as memory usage and training time) for training the substitute model is large. Therefore, from the perspective of multi-dimensional information value evaluation, a screening mechanism based on diversity, uncertainty and difference sampling is used to optimize the selection on the image data set coupled with the target scene, i.e., the three screening standards are combined in a cascading manner. The post-positioning strategy iteratively optimizes the samples screened by the pre-positioning strategy, significantly reducing the query cost of the substitute model training for high-resolution image classification models.
[0094] In the embodiment, the current unquery sample set is subjected to multiple screening by using a multiple cooperative screening mechanism to obtain a target unquery sample set, which can specifically include: determining the current unquery sample set as a current to-be-screened sample set; inputting samples in the current to-be-screened sample set into an initial model to obtain a classification probability vector of the samples and determine a highest classification probability in the classification probability vector; determining a class label corresponding to the highest classification probability as a target class label corresponding to the unquery sample; classifying samples with the same target class label to obtain unquery sample subsets corresponding to respective target class labels; screening a first preset number of samples from the unquery sample subsets to obtain a diversity sample set; taking the diversity sample set as the current to-be-screened sample set, and re-executing the steps of inputting samples in the current to-be-screened sample set into the initial model to obtain a classification probability vector of the samples and determine a highest classification probability in the classification probability vector; determining an edge probability of the sample based on the highest classification probability, and sorting the samples in ascending order based on the edge probability to obtain a current sorted to-be-screened sample set; determining a first sample number in the diversity sample set, and determining a first screening number based on the first sample number; screening a first screening number of samples from the current sorted to-be-screened sample set to obtain an uncertainty sample set; obtaining an active learning query set of a previous query round, and calculating a predicted query difference degree of each sample in the active learning query set of the previous query round; sorting the samples in the active learning query set of the previous query round in descending order based on the predicted query difference degree, and selecting a second preset number of samples from the sorted active learning query set of the previous query round to obtain a to-be-compared sample set; determining a sample feature similarity between each sample in the to-be-compared sample set and the uncertainty sample set, and sorting the samples in the uncertainty sample set in descending order based on the sample feature similarity to obtain a sorted uncertainty sample set; determining a second sample number in the uncertainty sample set, and determining a second screening number based on the second sample number; screening a second screening number of samples from the sorted uncertainty sample set to obtain a target unquery sample set.
[0095] It should be noted that sampling a first preset number of samples from the unquery sample subsets corresponding to respective target class labels can ensure that the samples sampled at this stage are uniformly distributed in each class, and the first preset number can be one or more, the second preset number is multiple, the first screening number can be a first sample number of a first preset proportion, and the second screening number can be a second sample number of a second preset proportion. For example, when the first screening number is 10, the first 10 samples are screened from the current sorted to-be-screened sample set to obtain the uncertainty sample set; when the second preset number is 10, the first 10 samples are selected from the sorted active learning query set of the previous query round to obtain the to-be-compared sample set; and when the second screening number is 10, the first 10 samples are screened from the sorted uncertainty sample set to obtain the target unquery sample set.
[0096] It can be understood that, from the perspective of multi-dimensional information value evaluation, the screening mechanism based on diversity, uncertainty and difference sampling can improve sample diversity, i.e., ensure that the query set covers all categories of samples as evenly as possible, so that the substitute model can learn the knowledge distribution of the target model comprehensively, avoid overfitting or underfitting of the substitute model due to the category distribution deviation of the query sample, improve uncertainty, i.e., help identify samples located near the decision boundary of the target model, which can effectively represent the decision boundary of the target model, thereby improving the prediction consistency of the substitute model and the target model, and improve difference, i.e., aiming to preferentially select samples with large prediction difference between the substitute model and the target model, which can efficiently correct errors of the substitute model and accelerate approaching the decision boundary of the target model.
[0097] Specifically, the three screening criteria of uncertainty sampling, diversity sampling and difference sampling are combined together in a cascading design, and the three work together to comprehensively evaluate the sample value from different angles and actively learn queries from the target model. The specific execution process of the first round is as follows:
[0098] In diversity sampling, unqueried samples are screened from the public dataset , containing samples. The unqueried samples are input to obtain the classification probability vector of , where represents the parameters of . For any , , where is the component in the classification probability vector , representing the probability of the substitute model predicting as the category . Determine the category label with the highest probability in the prediction vector of the input sample . That is:
[0099] ;
[0100] Then, data points with the same highest probability category are grouped into the same subset, i.e.:
[0101] ;
[0102] To ensure that the samples collected in this phase are evenly distributed across all categories, samples from each subset... Medium sampling 1 sample, ultimately obtaining a collection Diversity sampling set of individual samples .
[0103] In uncertain sampling, unqueried samples will be included. enter , obtain Classification probability vector For any , ,in, Classification probability vector The first in Each component represents an alternative model. predict For category The probability of.
[0104] Determine the input sample The class label with the highest probability in the prediction vector ,Right now:
[0105] ;
[0106] Using marginal probabilities The uncertainty of a sample is measured as follows:
[0107] ;
[0108] in, The representative category label is The highest classification probability vector corresponding to the time; the lower the marginal probability, the higher its uncertainty.
[0109] from Filtering for the lowest marginal probability One sample, as Then proceed to the next stage of screening.
[0110] in, This represents the pre-set entropy gradient sampling rate (first preset ratio). Uncertainty reflects the distance between the sample and the decision boundary; the stronger the sample uncertainty, the closer it is to the decision boundary. Using these samples close to the decision boundary to train the surrogate model can effectively improve the consistency between the surrogate model and the target model.
[0111] In differential sampling, the sample set selected from the previous stage... In the next step, we continue to select the model that maximizes the difference between the predictions of the target model and the alternative model. samples are used as the final sample set, where ... For the pre-set prediction difference sampling rate, This is the second preset ratio. That is, to ensure that the target model is not queried at this stage, the query set from the previous round is selected. The largest difference in the predicted query One sample, namely:
[0112] ;
[0113] in, represent Divergence loss.
[0114] from Search and The sample with the closest features 1 sample as the final sample set .
[0115] Furthermore, the overall algorithm flow of the multiple collaborative screening mechanism is shown in Table 1, namely:
[0116] Table 1
[0117]
[0118] Step S3: Use the target unqueried sample set to query the target model, obtain the predicted label for the current query round, and construct the active learning query set for the current query round based on the predicted label for the current query round and the target unqueried sample set.
[0119] For example, see Figure 2 As shown, first filter Queryed samples Obtain the unqueried sample set Then, a selection of high-value samples is screened using a screening mechanism based on diversity, uncertainty, and differential sampling. Using the final sample set Query the target model to obtain the predicted labels. The query samples and labels constitute the active learning query set. .
[0120] Step S4: Actively learn the query set based on the current query round, and train the current model to be trained using the model training algorithm based on superpixel gradient alignment to obtain the trained model.
[0121] It can be understood that, in order to solve the problem that only relying on target model prediction label and cross entropy loss may cause overfitting of the surrogate model when training the surrogate model for high-resolution image classification task, the sample gradient similarity loss is introduced as a regularization means to constrain the training of the surrogate model, thereby improving the generalization ability. That is, in the model training phase, the model is trained based on the superpixel gradient alignment model training algorithm, that is, the joint optimization strategy of cross entropy loss and sample gradient similarity loss is adopted.
[0122] It should be noted that the gradient of the target model implicitly contains the key information of its decision boundary. By aligning the gradients of the surrogate model and the target model, the surrogate model can better simulate the behavior of the target model. Since the gradient information of the target model cannot be obtained, the prior art usually performs pixel-by-pixel gradient estimation on the input image. However, high-resolution images contain too many pixels, and the calculation complexity of pixel-by-pixel gradient estimation is too high, and frequent queries to the target model are required, increasing the query cost. Therefore, in the present embodiment, the image is divided into superpixel blocks (local regions of similar pixels), and gradient estimation is performed on the superpixel blocks, which can reduce the calculation complexity while maintaining the accuracy of gradient estimation.
[0123] Specifically, an image sample is selected from the active learning query set of the current query round in turn, and superpixel segmentation is performed on the image sample to obtain a superpixel set; the superpixel gradient of the target model for the image sample is calculated based on the superpixel set, to obtain a first superpixel gradient; the superpixel gradient of the current to-be-trained model for the image sample is calculated based on the superpixel set, to obtain a second superpixel gradient; the gradient alignment loss between the first superpixel gradient and the second superpixel gradient is calculated; the classification loss of the target model and the current to-be-trained model for the image sample is calculated; the target loss is determined based on the gradient alignment loss and the classification loss, and the current to-be-trained model is trained based on the target loss, to obtain a trained model.
[0124] In the present embodiment, the image sample is segmented into a superpixel set, which can specifically include: calculating the kernel density corresponding to each pixel on the image sample, and determining the neighborhood pixels and the neighborhood distance therebetween for each pixel; for each pixel, the neighborhood pixels corresponding to the kernel density greater than the kernel density corresponding to the pixel and satisfying the preset distance condition are determined as the parent nodes corresponding to each pixel; wherein each pixel points to the parent node corresponding thereto, forming a directed tree; the spatial distance between the parent and child nodes in the directed tree is determined, and it is judged whether the spatial distance between the parent and child nodes exceeds a preset spatial distance threshold; when the spatial distance between the parent and child nodes exceeds the preset spatial distance threshold, the edge corresponding to the parent and child nodes is segmented to decompose the directed tree into multiple sub-trees, to obtain the superpixel set; wherein each sub-tree corresponds to a superpixel block, and the preset distance condition is that the neighborhood distance satisfies the nearest condition.
[0125] In this embodiment, the superpixel gradient of the target model on the image sample is calculated based on the superpixel set to obtain the first superpixel gradient. Specifically, this may include: adding the same perturbation to all pixels in each channel of each superpixel block in the superpixel set; estimating the superpixel gradient of the target model on each superpixel block based on each superpixel block after the perturbation; and determining the superpixel gradient of the image sample based on the superpixel gradient of each superpixel block to obtain the first superpixel gradient.
[0126] In this embodiment, after calculating the superpixel gradient of the target model on the image sample based on the superpixel set to obtain the first superpixel gradient, it may further include: performing gradient purification on the first superpixel gradient to obtain the purified first superpixel gradient.
[0127] Specifically, the superpixel gradient of each channel is obtained, and the maximum positive gradient value and the minimum negative gradient value in the superpixel gradient of each channel are determined. Based on the maximum positive gradient value in the superpixel gradient of each channel and a preset ratio hyperparameter, the positive gradient signal in the superpixel gradient of each channel is filtered, and the first filtered superpixel gradient is normalized to obtain the first normalized superpixel gradient. Based on the minimum negative gradient value in the superpixel gradient of each channel and the preset ratio hyperparameter, the negative gradient signal in the superpixel gradient of each channel is filtered, and the second filtered superpixel gradient is normalized to obtain the second normalized superpixel gradient. The first normalized superpixel gradient and the second normalized superpixel gradient are merged to obtain the purified first superpixel gradient.
[0128] It should be noted that, due to It's a black box; it cannot be obtained directly through backpropagation. The sample gradient. The sample gradient is obtained using the forward differencing method. Perturbations are added to each pixel and gradient estimation is performed, since the input of the image samples contains For channels (e.g., RGB three channels), gradient estimation needs to be performed on each channel, i.e.:
[0129] ;
[0130] in, This represents the amount of disturbance. It is a kind of input Sparse vectors of the same dimension in the channel The 1 pixel The value at position 1 is 1, and the values at all other positions are 0.
[0131] If pixel-level gradient estimation is used, the number of queries will increase exponentially, which is too high for high-resolution images (such as 224x224). Therefore, a superpixel gradient estimation method is used to divide the image into multiple superpixel blocks and estimate the gradient of each superpixel block.
[0132] For example, the specific process of dividing the image into multiple superpixel blocks is as follows: first, calculate the kernel density of each pixel, that is:
[0133] ;
[0134] Take the RGB three channels as an example, where, represents the jth pixel, , is the pixel space coordinate, is the RGB color space component, represents the color similarity kernel bandwidth, represents the spatial distance kernel bandwidth, represents all the neighboring pixels of the pixel .
[0135] For each pixel , find the nearest pixel in its neighborhood whose density is strictly greater than as the parent node, that is:
[0136] ;
[0137] Each pixel points to its parent node , forming one or more directed trees.
[0138] Cut the edges in the tree that are too long (i.e., the spatial distance between parent and child nodes exceeds ) by setting a preset spatial distance threshold , and decompose the tree into sub-trees, each corresponding to a superpixel block, and finally obtain the superpixel set .
[0139] Then add the same perturbation to all pixels in the superpixel block three channels, and then estimate the superpixel gradient of , that is:
[0140] ;
[0141] where, , represents the number of pixels contained in the pixel block .
[0142] Since the sample gradient estimation calculation result has large variance and is easily disturbed by noise, gradient purification is needed after all superpixel gradients are calculated, only the strongest gradient value (extreme value) is retained, and weak signals are filtered.
[0143] Specifically, the superpixel gradient set of each channel is obtained , and the maximum value of the positive gradient and the minimum value of the negative gradient in the channel are obtained ; the positive gradient signal is filtered and normalized to obtain , wherein is a pre-set proportional hyperparameter, and the larger the positive gradient value represents the more sensitive the change of the pixel region is; the negative gradient signal is filtered and normalized to obtain , and the smaller the negative gradient value represents that the pixel region may be noise or irrelevant background; the filtering results are combined to obtain .
[0144] And, based on the superpixel set, the superpixel gradient of the image sample to the current to-be-trained model is calculated to obtain a second superpixel gradient, which can specifically include: inputting the image sample into the current to-be-trained model to obtain a query label, and calculating a prediction loss of the current to-be-trained model to the query label; calculating the pixel-level gradient of the image sample on each channel according to the prediction loss, and determining the pixel gradient of each superpixel block in the superpixel set according to the pixel-level gradient of the image sample on each channel; aggregating the pixel gradients of all superpixel blocks to obtain the second superpixel gradient.
[0145] For example, after obtaining the superpixel gradient of , in order to align the gradient with the target model, the superpixel gradient of also needs to be calculated.
[0146] It should be noted that, since it has white box access permission , the superpixel block gradient can be directly aggregated according to the pixel gradient, and the specific execution process is as follows:
[0147] First, input the sample into to obtain the query label , and calculate the prediction loss of the substitute model to the query label, that is:
[0148] ;
[0149] Then, according to , the pixel-level gradient of the sample on the channel Aggregate the pixel gradients of each superpixel block, i.e.:
[0150] ;
[0151] Finally, the input sample is obtained by summing the gradients of all superpixel blocks. Superpixel gradient .
[0152] Furthermore, in obtaining superpixel gradients After that, the classification loss also needs to be calculated. ,Right now:
[0153] ;
[0154] It should be noted that, and Similarity loss between superpixel gradients Alternative models are possible Regularization is performed to prevent alternative models from misclassifying labels. Overfitting, i.e.:
[0155] ;
[0156] The loss function of the final alternative model is: ,in, Represents balance and Hyperparameters.
[0157] See Figure 3 As shown, in utilizing each Active learning query set of the wheel Training Alternative Models In this process, the sample gradient loss is added to the loss function to regularize the alternative model, thereby reducing query costs while improving extraction accuracy. First, a superpixel gradient estimation method is used to segment the image into multiple superpixel blocks, and gradient estimation is performed on each superpixel block to calculate the sample gradient of the target model. In obtaining Superpixel gradient Finally, in order to align the gradients with the target model, it is also necessary to calculate... Superpixel gradient .calculate and Similarity loss between superpixel gradients Similarity loss Alternative models are possible Regularization is performed to prevent alternative models from misclassifying labels. Overfitting, and then recalculate the classification loss. the similarity loss and the classification loss The loss function of the substitute model is obtained by weighted summation .
[0158] Step S5, determining whether the current query round reaches the preset query round.
[0159] It can be understood that after completing the model training in each query round, it is determined whether the current query round reaches the preset query round.
[0160] Step S6, when the current query round does not reach the preset query round, the trained model is determined as the current to-be-trained model, and the samples in the active learning query set of the current query round are determined as the current queried samples, and steps S2 to S5 are re-executed until the current query round reaches the preset query round, and the trained model is determined as the trained substitute model.
[0161] In the embodiment, in the model training process, when the model training of all preset query rounds is not completed, the samples in the active learning query set of the current query round are determined as the current queried samples, and the above steps of constructing the current unqueried sample set which does not contain the current queried samples and the subsequent steps are re-executed until the current query round reaches the preset query round, indicating that the model training of all preset query rounds is completed, and the trained model is determined as the trained substitute model.
[0162] The substitute model training algorithm flow based on gradient alignment regularization is shown in Table 2, that is:
[0163] Table 2
[0164]
[0165] It should be noted that the evaluation indicators of the substitute model in the training process include accuracy and consistency.
[0166] The accuracy refers to the matching degree between the classification results of the substitute model and the true labels, that is, given a test data set , the accuracy is calculated, that is:
[0167] ;
[0168] Wherein, is an indicator function, which takes the value of 1 when , otherwise 0, and N represents the number of samples in the test data set.
[0169] And the consistency refers to the similarity between the classification results of the substitute model and the classification results of the target model, that is, the test data set , the consistency is calculated, that is:
[0170] ;
[0171] As can be seen, in this embodiment of the invention, the multi-cooperative screening mechanism can select data samples that have the greatest benefit to model training, ensuring that the model can fully learn from the selected high-quality samples, thereby significantly improving training efficiency. Furthermore, the model training algorithm based on superpixel gradient alignment provides richer supervision information to the alternative model by synchronizing the superpixel gradients of the target model and the alternative model, effectively preventing model overfitting. It can also significantly reduce the number of target model queries required while ensuring the accuracy of gradient estimation, thereby improving the model's generalization ability and feature extraction accuracy.
[0172] For example, see Figure 4 As shown, in the initialization phase, a public dataset coupled with the target model scene is first selected. Choose an alternative model based on the task scenario. The structure of the model is defined, and its parameters are initialized. Since the surrogate model has no information in the initial state, random sampling is performed from a public dataset. Extract Sample Query target model Then, the predicted labels are obtained. ,in, represent The parameters. Query samples and tags constitute the initial query set. Training Alternative Models This process allows the alternative model to acquire some knowledge of the target model, at which point the queried samples... During the training execution phase, the first step is to filter... Queryed samples Obtain the unqueried sample set Then, a high-value sample is selected using a multi-screening active learning method based on high-resolution images extracted from the model. Using the final sample set Query the target model to obtain the predicted labels. The query samples and predicted labels constitute the active learning query set. Finally, active learning query sets are utilized. And train an alternative model based on a model training method using superpixel gradient alignment. Each round completes the training of the alternative model for the current round, and the above training execution phase is repeated. Rounds, and after completing each round of training... The samples in the query set are added. From public datasets Filter out the samples in the queried set , re-screen a part of high-value samples , and start a new round of training.
[0173] In the embodiments of the present application, multi-dimensional information value active learning is combined with gradient alignment regularization, which significantly improves the efficiency and accuracy of model training. In view of the characteristics of the current high-resolution image dataset with large scale, and in order to ensure that the surrogate model can fully learn the high-quality samples selected by the active learning method, through the multi-dimensional information value active learning method, the data samples with the most gain effect on model training can be selected from a large number of public data sets, thereby greatly improving the training efficiency. And the superpixel gradient alignment method provides more rich supervision information for the surrogate model by synchronizing the superpixel gradient of the target model and the surrogate model, effectively preventing the problem of model overfitting. In particular, in view of the problem of too many query times of the traditional pixel-by-pixel gradient estimation method, by using the superpixel block-based gradient estimation strategy, the image is divided into superpixel regions for overall gradient estimation, which can significantly reduce the required query times of the target model while ensuring the accuracy of the gradient estimation.
[0174] It should be noted that in addition to using the superpixel gradient alignment technology, the performance of the surrogate model can also be improved by various regularization means. For example, the Grad-CAM-based visual interpretation method can effectively identify the key discriminant regions of the target model in the image sample, and these regions have a high correlation with the prediction results of the model. For example, first, systematically erase the discriminant regions in the image, and re-input the processed sample into the target model to obtain a new classification label; second, by aggregating the prediction results of multiple discriminant regions, a soft label supervision signal with regularization effect is constructed. This dual mechanism based on region erasing and soft label estimation can not only effectively constrain the training process of the surrogate model, but also significantly improve its generalization ability.
[0175] In one embodiment, as shown in Figure 5 based on the model extraction and training method of the high-resolution image classification model described above, the present application also correspondingly provides a model training device, comprising:
[0176] A model determination module 11 is configured to determine an initial model with partial knowledge of a target model as a current to-be-trained model, and determine a current queried sample; the target model is a trained image classification model;
[0177] A sample screening module 12 is configured to construct a current unqueried sample set that does not contain the current queried sample, and perform multiple screening on the current unqueried sample set by using a multiple cooperative screening mechanism to obtain a target unqueried sample set; the multiple cooperative screening mechanism is a pre-constructed screening mechanism based on diversity, uncertainty and difference sampling;
[0178] The label obtaining module 13 is configured to query the target model by using the target unquery sample set, obtain the predicted label of the current query round, and construct the active learning query set of the current query round based on the predicted label of the current query round and the target unquery sample set.
[0179] The model training module 14 is configured to train the current to-be-trained model based on the active learning query set of the current query round and by using the model training algorithm based on superpixel gradient alignment, and obtain the trained model.
[0180] The round judgment module 15 is configured to judge whether the current query round reaches the preset query round.
[0181] The cycle training module 16 is configured to, when the current query round does not reach the preset query round, determine the trained model as the current to-be-trained model, determine the samples in the active learning query set of the current query round as the current queried samples, re-execute the step of constructing the current unquery sample set not containing the current queried samples and the subsequent steps thereof, until the current query round reaches the preset query round, and determine the trained model as the trained substitute model.
[0182] In addition, it is worth noting that the working process of the model training device provided in the embodiment is the same as the working process of the model extraction and training method of the high-resolution image classification model, and thus will not be described here again. For details, refer to the working process of the model extraction and training method of the high-resolution image classification model.
[0183] Figure 6 The terminal provided in the embodiment of the present application is shown in the structural diagram. The terminal can include:
[0184] The memory 501, the processor 502, and the computer program stored in the memory 501 and executable on the processor 502.
[0185] The processor 502 implements the model extraction and training method of the high-resolution image classification model provided in the above embodiment when executing the program.
[0186] Further, the terminal further includes:
[0187] The communication interface 503 is configured to communicate in the memory 501 and the processor 502.
[0188] The memory 501 is configured to store the computer program executable on the processor 502.
[0189] The memory 501 can include a high-speed RAM memory, and can also include a non-volatile memory, for example, at least one disk memory.
[0190] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected with each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one line is used to represent the bus in the figure, but it does not mean that there is only one bus or only one type of bus.
[0191] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can complete communication between each other through an internal interface.
[0192] The processor 502 can be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement one or more embodiments of the present application.
[0193] The embodiment further provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the model extraction training method of the high-resolution image classification model as above.
[0194] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The application is intended to cover any variations, uses or adaptations of the application following, in general, the principles of the application and including such steps as incorporate known prior to the application or adaptations as would be readily apparent to those skilled in the art. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the application is indicated by the claims.
[0195] In the description of the application, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the application. The illustrative description of the above terms in the specification does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any suitable manner in one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the specification and the features of the different embodiments or examples, without contradiction.
[0196] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a list of executable instructions for implementing logic functions, which can be specifically embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus or device, such as a computer-based system, a system including a processor or other system that can read instructions from the instruction execution system, apparatus or device and execute the instructions, or in conjunction with these instruction execution systems, apparatus or devices.
[0197] It should be understood that parts of the present application can be implemented in hardware, software, firmware or a combination thereof. In the above-described embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware and as in another embodiment, it can be implemented by any one or a combination of the following technologies known in the art: discrete logic circuit with logic gates for implementing logic functions on data signals, application specific integrated circuit with suitable combination logic gates, programmable gate array (PGA), field programmable gate array (FPGA) and the like.
[0198] It should be understood that the application of the present application is not limited to the above examples, and those skilled in the art can make improvements or changes according to the above description, and all these improvements and changes shall fall within the protection scope of the claims of the present application.
Claims
1. A method for model extraction training of a high-resolution image classification model, characterized in that, The method comprises: Step S1, determining an initial model with partial knowledge of a target model as a current to-be-trained model, and determining a current queried sample; the target model is a trained image classification model; Step S2, constructing a current unqueried sample set not containing the current queried sample, and performing multiple screening on the current unqueried sample set by using a multiple cooperative screening mechanism to obtain a target unqueried sample set; the multiple cooperative screening mechanism is a pre-constructed screening mechanism based on diversity, uncertainty and difference sampling; Step S3, querying the target model by using the target unqueried sample set to obtain a prediction label of a current query round, and constructing an active learning query set of the current query round based on the prediction label of the current query round and the target unqueried sample set; Step S4, training the current to-be-trained model based on the active learning query set of the current query round and by using a model training algorithm based on superpixel gradient alignment to obtain a trained model; Step S5, determining whether the current query round reaches a preset query round; Step S6, when the current query round does not reach the preset query round, determining the trained model as the current to-be-trained model, and determining samples in the active learning query set of the current query round as the current queried sample, and re-executing steps S2 to S5 until the current query round reaches the preset query round, and determining the trained model as a trained substitute model. 2.The model extraction training method of a high-resolution image classification model according to claim 1, wherein, Before the initial model with partial knowledge of the target model is determined as the current to-be-trained model, the method further comprises: obtaining a public data set coupled with a scene of the target model; extracting corresponding data from the public data set to obtain initial query samples; querying the target model by using the initial query samples to obtain initial prediction labels, and constructing an initial query set based on the initial query samples and the initial prediction labels; initializing training of the to-be-trained model by using the initial query set to obtain the initial model with partial knowledge of the target model; wherein the current queried sample is determined by: determining samples in the initial query set as the current queried sample; and the current unqueried sample set not containing the current queried sample is constructed by: filtering the current queried sample in the public data set to obtain the current unqueried sample set. 3.The model extraction training method of a high-resolution image classification model according to claim 1, wherein, The multiple screening on the current unqueried sample set by using the multiple cooperative screening mechanism to obtain the target unqueried sample set comprises: determining the current unqueried sample set as a current to-be-screened sample set; inputting samples in the current to-be-screened sample set into the initial model to obtain a classification probability vector of the samples, and determining a highest classification probability in the classification probability vector; determining a class label corresponding to the highest classification probability as a target class label corresponding to an unqueried sample; classifying samples with the same target class label to obtain unqueried sample subsets corresponding to each target class label; screening a first preset number of samples from each unqueried sample subset to obtain a diversity sample set; re-performing the steps of inputting a sample in the current to-be-screened sample set into the initial model, obtaining a classification probability vector of the sample, and determining a highest classification probability in the classification probability vector, on the diversity sample set as the current to-be-screened sample set; determining an edge probability of the sample based on the highest classification probability, and performing ascending order sorting on the sample based on the edge probability to obtain a current sorted to-be-screened sample set; determining a first sample number in the diversity sample set, and determining a first screening number based on the first sample number; screening out the first screening number of samples from the current sorted to-be-screened sample set to obtain an uncertainty sample set; obtaining an active learning query set of a previous query round, and calculating a predicted query difference degree of each sample in the active learning query set of the previous query round; descending order sorting each sample in the active learning query set of the previous query round based on the predicted query difference degree, and selecting the first second preset number of samples from the sorted active learning query set of the previous query round to obtain a to-be-compared sample set; determining a sample feature similarity between each sample in the to-be-compared sample set and the uncertainty sample set, and descending order sorting the samples in the uncertainty sample set based on the sample feature similarity to obtain a sorted uncertainty sample set; determining a second sample number in the uncertainty sample set, and determining a second screening number based on the second sample number; screening out the second screening number of samples from the sorted uncertainty sample set to obtain a target unqueried sample set. 4.The method according to any one of claims 1 to 3, wherein the current to-be-trained model based on the active learning query set of the current query round, and training the current to-be-trained model by using a model training algorithm based on superpixel gradient alignment to obtain a trained model, comprising: selecting an image sample from the active learning query set of the current query round in turn, and performing superpixel segmentation on the image sample to obtain a superpixel set; calculating a superpixel gradient of the image sample for a target model based on the superpixel set to obtain a first superpixel gradient; calculating a superpixel gradient of the image sample for the current to-be-trained model based on the superpixel set to obtain a second superpixel gradient; calculating a gradient alignment loss between the first superpixel gradient and the second superpixel gradient; calculating a classification loss of the image sample for the target model and the current to-be-trained model; determining a target loss based on the gradient alignment loss and the classification loss, and training the current to-be-trained model based on the target loss to obtain a trained model. 5.The model extraction training method of a high-resolution image classification model according to claim 4, wherein, the superpixel segmentation on the image sample to obtain a superpixel set, comprising: calculating a kernel density corresponding to each pixel on the image sample, and determining a neighborhood pixel and a neighborhood distance therebetween for each pixel; for each pixel, determining a parent node of each pixel corresponding to the neighborhood pixel whose kernel density is greater than the kernel density corresponding to the neighborhood pixel and whose neighborhood distance satisfies a preset distance condition; wherein each pixel points to the parent node corresponding thereto to form a directed tree; determining a spatial distance between parent and child nodes in the directed tree, and judging whether the spatial distance between the parent and child nodes exceeds a preset spatial distance threshold; When the space distance between the parent node and the child node exceeds the preset space distance threshold, the edge corresponding to the parent node and the child node is split to decompose the directed tree into multiple sub-trees, and a superpixel set is obtained; each sub-tree corresponds to a superpixel block. 6.The model extraction training method of a high-resolution image classification model according to claim 4, wherein, The method further comprises the following steps of: adding the same perturbation to all pixels in each superpixel block in the superpixel set; estimating the superpixel gradient of the target model for each superpixel block based on the superpixel block after the perturbation is added; determining the superpixel gradient of the image sample based on the superpixel gradient of each superpixel block, to obtain the first superpixel gradient; The method further comprises the following steps of: inputting the image sample into the current to-be-trained model to obtain a query label and calculating a prediction loss of the current to-be-trained model for the query label; calculating the pixel-level gradient of the image sample on each channel according to the prediction loss; determining the pixel gradient of each superpixel block in the superpixel set according to the pixel-level gradient of the image sample on each channel; aggregating the pixel gradients of all superpixel blocks to obtain the second superpixel gradient. 7.The model extraction training method of a high-resolution image classification model according to claim 4, characterized in that, The method further comprises the following steps of: performing gradient purification on the first superpixel gradient to obtain a purified first superpixel gradient; The method of performing gradient purification on the first superpixel gradient to obtain a purified first superpixel gradient comprises the following steps of: obtaining the superpixel gradient of each channel and determining the maximum positive gradient and the minimum negative gradient in the superpixel gradient of each channel; filtering the positive gradient signal in the superpixel gradient of each channel based on the maximum positive gradient in the superpixel gradient of each channel and a preset proportion hyperparameter, and performing normalization on the first filtered superpixel gradient to obtain a first normalized superpixel gradient; filtering the negative gradient signal in the superpixel gradient of each channel based on the minimum negative gradient in the superpixel gradient of each channel and the preset proportion hyperparameter, and performing normalization on the second filtered superpixel gradient to obtain a second normalized superpixel gradient; merging the first normalized superpixel gradient and the second normalized superpixel gradient to obtain the purified first superpixel gradient.
8. A model training apparatus, comprising: The device comprises: a model determination module configured to determine an initial model with partial knowledge of a target model as a current to-be-trained model, and determine a current queried sample; the target model is a trained image classification model; a sample screening module configured to construct a current unqueried sample set that does not contain the current queried sample, and perform multiple screening on the current unqueried sample set by using a multiple cooperative screening mechanism to obtain a target unqueried sample set; the multiple cooperative screening mechanism is a pre-constructed screening mechanism based on diversity, uncertainty and difference sampling; The label obtaining module is configured to query the target model by using the target unquery sample set, to obtain predicted labels of the current query round, and to construct an active learning query set of the current query round based on the predicted labels of the current query round and the target unquery sample set. The model training module is configured to train the current to-be-trained model based on the active learning query set of the current query round and by using a model training algorithm based on superpixel gradient alignment, to obtain a trained model. The round judgment module is configured to judge whether the current query round reaches a preset query round. The loop training module is configured to, when the current query round does not reach the preset query round, determine the trained model as the current to-be-trained model, determine samples in the active learning query set of the current query round as current queried samples, re-execute the step of constructing the current unquery sample set not containing the current queried samples and subsequent steps thereof, until the current query round reaches the preset query round, and then determine the trained model as a trained replacement model.
9. A terminal, characterized by comprising: The memory, the processor, and a model training program stored in the memory and executable on the processor, wherein the model training program, when executed by the processor, implements the steps of the model extraction training method of the high-resolution image classification model according to any one of claims 1 to 7. The computer readable storage medium stores a computer program, which can be executed to implement the steps of the model extraction training method of the high-resolution image classification model according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that,
Citation Information
Patent Citations
Picture data screening method and system based on target detection learning algorithm
CN114898182A
Automatic extraction method of substitution model, terminal and storage medium
CN115470927A
Cited By
Method and device for constructing classifier model and training to obtain image classification model
CN122049661A