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
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2025-10-28
- 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 data samples that have the greatest benefit to model training. We also utilize the superpixel gradient alignment model training algorithm to provide rich supervision information and prevent 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 generalization ability of the model.
Smart Images

Figure CN120852896A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, terminal, and medium for model extraction and training of high-resolution image classification models. Background Technology
[0002] Model extraction training can facilitate the transfer of complex models and knowledge reuse. Through extraction training, the trainer can obtain alternative models at a lower training cost. However, current extraction training methods for image classification models are mainly geared towards low-resolution images, such as the CIFAR-10 image dataset (image resolution ≤ 32×32). For image classification models (target models) that process low-resolution images, alternative models with similar functionality can be trained by simply using the classification label information output by the target model and optimizing the cross-entropy loss function. That is, by directly reusing the classification label information output by the target model, no additional labeled data or complex labeling processes are required, which can significantly reduce data preparation costs and thus simplify the training process.
[0003] However, compared to low-resolution images, high-resolution images (such as those with a resolution of ≥224×224) contain features that increase exponentially in both quantity and complexity, while the supervision information provided by the classification labels remains unchanged. Therefore, when training an image classification model (target model) that functions similarly to the target model in the above manner, overfitting is likely to occur, resulting in a significant drop in the model's performance.
[0004] Therefore, existing technologies have shortcomings and need to be improved and developed. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a model extraction and training method, device, terminal and medium for high-resolution image classification models, which can solve the problem that relying solely on the target model to predict labels and cross-entropy loss may lead to overfitting of the alternative model when training alternative models for high-resolution image classification tasks.
[0006] The technical solution adopted by this invention to solve the technical problem is as follows: In a first aspect, the present invention discloses a model extraction and training method for a high-resolution image classification model, wherein the method includes: Step S1: Determine the initial model that possesses some knowledge of the target model as the current model to be trained, and determine the currently queried samples; the target model is the trained image classification model; Step S2: Construct a set of currently unqueried samples that does not contain currently queried samples, and use a multi-cooperative screening mechanism to perform multiple screenings on the set of currently unqueried samples to obtain the target set of unqueried samples; the multi-cooperative screening mechanism is a pre-constructed screening mechanism based on diversity, uncertainty and differential sampling. 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; 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; Step S5: Determine whether the current query round has reached the preset query round; Step S6: If the current query round has not reached the preset query round, the trained model is determined as the current model to be trained, and the samples in the active learning query set of the current query round are determined as the currently queried samples. Steps S2 to S5 are executed again until the current query round reaches the preset query round, at which point the trained model is determined as the trained replacement model.
[0007] Optionally, before determining the initial model possessing partial knowledge of the target model as the current model to be trained, the method further includes: Obtain a public dataset that is coupled with the target model scene; Extract the corresponding data from the public dataset to obtain the initial query sample; The initial predicted labels are obtained by querying the target model using the initial query samples, and an initial query set is constructed based on the initial query samples and the initial predicted labels; The initial query set is used to initialize the training model to obtain an initial model with some knowledge of the target model. The step of determining the currently queried sample includes: The samples in the initial query set are identified as the currently queried samples; Furthermore, the construction of a set of currently unqueried samples that does not include currently queried samples includes: Filter the currently queried samples in the public dataset to obtain the currently unqueried sample set.
[0008] Optionally, the step of using a multi-collaborative filtering mechanism to perform multiple filtering on the current unqueried sample set to obtain the target unqueried sample set includes: The currently unqueried sample set is identified as the current sample set to be filtered. Input the samples in the current sample set to be screened into the initial model to obtain the classification probability vector of the samples, and determine the highest classification probability in the classification probability vector; The category label corresponding to the highest classification probability is determined as the target category label for the unqueried sample; Samples with the same target category label are grouped together to obtain a subset of unqueried samples corresponding to each target category label; A first preset number of samples are selected from each of the aforementioned unqueried sample subsets to obtain a diverse sample set; The diverse sample set is used as the current sample set to be screened. The steps of inputting the samples in the current sample set to be screened into the initial model, obtaining the classification probability vector of the samples, and determining the highest classification probability in the classification probability vector are executed again. The marginal probability of a sample is determined based on the highest classification probability, and the samples are sorted in ascending order based on the marginal probability to obtain the current sorted sample set to be screened. Determine the first number of samples in the diversity sample set, and determine the first screening quantity based on the first number of samples; From the currently sorted set of samples to be screened, select the first number of samples to be screened to obtain the uncertain sample set; Obtain the active learning query set from the previous query round, and calculate the predicted query difference of each sample in the active learning query set from the previous query round. Based on the predicted query difference, each sample in the active learning query set of the previous query round is sorted in descending order, and the first second preset number of samples are selected from the sorted active learning query set of the previous query round to obtain the sample set to be compared. Determine the sample feature similarity between the sample set to be compared and each sample in the uncertain sample set, and sort the samples in the uncertain sample set in descending order based on the sample feature similarity to obtain the sorted uncertain sample set; Determine the second number of samples in the uncertain sample set, and determine the second screening quantity based on the second number of samples; The first second number of samples are selected from the sorted uncertain sample set to obtain the target unqueried sample set.
[0009] Optionally, the step of actively learning the query set based on the current query round and training the current model to be trained using a model training algorithm based on superpixel gradient alignment to obtain the trained model includes: An image sample is selected sequentially from the active learning query set of the current query round, and the image sample is segmented into superpixels to obtain a superpixel set. The first superpixel gradient is obtained by calculating the superpixel gradient of the target model on the image sample based on the superpixel set. The superpixel gradient of the current model to be trained on the image sample is calculated based on the superpixel set to obtain the second superpixel gradient; Calculate the gradient alignment loss between the first superpixel gradient and the second superpixel gradient; Calculate the classification loss of the target model and the current model to be trained for the image samples; The target loss is determined based on the gradient alignment loss and the classification loss, and the current model to be trained is trained based on the target loss to obtain the trained model.
[0010] Optionally, the step of performing superpixel segmentation on the image samples to obtain a superpixel set includes: Calculate the kernel density corresponding to each pixel on the image sample, and determine the neighboring pixels of each pixel and the neighborhood distance between them; For each pixel, neighboring pixels whose kernel density is greater than that of their corresponding kernel density and whose neighboring distance satisfies a preset distance condition are determined as the parent node of each pixel; wherein each pixel points to its corresponding parent node, forming a directed tree; Determine the spatial distance between parent and child nodes in the directed tree, and determine whether the spatial distance between parent and child nodes exceeds a preset spatial distance threshold; When the spatial distance between parent and child nodes exceeds the preset spatial distance threshold, the edges corresponding to the parent and child nodes are split to decompose the directed tree into multiple subtrees, resulting in a superpixel set; wherein each subtree corresponds to a superpixel block.
[0011] Optionally, the step of calculating the superpixel gradient of the target model on the image sample based on the superpixel set to obtain the first superpixel gradient includes: Add the same perturbation to all pixels in each channel of each superpixel block in the superpixel set; The superpixel gradient of the target model for each superpixel block is estimated based on each superpixel block after perturbation. The superpixel gradient of the image sample is determined based on the superpixel gradient of each superpixel block, and the first superpixel gradient is obtained. Furthermore, the step of calculating the superpixel gradient of the current model to be trained on the image samples based on the superpixel set to obtain the second superpixel gradient includes: The image samples are input into the current model to be trained to obtain the query labels, and the prediction loss of the current model to be trained for the query labels is calculated. Calculate the pixel-level gradient of the image sample in each channel based on the prediction loss; The pixel gradient of each superpixel block in the superpixel set is determined based on the pixel-level gradient of the image sample in each channel; The pixel gradients of all superpixel blocks are aggregated to obtain the second superpixel gradient.
[0012] Optionally, after calculating the superpixel gradient of the target model on the image sample based on the superpixel set to obtain the first superpixel gradient, the method further includes: The first superpixel gradient is purified to obtain the purified first superpixel gradient. The step of purifying the gradient of the first superpixel to obtain the purified first superpixel gradient includes: Obtain the superpixel gradient for each channel, and determine the maximum positive gradient and minimum negative gradient among the superpixel gradients for each channel; Based on the maximum positive gradient value and the preset ratio hyperparameter in the superpixel gradient of each channel, the positive gradient signal in the superpixel gradient of each channel is filtered respectively, and the first filtered superpixel gradient is normalized to obtain the first normalized superpixel gradient. Based on the minimum negative gradient 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 respectively, 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 combined to obtain the purified first superpixel gradient.
[0013] Secondly, the present invention also discloses a model training apparatus, wherein the apparatus comprises: The model determination module is used to determine the initial model that has some knowledge of the target model as the current model to be trained, and to determine the currently queried samples; the target model is a trained image classification model. The sample filtering module is used to construct a set of currently unqueried samples that does not contain currently queried samples, and to perform multiple filtering on the set of currently unqueried samples using a multi-collaborative filtering mechanism to obtain the target set of unqueried samples; the multi-collaborative filtering mechanism is a pre-built filtering mechanism based on diversity, uncertainty and differential sampling. The tag acquisition module is used to query the target model using the target unqueried sample set, obtain the predicted tag for the current query round, and construct the active learning query set for the current query round based on the predicted tag for the current query round and the target unqueried sample set. The model training module is used to actively learn the query set based on the current query round and train the current model to be trained using a model training algorithm based on superpixel gradient alignment to obtain the trained model. The round determination module is used to determine whether the current query round has reached the preset query round. The iterative training module is used to determine the trained model as the current model to be trained if the current query round has not reached the preset query round, and to determine the samples in the active learning query set of the current query round as the currently queried samples. The step of constructing a set of currently unqueried samples that does not contain the currently queried samples and its subsequent steps are re-executed until the current query round reaches the preset query round, at which point the trained model is determined as the trained alternative model.
[0014] Thirdly, the present invention discloses a terminal, comprising: a memory, a 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 for the high-resolution image classification model as described above.
[0015] Fourthly, the present invention discloses a computer-readable storage medium storing a computer program that can be executed to implement the steps of the model extraction and training method for the high-resolution image classification model as described above.
[0016] This invention provides a model extraction and training method, apparatus, terminal, and medium for a high-resolution image classification model. The model extraction and training method for the high-resolution image classification model includes: determining an initial model possessing partial knowledge of the target model as the current model to be trained, and determining the currently queried samples; the target model is a trained image classification model; constructing a set of currently unqueried samples that does not contain the currently queried samples, and using a multi-cooperative screening mechanism to perform multiple screenings on the set of currently unqueried samples to obtain a target set of unqueried samples; the multi-cooperative screening mechanism is a pre-constructed screening mechanism based on diversity, uncertainty, and differential sampling; using the target set of unqueried samples to query the target model, obtaining the predicted label for the current query round, and based on the current query... The predicted labels of each round and the target unqueried sample set are used to construct the active learning query set for the current query round. Based on the active learning query set for the current query round, the current model to be trained is trained using a model training algorithm based on superpixel gradient alignment to obtain the trained model. It is determined whether the current query round has reached the preset query round. If the current query round has not reached the preset query round, the trained model is determined as the current model to be trained, and the samples in the active learning query set of the current query round are determined as the currently queried samples. The step of constructing the current unqueried sample set that does not contain the currently queried samples and its subsequent steps are repeated until the current query round reaches the preset query round. At this point, the trained model is determined as the trained replacement model.
[0017] Therefore, this invention, through a multi-cooperative screening mechanism based on diversity, uncertainty, and differential sampling, can select data samples that have the greatest benefit effect on model training, ensuring that the model can fully learn from the selected high-quality samples, thereby significantly improving training efficiency. Furthermore, through a model training algorithm based on superpixel gradient alignment, by synchronizing the superpixel gradients of the target model and the alternative model, it provides richer supervision information for 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. Attached Figure Description
[0018] Figure 1 This is a flowchart of a preferred embodiment of the model extraction and training method for the high-resolution image classification model in this invention; Figure 2 This is a logical block diagram illustrating the multiple collaborative screening mechanism in this invention; Figure 3 This is a logical block diagram of the model training algorithm based on superpixel gradient alignment in this invention; Figure 4 This is a logical block diagram of a preferred embodiment of the model extraction and training method for the high-resolution image classification model in this invention; Figure 5 This is a functional principle block diagram of a preferred embodiment of the model training device in this invention; Figure 6 This is a functional principle block diagram of a preferred embodiment of the terminal in this invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0020] See Figure 1 , Figure 1 This is a flowchart of the model extraction and training method for the high-resolution image classification model in this invention. For example... Figure 1 As shown, the model extraction and training method for the high-resolution image classification model described in this embodiment of the invention includes: Step S1: Determine the initial model that has some knowledge of the target model as the current model to be trained, and determine the currently queried samples; the target model is the trained image classification model.
[0021] The trained image classification model can be either an image classification model for processing low-resolution images or an image classification model for processing high-resolution images. The definitions of low-resolution and high-resolution images also differ for different fields. For example, in the general display field, images with less than 640×480 pixels (such as 320×240) are usually considered low-resolution images, while images with more than 1280×720 pixels are considered high-resolution images. In the remote sensing and professional imaging fields, satellite images with a spatial resolution of more than 10 meters per pixel are classified as low-resolution. In medical imaging, MRI data with 256×256 pixels may be considered low-resolution due to insufficient detail, while CT / MRI data with more than 512×512 pixels are usually considered high-resolution in medical imaging.
[0022] In this embodiment, before determining the initial model possessing partial knowledge of the target model as the current model to be trained, the process may further include: acquiring a public dataset coupled with the target model's scenario; extracting corresponding data from the public dataset to obtain initial query samples; using the initial query samples to query the target model to obtain initial prediction labels, and constructing an initial query set based on the initial query samples and initial prediction labels; and using the initial query set to initialize and train the model to be trained to obtain an initial model possessing partial knowledge of the target model. It can be understood that the initial model is a model possessing partial knowledge of the target model obtained after initializing and training the original substitute model used to replace the target model.
[0023] Specifically, determining the currently queried sample can include: identifying samples in the initial query set as the currently queried samples.
[0024] For example, first select a public dataset that is coupled with the target model scene. Choose an alternative model based on the task scenario. The structure is defined, and its parameters are initialized. (From a public dataset) Extraction Sample As an initial query sample, it is used to query the target model. Then, the predicted labels are obtained. ,in, represent The parameters. The query samples and predicted labels 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... .
[0025] Step S2: Construct a set of currently unqueried samples that does not contain currently queried samples, and use a multi-cooperative screening mechanism to perform multiple screenings on the set of currently unqueried samples to obtain the target set of unqueried samples; the multi-cooperative screening mechanism is a pre-constructed screening mechanism based on diversity, uncertainty and differential sampling.
[0026] In this embodiment, constructing a set of currently unqueried samples that does not contain currently queried samples specifically includes: filtering currently queried samples from the public dataset to obtain a set of currently unqueried samples. For example, filtering the public dataset... Queryed samples Get the currently unqueried sample set .
[0027] It should be noted that in actual alternative model training scenarios, the distribution of training data for the target model is usually unknown. With the continuous increase in the amount of high-resolution image data, it is necessary to sample from massive amounts of public data to construct a query sample set. Simple random sampling strategies often result in insufficient sample information value, causing the alternative model to make a large number of query requests to the target model, which significantly increases the query cost. Therefore, in order to solve the above problems, existing technologies generally use active learning methods to filter and optimize public data. Using active learning methods to filter query samples can reduce training costs and accelerate the convergence of alternative models.
[0028] Active learning mechanisms, by allowing the model to autonomously select the most informative data for learning during training, can effectively reduce the number of queries required for alternative models. However, current technologies rely on a single criterion (such as simply considering feature diversity or predictive entropy) for sample selection. This single-dimensional selection criterion may lead to inaccurate sample selection, affecting the overall efficiency of model training. Moreover, when the target model is specifically an image classification model for high-resolution images, the computational overhead of training its alternative models is high (e.g., memory usage, training time). Therefore, from the perspective of multi-dimensional information value assessment, a selection mechanism based on diversity, uncertainty, and differential sampling is used to optimize the selection on image datasets coupled with the target scene. That is, a cascaded approach is adopted to combine the three selection criteria. The subsequent strategy iteratively optimizes the samples selected by the preceding strategy, significantly reducing the query cost during the training of alternative models for high-resolution image classification models.
[0029] In this embodiment, a multi-collaborative screening mechanism is used to perform multiple screenings on the current unqueried sample set to obtain a target unqueried sample set. Specifically, this may include: determining the current unqueried sample set as the current sample set to be screened; inputting the samples in the current sample set to be screened into the initial model to obtain the classification probability vector of the samples, and determining the highest classification probability in the classification probability vector; determining the category label corresponding to the highest classification probability as the target category label corresponding to the unqueried sample; classifying the samples with the same target category label to obtain the unqueried sample subset corresponding to each target category label; selecting a first preset number of samples from each unqueried sample subset to obtain a diversity sample set; using the diversity sample set as the current sample set to be screened, and re-executing the steps of inputting the samples in the current sample set to be screened into the initial model to obtain the classification probability vector of the samples, and determining the highest classification probability in the classification probability vector; determining the marginal probability of the sample based on the highest classification probability, and sorting the samples in ascending order based on the marginal probability to obtain the current sorted sample set. The process involves: determining the sample set to be screened; determining the first number of samples in the diversity sample set and determining the first screening quantity based on the first number of samples; selecting the first screening quantity of samples from the currently sorted sample set to obtain the uncertain sample set; obtaining the active learning query set from the previous query round and calculating the predicted query difference of each sample in the active learning query set from the previous query round; sorting each sample in the active learning query set from the previous query round in descending order based on the predicted query difference, and selecting the first second preset quantity of samples from the sorted active learning query set from the previous query round to obtain the sample set to be compared; determining the sample feature similarity between the sample set to be compared and each sample in the uncertain sample set, and sorting the samples in the uncertain sample set in descending order based on the sample feature similarity to obtain the sorted uncertain sample set; determining the second number of samples in the uncertain sample set and determining the second screening quantity based on the second number of samples; and selecting the first second screening quantity of samples from the sorted uncertain sample set to obtain the target unqueried sample set.
[0030] It should be noted that sampling a first preset number of samples from the subset of unqueried samples corresponding to each target category label ensures that the samples sampled in this stage are evenly distributed across all categories. The first preset number can be one or more, the second preset number can be multiple, and the first selection number can be a first preset proportion of the first number of samples, while the second selection number can be a second preset proportion of the second number of samples. For example, if the first selection number is 10, the first 10 samples are selected from the currently sorted set of samples to be selected, resulting in an uncertain sample set. If the second preset number is 10, the first 10 samples are selected from the sorted set of samples from the previous query round's active learning query set, resulting in a set of samples to be compared. Furthermore, if the second selection number is 10, the first 10 samples are selected from the sorted set of uncertain samples, resulting in the target unqueried sample set.
[0031] Understandably, from the perspective of multi-dimensional information value assessment, the selection of images coupled with the target scene based on the screening mechanism of diversity, uncertainty, and differential sampling can improve sample diversity. This ensures that the query set covers all categories of samples as evenly as possible, enabling the alternative model to fully learn the knowledge distribution of the target model and avoid overfitting or underfitting due to the category distribution bias of the query samples. It can also improve uncertainty by helping to identify samples near the decision boundary of the target model. These samples can effectively characterize the decision boundary of the target model, thereby improving the predictive consistency between the alternative model and the target model. Furthermore, it can improve differential sampling by prioritizing samples with large differences between the predictions of the alternative model and the target model. These samples can efficiently correct the errors of the alternative model and accelerate the approach to the decision boundary of the target model.
[0032] Specifically, the three screening criteria—uncertainty sampling, diversity sampling, and differential sampling—are combined in a cascaded design. These three criteria work synergistically to comprehensively evaluate the value of samples from different perspectives, thereby improving the target model. Active learning and querying. (Round 1) The specific execution process of the wheel is as follows: In diversity sampling, from public datasets Filter out samples that were not queried , Include One sample. Unqueried samples. enter , obtain Classification probability vector ,in, represent The parameters. For any , ,in, Classification probability vector The first in Each component represents an alternative model. predict For category The probability of the input sample. The class label with the highest probability in the prediction vector .Right now: ; Then, data points with the same highest probability category are grouped into the same subset, i.e.: ; 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 .
[0033] 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.
[0034] Determine the input sample The class label with the highest probability in the prediction vector ,Right now: ; Using marginal probabilities The uncertainty of a sample is measured as follows: ; in, The representative category label is The highest classification probability vector corresponding to the time; the lower the marginal probability, the higher the uncertainty.
[0035] from Filtering for the lowest edge probability One sample, as Then proceed to the next stage of screening.
[0036] 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.
[0037] 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: ; in, represent Divergence loss.
[0038] from Search and The sample with the closest features 1 sample as the final sample set .
[0039] Furthermore, the overall algorithm flow of the multiple collaborative screening mechanism is shown in Table 1, namely: Table 1
[0040] 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.
[0041] 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. .
[0042] 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.
[0043] Understandably, to address the issue of overfitting in training surrogate models for high-resolution image classification tasks by relying solely on the target model's label predictions and cross-entropy loss, sample gradient similarity loss is introduced as a regularization method to constrain the training of the surrogate model, thereby improving generalization ability. Specifically, during the model training phase, a model training algorithm based on superpixel gradient alignment is used, employing a joint optimization strategy of cross-entropy loss and sample gradient similarity loss.
[0044] It should be noted that the gradient of the target model implicitly contains key information about 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 is unavailable, existing techniques typically perform pixel-by-pixel gradient estimation on the input image. However, high-resolution images contain too many pixels, making pixel-by-pixel gradient estimation computationally too complex and requiring frequent queries to the target model, increasing query costs. Therefore, this embodiment uses superpixel blocks (local regions of similar pixels) to segment the image and performs gradient estimation on a superpixel block basis, which reduces computational complexity while maintaining gradient estimation accuracy.
[0045] Specifically, an image sample is selected from the active learning query set of the current query round, and the image sample is segmented into superpixels to obtain a superpixel set; the superpixel gradient of the target model with respect to the image sample is calculated based on the superpixel set to obtain the first superpixel gradient; the superpixel gradient of the current model to be trained with respect to the image sample is calculated based on the superpixel set to obtain the second superpixel gradient; the gradient alignment loss between the first and second superpixel gradients is calculated; the classification loss of the target model and the current model to be trained with respect to the image sample is calculated; the target loss is determined based on the gradient alignment loss and the classification loss, and the current model to be trained is trained based on the target loss to obtain the trained model.
[0046] In this embodiment, superpixel segmentation of image samples to obtain a superpixel set may specifically include: calculating the kernel density corresponding to each pixel on the image sample, and determining the neighboring pixels of each pixel and the neighborhood distance between them; for each pixel, determining the parent node corresponding to each pixel whose kernel density is greater than its corresponding kernel density and whose neighborhood distance satisfies a preset distance condition; wherein each pixel points to its corresponding parent node, forming a directed tree; determining the spatial distance between parent and child nodes in the directed tree, and judging whether the spatial distance between parent and child nodes exceeds a preset spatial distance threshold; when the spatial distance between parent and child nodes exceeds the preset spatial distance threshold, then segmenting the edges corresponding to the parent and child nodes to decompose the directed tree into multiple subtrees to obtain a superpixel set; wherein each subtree corresponds to a superpixel block, and the preset distance condition is that the neighborhood distance satisfies the nearest condition.
[0047] 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.
[0048] 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.
[0049] 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.
[0050] 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.: ; 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.
[0051] If pixel-level gradient estimation is used, the number of queries will grow exponentially. For high-resolution images (such as 224×224), the query cost is too high. Therefore, a superpixel gradient estimation method is used, which divides the image into multiple superpixel blocks and performs gradient estimation on each superpixel block.
[0052] For example, the specific process of segmenting an image into multiple superpixel blocks is as follows: First, the kernel density of each pixel must be calculated, that is: ; Taking RGB three-channel as an example, among which, Represents the j-th pixel. , For pixel space coordinates, For RGB color space components, Represents the kernel bandwidth of color similarity. Represents the spatial distance kernel bandwidth. Representing pixels All neighboring pixels.
[0053] For each pixel Find the neighborhood with a density that is strictly greater than and the nearest pixel As the parent node, that is: ; Each pixel points to its parent node. This forms one or more oriented trees.
[0054] By setting a spatial distance threshold Cutting excessively long edges in a tree (i.e., the spatial distance between parent and child nodes exceeds a certain limit) (edges), decompose the tree into Each subtree corresponds to a superpixel block, ultimately resulting in a superpixel set. .
[0055] Then the superpixel block Add the same perturbation to all pixels in all three channels, then estimate. The superpixel gradient, i.e.: ; in, , Represents pixel blocks The number of pixels contained therein.
[0056] Because the sample gradient estimation results have large variance and are easily affected by noise, gradient purification is required after calculating all superpixel gradients. Only the gradient values with the strongest signals (extreme values) are retained, and weak signals are filtered out.
[0057] Specifically, calculate each channel. superpixel gradient set and the maximum value of the positive gradient within that channel. Minimum of negative gradient ; Filter the positive gradient signal and normalize it to obtain ,in, For a pre-set scaling hyperparameter, a larger positive gradient value indicates... The more sensitive the pixel region is to changes, the better; filtering negative gradient signals and normalizing them yields... A smaller negative gradient value indicates that the pixel region may be noise or irrelevant background; merge the filtering results to obtain .
[0058] Furthermore, the superpixel gradient of the current training model on the image sample is calculated based on the superpixel set to obtain the second superpixel gradient. Specifically, this may include: inputting the image sample into the current training model to obtain the query label, and calculating the prediction loss of the current training model on the query label; calculating the pixel-level gradient of the image sample in each channel based on the prediction loss, determining the pixel gradient of each superpixel block in the superpixel set based on the pixel-level gradient of the image sample in each channel; and aggregating the pixel gradients of all superpixel blocks to obtain the second superpixel gradient.
[0059] For example, in obtaining After calculating the superpixel gradient, in order to align the gradient with the target model, it is also necessary to calculate... The superpixel gradient.
[0060] It should be noted that, due to having White-box access permissions, therefore its superpixel blocks Gradients can be aggregated directly from pixel gradients. The specific execution process is as follows: First, the sample enter Get query tags Calculate the prediction loss of the alternative model for the query tag, i.e.: ; Then, according to Calculate samples In the passage pixel-level gradient Aggregate the pixel gradients of each superpixel block, i.e.: ; Finally, the input sample is obtained by summing the gradients of all superpixel blocks. Superpixel gradient .
[0061] Furthermore, in obtaining superpixel gradients After that, the classification loss also needs to be calculated. ,Right now: ; 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.: ; The loss function of the final alternative model is: ,in, Represents balance and Hyperparameters.
[0062] 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. Ultimately, the similarity loss and classification loss The weighted summation yields the loss function of the alternative model. .
[0063] Step S5: Determine whether the current query round has reached the preset query round.
[0064] Understandably, after completing model training for each query round, it is determined whether the current query round has reached the preset query round.
[0065] Step S6: If the current query round has not reached the preset query round, the trained model is determined as the current model to be trained, and the samples in the active learning query set of the current query round are determined as the currently queried samples. Steps S2 to S5 are executed again until the current query round reaches the preset query round, at which point the trained model is determined as the trained replacement model.
[0066] In this embodiment, during the model training process, if the model training for all preset query rounds has not been completed, the samples in the active learning query set of the current query round are determined as the currently queried samples. The steps of constructing a set of currently unqueried samples that does not contain the currently queried samples and subsequent steps are re-executed until the current query round reaches the preset query round, indicating that the model training for all preset query rounds has been completed, and the trained model is determined as the trained alternative model.
[0067] The training algorithm flow for the alternative model based on gradient alignment regularization is shown in Table 2, namely: Table 2
[0068] It should be noted that the evaluation metrics for the alternative model during training include both accuracy and consistency.
[0069] Accuracy refers to the degree of matching between the classification results of the surrogate model and the true labels, i.e., given a test dataset. Calculate the accuracy rate, that is: ; in, Indicates an indicator function, when The value is 1 if the condition is met, and 0 otherwise. N represents the number of samples in the test dataset.
[0070] Furthermore, consistency refers to the degree of similarity between the classification results of the surrogate model and the classification results of the target model, i.e., the similarity between the test dataset and the target dataset. Consistency in calculation, that is: ; 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.
[0071] 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 query set From the existing samples, a subset of high-value samples were re-selected. A new round of training has begun.
[0072] In this embodiment, multidimensional information value active learning is combined with gradient alignment regularization, significantly improving the efficiency and accuracy of model training. Given the massive scale of current high-resolution image datasets, and to ensure that the alternative model can fully learn from the high-quality samples selected by the active learning method, the multidimensional information value active learning method can select the data samples with the greatest benefit to model training from a large number of public datasets, thereby greatly improving training efficiency. Furthermore, the superpixel gradient alignment method 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. In particular, addressing the problem of excessive query counts in traditional pixel-by-pixel gradient estimation methods, a superpixel block-based gradient estimation strategy is used to divide the image into superpixel regions for overall gradient estimation, significantly reducing the required number of target model queries while ensuring gradient estimation accuracy.
[0073] It should be noted that, in addition to employing superpixel gradient alignment technology, various regularization methods can be used to improve the performance of alternative models. For example, the Grad-CAM-based visual interpretation method can effectively identify key discriminant regions of the target model in image samples, and these regions are highly correlated with the model's prediction results. For instance, firstly, discriminant regions in the image are systematically erased, and the processed samples are re-inputted into the target model to obtain new classification labels; secondly, 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 erasure and soft label estimation can not only effectively constrain the training process of the alternative model, but also significantly improve its generalization ability.
[0074] In one embodiment, such as Figure 5 As shown, based on the model extraction and training method of the above-mentioned high-resolution image classification model, the present invention also provides a model training device, including: The model determination module 11 is used to determine the initial model that has some knowledge of the target model as the current model to be trained, and to determine the currently queried samples; the target model is a trained image classification model; The sample filtering module 12 is used to construct a set of currently unqueried samples that does not contain currently queried samples, and to perform multiple filtering on the set of currently unqueried samples using a multi-collaborative filtering mechanism to obtain a target set of unqueried samples; the multi-collaborative filtering mechanism is a pre-constructed filtering mechanism based on diversity, uncertainty and differential sampling. The tag acquisition module 13 is used to query the target model using the target unqueried sample set, obtain the predicted tag for the current query round, and construct the active learning query set for the current query round based on the predicted tag for the current query round and the target unqueried sample set. Model training module 14 is used to actively learn the query set based on the current query round and train the current model to be trained using a model training algorithm based on superpixel gradient alignment to obtain the trained model. Round determination module 15 is used to determine whether the current query round has reached the preset query round; The loop training module 16 is used to determine the trained model as the current model to be trained and the samples in the active learning query set of the current query round as the currently queried samples if the current query round has not reached the preset query round. The step of constructing the current unqueried sample set that does not contain the currently queried samples and its subsequent steps are re-executed until the current query round reaches the preset query round, and then the trained model is determined as the trained alternative model.
[0075] Furthermore, it is worth noting that the working process of the model training device provided in this embodiment is the same as that of the model extraction and training method for the high-resolution image classification model described above, and will not be repeated here. For details, please refer to the working process of the model extraction and training method for the high-resolution image classification model described above.
[0076] Figure 6 A schematic diagram of the structure of a terminal provided in an embodiment of this application. The terminal may include: The memory 501, the processor 502, and the computer program stored on the memory 501 and capable of running on the processor 502.
[0077] When the processor 502 executes the program, it implements the model extraction and training method for the high-resolution image classification model provided in the above embodiments.
[0078] Furthermore, the terminal also includes: Communication interface 503 is used for communication between memory 501 and processor 502.
[0079] The memory 501 is used to store computer programs that can run on the processor 502.
[0080] Memory 501 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0081] If the memory 501, processor 502, and communication interface 503 are implemented independently, they can be interconnected via a bus to communicate with 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. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one line is used in the diagram, but this does not imply that there is only one bus or one type of bus.
[0082] Optionally, in a specific implementation, if the memory 501, processor 502, and communication interface 503 are integrated on a single chip, then the memory 501, processor 502, and communication interface 503 can communicate with each other through an internal interface.
[0083] Processor 502 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0084] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the model extraction and training method for the high-resolution image classification model described above.
[0085] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the claims.
[0086] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0087] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can read and execute instructions from and from an instruction execution system, apparatus or device).
[0088] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0089] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A method for model extraction and training of a high-resolution image classification model, characterized in that, The method includes: Step S1: Determine the initial model that possesses some knowledge of the target model as the current model to be trained, and determine the currently queried samples; the target model is the trained image classification model; Step S2: Construct a set of currently unqueried samples that does not contain currently queried samples, and use a multi-cooperative screening mechanism to perform multiple screenings on the set of currently unqueried samples to obtain the target set of unqueried samples; the multi-cooperative screening mechanism is a pre-constructed screening mechanism based on diversity, uncertainty and differential sampling. 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; 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; Step S5: Determine whether the current query round has reached the preset query round; Step S6: If the current query round has not reached the preset query round, the trained model is determined as the current model to be trained, and the samples in the active learning query set of the current query round are determined as the currently queried samples. Steps S2 to S5 are executed again until the current query round reaches the preset query round, at which point the trained model is determined as the trained replacement model.
2. The model extraction and training method for the high-resolution image classification model according to claim 1, characterized in that, Before determining the initial model, which possesses partial knowledge of the target model, as the current model to be trained, the process also includes: Obtain a public dataset that is coupled with the target model scene; Extract the corresponding data from the public dataset to obtain the initial query sample; The initial predicted labels are obtained by querying the target model using the initial query samples, and an initial query set is constructed based on the initial query samples and the initial predicted labels; The initial query set is used to initialize the training model to obtain an initial model with some knowledge of the target model. The step of determining the currently queried sample includes: The samples in the initial query set are identified as the currently queried samples; Furthermore, the construction of a set of currently unqueried samples that does not include currently queried samples includes: Filter the currently queried samples in the public dataset to obtain the currently unqueried sample set.
3. The model extraction and training method for the high-resolution image classification model according to claim 1, characterized in that, The method of using a multi-collaborative filtering mechanism to perform multiple filtering on the current unqueried sample set to obtain the target unqueried sample set includes: The currently unqueried sample set is identified as the current sample set to be filtered. Input the samples in the current sample set to be screened into the initial model to obtain the classification probability vector of the samples, and determine the highest classification probability in the classification probability vector; The category label corresponding to the highest classification probability is determined as the target category label for the unqueried sample; Samples with the same target category label are grouped together to obtain a subset of unqueried samples corresponding to each target category label; A first preset number of samples are selected from each of the aforementioned unqueried sample subsets to obtain a diverse sample set; The diverse sample set is used as the current sample set to be screened. The steps of inputting the samples in the current sample set to be screened into the initial model, obtaining the classification probability vector of the samples, and determining the highest classification probability in the classification probability vector are executed again. The marginal probability of a sample is determined based on the highest classification probability, and the samples are sorted in ascending order based on the marginal probability to obtain the current sorted sample set to be screened. Determine the first number of samples in the diversity sample set, and determine the first screening quantity based on the first number of samples; From the currently sorted set of samples to be screened, select the first number of samples to be screened to obtain the uncertain sample set; Obtain the active learning query set from the previous query round, and calculate the predicted query difference of each sample in the active learning query set from the previous query round. Based on the predicted query difference, each sample in the active learning query set of the previous query round is sorted in descending order, and the first second preset number of samples are selected from the sorted active learning query set of the previous query round to obtain the sample set to be compared. Determine the sample feature similarity between the sample set to be compared and each sample in the uncertain sample set, and sort the samples in the uncertain sample set in descending order based on the sample feature similarity to obtain the sorted uncertain sample set; Determine the second number of samples in the uncertain sample set, and determine the second screening quantity based on the second number of samples; The first second number of samples are selected from the sorted uncertain sample set to obtain the target unqueried sample set.
4. The model extraction and training method for a high-resolution image classification model according to any one of claims 1 to 3, characterized in that, The actively learned query set based on the current query round, and the current model to be trained using a model training algorithm based on superpixel gradient alignment, to obtain the trained model, includes: An image sample is selected sequentially from the active learning query set of the current query round, and the image sample is segmented into superpixels to obtain a superpixel set. The first superpixel gradient is obtained by calculating the superpixel gradient of the target model on the image sample based on the superpixel set. The superpixel gradient of the current model to be trained on the image sample is calculated based on the superpixel set to obtain the second superpixel gradient; Calculate the gradient alignment loss between the first superpixel gradient and the second superpixel gradient; Calculate the classification loss of the target model and the current model to be trained for the image samples; The target loss is determined based on the gradient alignment loss and the classification loss, and the current model to be trained is trained based on the target loss to obtain the trained model.
5. The model extraction and training method for the high-resolution image classification model according to claim 4, characterized in that, The step of performing superpixel segmentation on the image samples to obtain a superpixel set includes: Calculate the kernel density corresponding to each pixel on the image sample, and determine the neighboring pixels of each pixel and the neighborhood distance between them; For each pixel, neighboring pixels whose kernel density is greater than that of their corresponding kernel density and whose neighboring distance satisfies a preset distance condition are determined as the parent node of each pixel; wherein each pixel points to its corresponding parent node, forming a directed tree; Determine the spatial distance between parent and child nodes in the directed tree, and determine whether the spatial distance between parent and child nodes exceeds a preset spatial distance threshold; When the spatial distance between parent and child nodes exceeds the preset spatial distance threshold, the edges corresponding to the parent and child nodes are split to decompose the directed tree into multiple subtrees, resulting in a superpixel set; wherein each subtree corresponds to a superpixel block.
6. The model extraction and training method for the high-resolution image classification model according to claim 4, characterized in that, The step of calculating the superpixel gradient of the target model on the image sample based on the superpixel set to obtain the first superpixel gradient includes: Add the same perturbation to all pixels in each channel of each superpixel block in the superpixel set; The superpixel gradient of the target model for each superpixel block is estimated based on each superpixel block after perturbation. The superpixel gradient of the image sample is determined based on the superpixel gradient of each superpixel block, and the first superpixel gradient is obtained. Furthermore, the step of calculating the superpixel gradient of the current model to be trained on the image samples based on the superpixel set to obtain the second superpixel gradient includes: The image samples are input into the current model to be trained to obtain the query labels, and the prediction loss of the current model to be trained for the query labels is calculated. Calculate the pixel-level gradient of the image sample in each channel based on the prediction loss; The pixel gradient of each superpixel block in the superpixel set is determined based on the pixel-level gradient of the image sample in each channel; The pixel gradients of all superpixel blocks are aggregated to obtain the second superpixel gradient.
7. The model extraction and training method for the high-resolution image classification model according to claim 4, characterized in that, After calculating the superpixel gradient of the target model on the image sample based on the superpixel set to obtain the first superpixel gradient, the method further includes: The first superpixel gradient is purified to obtain the purified first superpixel gradient. The step of purifying the gradient of the first superpixel to obtain the purified first superpixel gradient includes: Obtain the superpixel gradient for each channel, and determine the maximum positive gradient and minimum negative gradient among the superpixel gradients for each channel; Based on the maximum positive gradient value and the preset ratio hyperparameter in the superpixel gradient of each channel, the positive gradient signal in the superpixel gradient of each channel is filtered respectively, and the first filtered superpixel gradient is normalized to obtain the first normalized superpixel gradient. Based on the minimum negative gradient 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 respectively, 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 combined to obtain the purified first superpixel gradient.
8. A model training device, characterized in that, The device includes: The model determination module is used to determine the initial model that has some knowledge of the target model as the current model to be trained, and to determine the currently queried samples; the target model is a trained image classification model. The sample filtering module is used to construct a set of currently unqueried samples that does not contain currently queried samples, and to perform multiple filtering on the set of currently unqueried samples using a multi-collaborative filtering mechanism to obtain the target set of unqueried samples; the multi-collaborative filtering mechanism is a pre-built filtering mechanism based on diversity, uncertainty and differential sampling. The tag acquisition module is used to query the target model using the target unqueried sample set, obtain the predicted tag for the current query round, and construct the active learning query set for the current query round based on the predicted tag for the current query round and the target unqueried sample set. The model training module is used to actively learn the query set based on the current query round and train the current model to be trained using a model training algorithm based on superpixel gradient alignment to obtain the trained model. The round determination module is used to determine whether the current query round has reached the preset query round. The iterative training module is used to determine the trained model as the current model to be trained if the current query round has not reached the preset query round, and to determine the samples in the active learning query set of the current query round as the currently queried samples. The step of constructing a set of currently unqueried samples that does not contain the currently queried samples and its subsequent steps are re-executed until the current query round reaches the preset query round, at which point the trained model is determined as the trained alternative model.
9. A terminal, characterized in that, include: The system includes a memory, a 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 and training method for a high-resolution image classification model as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that can be executed to implement the steps of the model extraction and training method for the high-resolution image classification model as described in any one of claims 1 to 7.
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