Aerial image target detection method based on classification-positioning double-branch interactive distillation
By adopting the classification-positioning dual-branch interactive distillation method in aerial image object detection, dynamically selecting the distillation area and generating output predictions, the problems of insufficient calculation and parameter quantity and insufficient branch interaction capabilities of traditional models on the edge computing platform are solved. Improves detection performance and robustness.
Patent Information
- Application Number
- CN202411254438.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-09-09
AI Technical Summary
The traditional high-precision aerial image object detection model is limited in the calculation amount and parameters when deployed on the edge computing platform, and the classification branch and positioning branch are insufficient in the interaction ability during the knowledge distillation process, resulting in insufficient detection accuracy and robustness.
Adopting aerial image object detection method based on classification-positioning dual-branch interactive distillation, through interactive distillation area selection module and adaptive generation of distillation module, dynamically select appropriate distillation areas and generate output predictions, enhancing the learning ability and robustness of the student network .
It significantly improves the detection performance and robustness of the student network, reduces the amount of model parameters and calculations, enhances generalization ability, and improves distillation efficiency.
Smart Images

Figure CN119131632A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial image technology, and in particular to an aerial image target detection method based on classification-localization dual-branch interactive distillation. Background Art
[0002] Aerial image target detection is an important research direction in the field of remote sensing and is widely used in many fields such as military reconnaissance, disaster monitoring and urban planning. Traditional high-precision aerial image target detection models are often obtained at the expense of computational complexity and parameter quantity, while the memory and computing resources of edge computing platforms such as satellites and drones are limited. Therefore, while pursuing high detection accuracy, the model must be lightweight so that the algorithm can be deployed on mobile platforms.
[0003] In order to overcome the above problems, many model lightweighting methods have emerged. Knowledge distillation is a commonly used model compression technology, which trains a lightweight student network to approximate the performance of a pre-trained complex teacher network. Through knowledge distillation, the student network can significantly reduce the demand for computing resources with little performance loss, making it more suitable for deployment in practical applications.
[0004] In the process of knowledge distillation, not all prediction results of the pre-trained teacher network promote the learning process of the student network, and inappropriate learning areas may reduce the learning effect. The detection head of the target detector usually consists of two independent and parallel classification branches and localization branches. Due to the characteristics of aerial images such as high resolution, complex background and multi-scale targets, this complexity will increase the difficulty of classification and localization tasks, and cause serious misalignment of the two independent branches when understanding and predicting targets. Therefore, when performing knowledge distillation, if the information of the classification branch and the localization branch can be cross-fused and distilled, it can help the student network better learn the knowledge of the pre-trained teacher network detection head. Summary of the invention
[0005] The present invention proposes an aerial image target detection method based on classification-localization dual-branch interactive distillation, which effectively mines the knowledge contained in the detection head part, combines the interactive learning and adaptive generation distillation methods, effectively enhances the robustness and detection performance of the model, and reduces the model calculation amount.
[0006] The technical solution to realize the present invention is: a method for aerial image target detection based on classification-localization dual-branch interactive distillation, the steps are as follows:
[0007] Step S1, download the aerial image detection dataset DIOR-R, randomly cut the image into 800×800 blocks, randomly divide the unified-size blocks into training and test datasets in a ratio of 7:3, and perform data enhancement on the training dataset to form a teacher-student learning network training dataset, and then go to step S2.
[0008] Step S2: Use the teacher-student learning network training data set to pre-train the teacher network to obtain a pre-trained teacher network, and then proceed to step S3.
[0009] Step S3: Use the pre-trained teacher network, student network, adaptive generation distillation module and interactive distillation region selection module to build a teacher-student learning network, and then go to step S4.
[0010] Step S4, input the teacher-student learning network training data set into the teacher-student learning network for training, extract the multi-scale feature layers of the pre-trained teacher network and the student network and their corresponding output prediction values; construct an interactive distillation region selection module to dynamically select suitable classification distillation regions and positioning distillation regions for distillation; construct an adaptive generation distillation module to mask the output feature layer of the classification branch of the student network so that it can adaptively reconstruct the output feature layer of the pre-trained teacher network, fix the parameters of the pre-trained teacher network, and update the parameters of the student network through the overall loss function of the student network, finally obtain the trained student network, and proceed to step S5.
[0011] Step S5: input the test data set into the trained student network for detection, merge the detection results of each block image, output the category and position of all targets in the test data set in the image, and obtain the detection accuracy of the trained student network.
[0012] Compared with the prior art solutions, the present invention has the following significant advantages:
[0013] (1) Compared with the existing aerial image target detection methods, the present invention proposes an aerial image target detection method based on classification-localization dual-branch interactive distillation, which fully mines the knowledge contained in the detection head part and improves the detection performance of the student network. At the same time, it effectively reduces the number of parameters and the amount of calculation of the model, and enhances the robustness and generalization ability of the student network.
[0014] (2) The present invention proposes an interactive distillation region selection module to dynamically select the best classification distillation region and positioning distillation region for the detection head of the student network, focusing on solving the problem of insufficient interaction between the classification branch and the regression branch during the distillation process, and significantly improving the distillation efficiency; the integrated adaptive generation distillation module in the student network detection head enables the student network to generate output predictions more flexibly and autonomously, and no longer completely imitates the output of the teacher network, which promotes the initiative and creativity of the student network in the learning process and enhances the learning ability of the student network. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 This is a network model diagram of the aerial image target detection method based on classification-localization dual-branch interactive distillation of the present invention. DETAILED DESCRIPTION
[0016] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings.
[0017] Combination Figure 1 The method for aerial image target detection based on classification-localization dual-branch interactive distillation of the present invention comprises the following steps:
[0018] Step S1, download the aerial image detection dataset DIOR-R, randomly cut the image into 800×800 blocks, randomly divide the unified-size blocks into training and test datasets in a ratio of 7:3, and perform data enhancement on the training dataset to form a teacher-student learning network training dataset, and then go to step S2.
[0019] Step S2: Use the teacher-student learning network training data set to pre-train the teacher network to obtain a pre-trained teacher network, and then proceed to step S3.
[0020] Step S3: Use the pre-trained teacher network, student network, adaptive generation distillation module and interactive distillation region selection module to build a teacher-student learning network, and then go to step S4.
[0021] Step S4, input the teacher-student learning network training data set into the teacher-student learning network for training, extract the multi-scale feature layers of the pre-trained teacher network and the student network and their corresponding output prediction values; construct an interactive distillation region selection module for dynamically selecting appropriate classification distillation regions and positioning distillation regions for distillation; construct an adaptive generation distillation module for masking the output feature layer of the classification branch of the student network so that it can adaptively reconstruct the output feature layer of the pre-trained teacher network, fix the parameters of the pre-trained teacher network, and update the parameters of the student network through the overall loss function of the student network, and finally obtain a trained student network, as follows:
[0022] In the result-based distillation algorithm, not all prediction results will promote the learning process of the student network. Inappropriate learning areas may reduce the learning effect. Therefore, an interactive distillation area selection module is constructed to select the optimal distillation area for the detection head of the student network, which can effectively improve the learning ability of the student network.
[0023] Firstly, all the output features of the pre-trained teacher network and the student network detection head are extracted, and an interactive distillation region selection module is constructed to dynamically select appropriate classification distillation regions and positioning distillation regions for distillation.
[0024] The interactive distillation region selection module includes a classification main distillation region, a positioning main distillation region, a positioning-assisted classification distillation region, and a classification-assisted positioning distillation region.
[0025] The classification main distillation region and the positioning main distillation region are directly determined by the label assignment, that is, the position of the positive sample during training; the positioning-assisted classification distillation region uses the positioning branch of the pre-trained teacher network to guide the student network to select the classification distillation region; the classification-assisted positioning distillation region uses the classification branch of the pre-trained teacher network to guide the student network to select the positioning distillation region.
[0026] For the selection of the classification main distillation region and the positioning main distillation region in the interactive distillation region selection module, the intersection-over-union matrix RIoU_0 between all anchor boxes and the rotated truth boxes in the lth layer is calculated. l , the formula is:
[0027]
[0028] in, represents the preset anchor box of the lth layer, B gt represents the rotated truth box, and RIoU represents the degree of overlap between the two boxes.
[0029] RIoU_0 l The lower limit is set to α pos , α pos Represents the positive sample threshold set in the basic framework, which is greater than α pos The area is the classification main distillation area and the positioning main distillation area that the student network needs to learn. The masks of these two main distillation areas are recorded as and The loss function of the main distillation region for layer l classification The calculation formula is:
[0030]
[0031] The loss function for locating the main distillation region at layer l The calculation formula is:
[0032]
[0033] in, represents the classification prediction value of the detection head at the first layer of the student network, represents the classification prediction value of the l-th layer detection head of the pre-trained teacher network, represents the regression prediction value of the detection head of the first layer of the student network, represents the regression prediction value of the l-th layer detection head of the pre-trained teacher network, L KL represents the KL divergence loss.
[0034] Calculate the loss function of the classification main distillation area and the loss function of the positioning main distillation area of all feature layers, and finally the loss function L of the classification main distillation area CMD for:
[0035]
[0036] The loss function L for locating the main distillation area LMD for:
[0037]
[0038] Among them, L represents the total number of output feature layers.
[0039] The classification main distillation region only considers the classification region where the positive samples are located, ignoring the region where potential positive samples may exist. Therefore, the positioning-assisted classification distillation region is introduced.
[0040] For the selection of the location-assisted classification distillation region, we first calculate the I of the l-th layer detection head of the pre-trained teacher network l The intersection-over-union matrix RIoU_1 of the predicted boxes and J true value boxes l , The calculation formula is:
[0041]
[0042] in, Represents the output prediction box of the l-th layer detection head of the pre-trained teacher network.
[0043] For each true value box, remove the I between the jth true value box and the lth layer detection head of the pre-trained teacher network l The intersection-over-union matrix of the predicted boxes The maximum value in Among the remaining values, calculate the first k RIoU_1 lThe sum of the values is recorded as iou_sum, the value of k is min=min(1000,[iou_sum]), [iou_sum] means rounding iou_sum down, let k be the number of samples required for distillation of the true value frame, the index value corresponding to the required distilled sample is the classification area that the student network should learn, and the classification area that the student network should learn is the same as the classification main distillation area index value. The area is no longer distilled, and the operation of obtaining the index value is defined as get_index(), then the mask of the classification distillation area assisted by the detection head positioning of the lth layer The calculation formula is:
[0044]
[0045] Then the loss function corresponding to the classification distillation area assisted by the positioning of the l-th layer detection head is The formula is:
[0046]
[0047] Calculate the loss function corresponding to the classification distillation area assisted by the positioning of each layer of the detection head, and finally the loss function L corresponding to the classification distillation area assisted by the positioning LACD The formula is:
[0048] L LACD =M LACD L KL (P S ,P T ,RIoU_1)
[0049] Among them, P S represents the classification prediction value of the detection head of all layers of the student network, P T represents the classification prediction value of all layers of the pre-trained teacher network detection head, M LACD Mask representing the classification distilled regions assisted by the detection head localization at all layers.
[0050] The selection process of the classification-assisted localization distillation region is similar to that of the localization-assisted classification distillation region. To prevent the student network from learning the wrong region, the classification prediction value P of the detection head of all layers of the pre-trained teacher network is T Combined with the intersection-over-union matrix RIoU_0 between all anchor boxes and rotated truth boxes in all layers, a classification-weighted intersection-over-union matrix RIoU_2 is defined, and the calculation formula is:
[0051]
[0052] For each truth box, remove the classification weighted intersection-over-union matrix of the l-th layer detection head of the pre-trained teacher network corresponding to the j-th truth box The maximum value in Among the remaining values, calculate the weighted intersection-over-union matrix of the first k' categories The sum of is recorded as iou_sum', k'=min(1000,[iou_sum']), let k' be the number of samples required for distillation of the truth box, the index value corresponding to the required distilled sample is the positioning area that the student network needs to learn, and the mask of the positioning distillation area assisted by the classification of the l-th layer detection head The calculation formula is:
[0053]
[0054] Then the loss function corresponding to the classification-assisted positioning distillation area of the l-th layer detection head is The formula is:
[0055]
[0056] Among them, RIoU_2 l Represents the classification weighted intersection-over-union matrix of the l-th layer detection head of the pre-trained teacher network.
[0057] Calculate the loss function corresponding to the classification-assisted positioning distillation area of each layer of the detection head, and finally the loss function L corresponding to the classification-assisted positioning distillation area CALD The formula is:
[0058] L CALD =M CALD L KL (B S ,B T ,RIoU_2)
[0059] Among them, B S represents the regression prediction value of the detection head of all layers of the student network, B T represents the regression prediction value of all layers of the pre-trained teacher network detection head, M CALD Mask value representing the localization distillation region assisted by the classification of all layer detection heads.
[0060] The interactive distillation region selection module uses the localization branch of the pre-trained teacher network to guide the classification distillation region selection of the student network, and conversely uses the classification branch of the pre-trained teacher network to guide the positioning distillation region selection of the student network. In this way, the most suitable distillation regions for classification distillation and positioning distillation are dynamically selected, which significantly improves the distillation efficiency and solves the problem of insufficient interaction between the classification branch and the regression branch during the distillation process.
[0061] Construct an adaptive generation distillation module:
[0062] The classification prediction value of the first layer of the pre-trained teacher network is The l-th layer classification prediction value of the student network is Hl represents the height of the l-th layer feature, W l It represents the width of the l-th layer feature, and K represents the number of feature channels.
[0063] Design a random mask to randomly mask the predicted value output by the classification branch of the student network. The calculation formula is:
[0064]
[0065] in, Represents the mask value at position (m,n) on the feature map of the lth layer, represents the feature value at any position (m,n) of the feature map of the lth layer, ε represents the set mask threshold, if the feature value at position (m,n) If the position is greater than or equal to the mask threshold ε, the mask value of the position is set to 1, otherwise it is set to 0;
[0066] The classification prediction value of the student network layer l and the mask values of each position in the lth layer Multiply and send to the classification restorer, which consists of two 3×3 convolutions and ReLU functions. The calculation formula for the restored classification features is:
[0067]
[0068] in, Represents the classification prediction value of the lth layer of the student network The classification prediction value restored after random masking is deformed to obtain:
[0069]
[0070] in, represents the classification prediction probability of the student network layer l after the classification prediction value is randomly masked and restored. ReShape() represents a dimension conversion function.
[0071] Will Added to the classification main distillation region and the localization-assisted classification distillation region, the loss function of the classification main distillation region is redefined as L' CMD :
[0072]
[0073] in, represents the classification prediction probability of the lth layer of the pre-trained teacher network;
[0074] The loss function of the localization-assisted classification distillation region is redefined as L' LACD :
[0075] L' LACD =M LACD L KL (p' S ,p T ,RIoU_1)
[0076] Among them, p' s represents the classification prediction probability of all layers of the student network after random masking, p T represents the classification prediction probabilities of all layers of the pre-trained teacher network.
[0077] The key to the adaptive generation of the distillation module is to allow the pre-trained teacher network to guide the student network to restore its own classification features, enhance the representation ability of the classification features, and allow the student network to maintain independent thinking while absorbing the teacher's knowledge, so that it has a more comprehensive learning ability.
[0078] Construct the overall loss function of the student network:
[0079] When training the student network, all parameters of the pre-trained teacher network remain unchanged, and the parameters of the student network are updated through the loss function. The overall loss function L of the student network is:
[0080] L=L task +β1L' CMD +β2L LMD +β3L' LACD +β4L ACD
[0081] Among them, L task It represents the original detection task loss of the student network, including classification loss and regression loss. β1, β2, β3, and β4 represent the coefficients used to balance different distillation loss items.
[0082] By combining the ideas of adaptive generative distillation and interactive learning, the knowledge contained in the detection head is effectively mined, and the learning ability of the student network is comprehensively improved.
[0083] Go to step S5.
[0084] Step S5: input the test data set into the trained student network for detection, merge the detection results of each block image, output the category and position of all targets in the test data set in the image, and obtain the detection accuracy of the trained student network.
[0085] Example 1
[0086] The method for aerial image target detection based on classification-localization dual-branch interactive distillation of the present invention comprises the following steps:
[0087] Step S1, download the aerial image detection dataset DIOR-R, randomly cut the image into 800×800 blocks, randomly divide the unified-size blocks into training and test datasets in a ratio of 7:3, and perform data enhancement on the training dataset to form a teacher-student learning network training dataset, and then go to step S2.
[0088] Step S2: Use the teacher-student learning network training data set to pre-train the teacher network to obtain a pre-trained teacher network, and then proceed to step S3.
[0089] Step S3: Use the pre-trained teacher network, student network, adaptive generation distillation module and interactive distillation region selection module to build a teacher-student learning network, and then go to step S4.
[0090] Step S4, input the teacher-student learning network training data set into the teacher-student learning network for training, extract the multi-scale feature layers of the pre-trained teacher network and the student network and their corresponding output prediction values; construct an interactive distillation region selection module to dynamically select suitable classification distillation regions and positioning distillation regions for distillation; construct an adaptive generation distillation module to mask the output feature layer of the classification branch of the student network so that it can adaptively reconstruct the output feature layer of the pre-trained teacher network, fix the parameters of the pre-trained teacher network, and update the parameters of the student network through the overall loss function of the student network, finally obtain the trained student network, and proceed to step S5.
[0091] Step S5: input the test data set into the trained student network for detection, merge the detection results of each block image, output the category and position of all targets in the test data set in the image, and obtain the detection accuracy of the trained student network.
[0092] The present invention conducts relevant experiments based on python language and pytorch framework, and performs model training and reasoning on NVIDIA GeForce RTX3090 graphics card. In the experiment, the model training is optimized using SGD strategy, with momentum decay of 0.9 and weight decay of 0.0001. The initial learning rate is 0.0025, and the learning rate is divided by 10 in the 24th and 33rd rounds. The training rounds of the DIOR-R dataset are 36 rounds, and the batch size is 2. For the setting of hyperparameters in the experiment, the balance coefficients of the four distillation regions are set to β1=β2=β3=β4=0.1, and the mask threshold ε is set to 0.65.
[0093] In order to demonstrate the effectiveness of the present invention, the present invention selects several distillation algorithms that have been popular in recent years as comparison models. In the experiment, the high-precision remote sensing image target detection algorithm S with the backbone network of ResNet-101 is used. 2A-Net is used as the teacher network, MobilenetV2 is used as the backbone extraction network of the student network, and the other parameters remain unchanged. The comparative experimental results are shown in Table 1:
[0094] Table 1 Comparative experimental results of DIOR-R dataset with other distillation algorithms
[0095]
[0096] The experimental results in Table 1 demonstrate the practicability and effectiveness of the present invention.
Claims
1. A method for aerial image target detection based on classification-localization dual-branch interactive distillation. It is characterized in that The following steps are involved: Step S1, download the aerial image detection dataset DIOR-R, randomly cut the image into 800×800 blocks, randomly divide the unified-size blocks into training dataset and test dataset in a ratio of 7:3, and perform data enhancement on the training dataset to form a teacher-student learning network training dataset, and then go to step S2; Step S2, pre-training the teacher network using the teacher-student learning network training data set to obtain a pre-trained teacher network, and then proceeding to step S3; Step S3, construct a teacher-student learning network using the pre-trained teacher network, student network, adaptive generation distillation module and interactive distillation region selection module, and proceed to step S4; Step S4, input the teacher-student learning network training data set into the teacher-student learning network for training, extract the multi-scale feature layers of the pre-trained teacher network and the student network and their corresponding output prediction values; construct an interactive distillation region selection module to dynamically select appropriate classification distillation regions and positioning distillation regions for distillation; construct an adaptive generation distillation module to mask the output feature layer of the classification branch of the student network so that it can adaptively reconstruct the output feature layer of the pre-trained teacher network, fix the parameters of the pre-trained teacher network, and update the parameters of the student network through the overall loss function of the student network, finally obtain the trained student network, and proceed to step S5; Step S5: input the test data set into the trained student network for detection, merge the detection results of each block image, output the category and position of all targets in the test data set in the image, and obtain the detection accuracy of the trained student network.
2. According to claim 1, the aerial image target detection method based on classification-localization dual-branch interactive distillation, It is characterized in that In step S4, an interactive distillation region selection module is constructed, as follows: The interactive distillation region selection module includes a classification main distillation region, a positioning main distillation region, a positioning-assisted classification distillation region, and a classification-assisted positioning distillation region; The classification main distillation region and the positioning main distillation region are directly determined by the label assignment, that is, the position of the positive sample during training; the positioning-assisted classification distillation region uses the positioning branch of the pre-trained teacher network to guide the student network to select the classification distillation region; the classification-assisted positioning distillation region uses the classification branch of the pre-trained teacher network to guide the student network to select the positioning distillation region.
3. According to claim 1, the aerial image target detection method based on classification-localization dual-branch interactive distillation, It is characterized in that In step S4, the selection of the classified main distillation area and the positioned main distillation area in the interactive distillation area selection module is as follows: Extract all output features of the pre-trained teacher network and the student network detection head, and calculate the intersection-over-union matrix RIoU_0 between all anchor boxes and the rotated truth boxes in the lth layer l , the formula is: in, represents the preset anchor box of the lth layer, B gt Represents the rotated truth box, and RIoU represents the overlap between the two boxes; RIoU_0 l The lower limit is set to α pos , α pos Represents the positive sample threshold set in the basic framework, which is greater than α pos The area is the classification main distillation area and the positioning main distillation area that the student network needs to learn. The masks of these two main distillation areas are recorded as and The loss function of the main distillation region for the l-th layer classification The calculation formula is: The loss function for locating the main distillation region at layer l The calculation formula is: in, represents the classification prediction value of the detection head of the first layer of the student network, represents the classification prediction value of the l-th layer detection head of the pre-trained teacher network, represents the regression prediction value of the detection head of the first layer of the student network, represents the regression prediction value of the l-th layer detection head of the pre-trained teacher network, L KL represents KL divergence loss; Calculate the loss function of the classification main distillation area and the loss function of the positioning main distillation area of all feature layers, and finally the loss function L of the classification main distillation area CMD for: The loss function L for locating the main distillation area LMD for: Among them, L represents the total number of output feature layers.
4. The aerial image target detection method based on classification-localization dual-branch interactive distillation according to claim 1, It is characterized in that In step S4, the selection of the positioning-assisted classification distillation region and the classification-assisted positioning distillation region in the interactive distillation region selection module is as follows: For the selection of the location-assisted classification distillation region, we first calculate the I of the l-th layer detection head of the pre-trained teacher network l The intersection-over-union matrix RIoU_1 of the predicted boxes and J true value boxes l , The calculation formula is: in, represents the output prediction box of the l-th layer detection head of the pre-trained teacher network; For each true value box, remove the I between the jth true value box and the lth layer detection head of the pre-trained teacher network l The intersection-over-union matrix of the predicted boxes The maximum value in Among the remaining values, calculate the first k RIoU_1 l The sum of the values is recorded as iou_sum, the value of k is k=min(1000, [iou_sum]), [iou_sum] means rounding iou_sum down, let k be the number of samples required for distillation of the true value frame, the index value corresponding to the required distilled sample is the classification area that the student network should learn, and the classification area that the student network should learn is the same as the classification main distillation area index value. The area is no longer distilled, and the operation of obtaining the index value is defined as get_index(), then the mask of the classification distillation area assisted by the detection head positioning of the lth layer The calculation formula is: Then the loss function corresponding to the classification distillation area assisted by the positioning of the l-th layer detection head is The formula is: Calculate the loss function corresponding to the classification distillation area assisted by the positioning of each layer of the detection head, and finally the loss function L corresponding to the classification distillation area assisted by the positioning LACD The formula is: L LACD =M LACD L KL (P S ,P T ,RIoU_1) Among them, P S represents the classification prediction value of the detection head of all layers of the student network, P T represents the classification prediction value of all layers of the pre-trained teacher network detection head, M LACD Mask representing the classification distillation region assisted by the detection head positioning at all layers; The selection process of the classification-assisted localization distillation region is similar to that of the localization-assisted classification distillation region. The classification prediction value P of the detection head of all layers of the pre-trained teacher network is T The intersection-over-union matrix RIoU between all anchor boxes and rotated truth boxes in all layers _ 0, a classification weighted intersection-over-union matrix RIoU is defined. _ 2. The calculation formula is: For each truth box, remove the classification weighted intersection-over-union matrix of the l-th layer detection head of the pre-trained teacher network corresponding to the j-th truth box The maximum value in Among the remaining values, calculate the weighted intersection-over-union matrix of the first k' categories The sum of is recorded as iou_sum', k'=min(1000, [iou_sum']), let k' be the number of samples required for distillation of the truth box, the index value corresponding to the required distilled sample is the positioning area that the student network needs to learn, and the mask of the positioning distillation area assisted by the classification of the l-th layer detection head for: Then the loss function corresponding to the classification-assisted positioning distillation area of the l-th layer detection head is The formula is: Among them, RIoU_2 l represents the classification weighted intersection-over-union matrix of the l-th layer detection head of the pre-trained teacher network; Calculate the loss function corresponding to the classification-assisted positioning distillation area of each layer of the detection head, and finally the loss function L corresponding to the classification-assisted positioning distillation area CALD The formula is: L CALD =M CALD L KL (B S ,B T ,RIoU_2) Among them, B S represents the regression prediction value of the detection head of all layers of the student network, B T represents the regression prediction value of all layers of the pre-trained teacher network detection head, M CALD Mask value representing the localization distillation region assisted by the classification of all layer detection heads.
5. The aerial image target detection method based on classification-localization dual-branch interactive distillation according to claim 1, It is characterized in that In step S4, an adaptive generation distillation module is constructed, as follows: The classification prediction value of the first layer of the pre-trained teacher network is The l-th layer classification prediction value of the student network is H l represents the height of the l-th layer feature, W l represents the width of the l-th layer feature, and K represents the number of channels of the feature; Design a random mask to randomly mask the predicted value output by the classification branch of the student network. The calculation formula is: in, Represents the mask value at position (m, n) on the feature map of the lth layer, represents the feature value at any position (m, n) of the feature map of the lth layer, ε represents the set mask threshold, if the feature value at position (m, n) If the position is greater than or equal to the mask threshold ε, the mask value of the position is set to 1, otherwise it is set to 0; The classification prediction value of the student network layer l and the mask values of each position in the lth layer Multiply and send to the classification restorer, which consists of two 3×3 convolutions and ReLU functions. The calculation formula for the restored classification features is: in, Represents the classification prediction value of the lth layer of the student network The classification prediction value restored after random masking is deformed to obtain: in, represents the classification prediction probability of the student network layer l after the classification prediction value is randomly masked and restored. ReShape() represents the dimension conversion function; Will Added to the classification main distillation region and the localization-assisted classification distillation region, the loss function of the classification main distillation region is redefined as L′ CMD : in, represents the classification prediction probability of the lth layer of the pre-trained teacher network; The loss function of the localization-assisted classification distillation region is redefined as L′ LACD : L′ LACD =M LACD L KL (p′s,p T ,RIoU_1) Among them, p′s represents the classification prediction probability of all layers of the student network after random masking, p T represents the classification prediction probabilities of all layers of the pre-trained teacher network.
6. The aerial image target detection method based on classification-localization dual-branch interactive distillation according to claim 1, It is characterized in that In step S4, the overall loss function of the student network is constructed as follows: When training the student network, all parameters of the pre-trained teacher network remain unchanged, and the parameters of the student network are updated through the loss function. The overall loss function L of the student network is: L=L task +b 1 L′ CMD +b 2 L LMD +b 3 L′ LACD +b 4 L CALD Among them, L task represents the original detection task loss of the student network, including classification loss and regression loss; β 1 , β 2 , β 3 , β 4 Represents the coefficient used to balance the different distillation loss terms.
Citation Information
Patent Citations
Aerial image target detection method based on category mask distillation
CN116486285A
Knowledge distillation algorithm for mixed knowledge decoupling for remote sensing target detection
CN116665068A
Self-distillation training method and device for convolutional neural network, and scalable dynamic prediction method
WO2021023202A1
Cited By
Aerial image target detection method based on cross-head collaborative distillation and feature standardization
CN119741625A
Dense target detection optimization method based on mask generation type distillation and cross-task consistency
CN120493046A
Student model training method and device based on gradient decoupling
CN121390201A
Student model training method and device based on gradient decoupling
CN121390201B
