Target detection method and apparatus based on heterogeneous equilibrium distillation
Patent Information
- Application Number
- CN202410283045.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2044-03-13
AI Technical Summary
[0003]此外,现有目标检测模型往往存在目标的分类识别精度和位置标注精度不匹配的问题,如图1所示,由于定位精度在推理阶段的不可知性,检测模型在非极大值抑制过程中,通过分类识别精度来筛选最优的检测结果,导致输出定位不精确的检测框
[0048]本发明首先基于分类概率图和定位预测图计算得到锚框置信度,综合分类分支和定位分支的结果评估锚框的有效性,然后进一步计算得到分类信息量和定位信息量,用信息量传递锚框包含的分类和定位知识,求平方根操作用于软化信息量的分布,使其提供更多暗知识;其次,基于分类信息量和定位信息量计算分类权重系数和定位权重系数,根据学生模型对教师模型传输的分类和定位知识的学习情况,自行调整损失函数的权重;最后构建异构平衡蒸馏损失函数,引导学生模型学习教师模型特征分布的变化趋势,而非具体数值,避免模型特征幅值差异的干扰。本发明在中间层特征蒸馏中引入分类信息量和定位信息量,并使用异构平衡蒸馏损失函数对学生模型进行训练,在实现异构蒸馏的同时提高分类精度和位置精度一致性。
Smart Images

Figure CN118397650B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision, specifically relating to a target detection method and apparatus based on heterogeneous equilibrium distillation. Background Technology
[0002] Currently, knowledge distillation methods based on intermediate layer features often assume that the teacher and student models have the same architecture. However, when the teacher and student models have different architectures, distillation may fail due to the different feature values. Therefore, how to perform knowledge distillation on heterogeneous models has become an urgent problem to be solved.
[0003] Furthermore, existing target detection models often suffer from a mismatch between the accuracy of target classification and recognition and the accuracy of location labeling, such as... Figure 1 As shown, due to the unknowability of localization accuracy during the inference stage, the detection model selects the optimal detection result based on classification accuracy during non-maximum suppression, resulting in outputting detection boxes with inaccurate localization. This problem is particularly severe in small detection models. Therefore, how to solve the consistency problem between classification accuracy and location accuracy in student models during knowledge distillation is another problem to be solved. Summary of the Invention
[0004] To address the shortcomings of existing technologies, achieve heterogeneous distillation, and improve the consistency of classification accuracy and location accuracy in target detection models, this invention adopts the following technical solution:
[0005] A target detection method based on heterogeneous equilibrium distillation includes the following steps:
[0006] Step S1: Build a heterogeneous balanced distillation architecture, including a teacher model and a student model. Construct an image training set and input it into the heterogeneous balanced distillation architecture to obtain the teacher's neck feature map, teacher classification probability map, and teacher localization prediction map of the teacher model, as well as the student's neck feature map, student classification probability map, and student localization prediction map of the student model.
[0007] Step S2: Calculate the teacher anchor box confidence based on the teacher classification probability map and the teacher localization prediction map, and calculate the teacher classification information using the teacher anchor box confidence and the teacher classification probability map, and calculate the teacher localization information using the teacher anchor box confidence and the teacher localization prediction map; similarly, calculate the student anchor box confidence based on the student classification probability map and the student localization prediction map, and calculate the student classification information using the student anchor box confidence and the student classification probability map, and calculate the student localization information using the student anchor box confidence and the student localization prediction map; the anchor box confidence can integrate the results of the classification branch and the localization branch to evaluate the effectiveness of the anchor box, mitigating the impact of the inconsistency between classification accuracy and location accuracy in subsequent calculations. The information includes the category probability information of the anchor box and the information on the consistency between the model's classification accuracy and localization accuracy, conveying the inter-class distribution knowledge and consistency knowledge of the teacher model;
[0008] Step S3: Construct a classification information tensor based on the teacher's classification information and the student's classification information, and construct a location information tensor based on the teacher's location information and the student's location information. Calculate the classification weight coefficient and the location weight coefficient using the classification information tensor and the location information tensor, respectively. The classification weight coefficient and the location weight coefficient represent the student model's learning of the teacher model's classification accuracy and location accuracy, respectively.
[0009] Step S4: Based on the teacher's neck feature map, teacher classification information, and classification weight coefficients, calculate the teacher's normalized classification feature map. Similarly, based on the student's neck feature map, teacher classification information, and classification weight coefficients, calculate the student's normalized classification feature map, and construct the losses for the corresponding normalized classification features of teachers and students. Based on the teacher's neck feature map, teacher positioning information, and positioning weight coefficients, calculate the teacher's normalized positioning feature map. Similarly, based on the student's neck feature map, teacher positioning information, and positioning weight coefficients, calculate the student's normalized positioning feature map, and construct the losses for the corresponding normalized positioning features of teachers and students. Finally, construct the heterogeneous equilibrium distillation loss through the normalized classification feature loss and the normalized positioning feature loss.
[0010] Step S5: Train the student model using the heterogeneous equilibrium distillation loss function, and then use the trained student model for image object detection.
[0011] Furthermore, in step S2, the formula for calculating the anchor frame confidence level is as follows:
[0012]
[0013] Where h represents the ordinate of the spatial position of the anchor frame's center point, and w represents the abscissa of the spatial position of the anchor frame's center point. Represents a classification probability graph. This represents the localization prediction map, ac h,wThis indicates the confidence level of the anchor frame.
[0014] Furthermore, in step S2, the formula for calculating the amount of classification information is as follows:
[0015]
[0016] in, Indicates the amount of categorized information. Represents a classification probability graph, ac h,w Indicates the anchor frame confidence level;
[0017] The formula for calculating the amount of location information is as follows:
[0018]
[0019] in, This indicates the amount of location information. This represents the localization prediction map, ac h,w This indicates the confidence level of the anchor frame.
[0020] Furthermore, in step S3, the formula for constructing the classification information tensor is as follows:
[0021] T cls =concat(i cls,t i cls,s )
[0022] Among them, i cls,t i represents the amount of information categorized by teacher. cls,s The student classification information volume is represented by `concat`, which is a join function used to connect the teacher classification information volume and the student classification information volume in the channel dimension. cls Represents a classification information tensor;
[0023] The formula for constructing the location information tensor is as follows:
[0024] T reg =concat(i reg,t i reg,s )
[0025] Among them, i reg,t i represents the amount of teacher location information. reg,s T represents the amount of student location information. reg This represents a tensor containing location information.
[0026] Furthermore, in step S3, the formula for calculating the weighting coefficient is as follows:
[0027] C cls C reg =softmax(AdaptiveAvgPool(cov2d(Tcls )),AdaptiveAvgPool(cov2d(T cls )))
[0028] Where cov2d represents a two-dimensional convolution function, AdaptiveAvgPool represents an adaptive average pooling function, softmax represents a normalization function, and C... cls C represents the classification weight coefficient. reg This represents the localization weight coefficient. Since the magnitudes of classification information and localization information are different, it is necessary to convolve the classification information tensor and the localization information tensor separately.
[0029] Furthermore, in step S4, the calculation formula for the normalized classification feature map is as follows:
[0030]
[0031] in, C represents the normalized classification feature map. cls The classification weight coefficients are represented by `norm`, which is a standardization function used to transform the distribution into a standard normal distribution. F represents the amount of information categorized by teacher. h,w Represents neck features;
[0032] The formula for calculating the normalized localization feature map is as follows:
[0033]
[0034] in, C represents the normalized localization feature map. reg The symbol represents the positioning weight coefficient, and norm represents the standardization function used to transform the distribution into a standard normal distribution. F represents the amount of information about the teacher's location. h,w This represents a diagram of neck features.
[0035] Furthermore, in step S4, the heterogeneous equilibrium distillation loss function uses Pearson distance to calculate the loss on the weighted neck feature map. This eliminates the negative impact of differences in model feature amplitudes and transmits knowledge about the consistency of classification accuracy and localization accuracy to the student model. The formula is as follows:
[0036]
[0037]
[0038] L distillation =2-(L) cls +L reg );
[0039] Where C represents the number of channels in the feature map, H represents the height of the feature map, W represents the width of the feature map, and L represents the number of channels in the feature map. cls L represents the normalized classification feature loss. reg L represents the normalized localization feature loss. distillation This represents the loss function of heterogeneous equilibrium distillation.
[0040] A target detection device based on heterogeneous equilibrium distillation includes a feature transformation extraction module, an information content calculation module, a weight calculation module, a heterogeneous equilibrium distillation loss function module, and a model deployment module;
[0041] The feature transformation extraction module obtains the teacher neck feature map, teacher classification probability map, and teacher localization prediction map of the teacher model, as well as the student neck feature map, student classification probability map, and student localization prediction map of the corresponding student model from the heterogeneous equilibrium distillation architecture.
[0042] The information content calculation module calculates the teacher anchor box confidence based on the teacher classification probability map and the teacher location prediction map, and calculates the teacher classification information content using the teacher anchor box confidence and the teacher classification probability map, and calculates the teacher location information content using the teacher anchor box confidence and the teacher location prediction map. Similarly, it calculates the student anchor box confidence based on the student classification probability map and the student location prediction map, and calculates the student classification information content using the student anchor box confidence and the student classification probability map, and calculates the student location information content using the student anchor box confidence and the student location prediction map. The anchor box confidence can integrate the results of the classification branch and the location branch to evaluate the effectiveness of the anchor box, and mitigate the impact of the inconsistency between classification accuracy and location accuracy in subsequent calculations. The information content includes the category probability information of the anchor box and the information on the consistency between the model's classification accuracy and location accuracy, conveying the inter-class distribution knowledge and consistency knowledge of the teacher model.
[0043] The weight calculation module constructs a classification information tensor based on the teacher's classification information and the student's classification information, and constructs a positioning information tensor based on the teacher's positioning information and the student's positioning information. Through the classification information tensor and the positioning information tensor, the module calculates the classification weight coefficient and the positioning weight coefficient. The classification weight coefficient and the positioning weight coefficient represent the student model's learning of the teacher model's classification accuracy and positioning accuracy, respectively.
[0044] The heterogeneous equilibrium distillation loss function module calculates the teacher's normalized classification feature map based on the teacher's neck feature map, teacher classification information, and classification weight coefficients. Similarly, it calculates the student's normalized classification feature map based on the student's neck feature map, teacher classification information, and classification weight coefficients, and constructs the losses for the corresponding normalized classification features of teachers and students. It also calculates the teacher's normalized location feature map based on the teacher's neck feature map, teacher location information, and location weight coefficients, and similarly calculates the student's normalized location feature map based on the student's neck feature map, teacher location information, and location weight coefficients, and constructs the losses for the corresponding normalized location features of teachers and students. Finally, it constructs the heterogeneous equilibrium distillation loss using the normalized classification feature loss and the normalized location feature loss.
[0045] The model deployment module trains the student model using a heterogeneous balanced distillation loss function, loads the trained student model into the corresponding device, and performs image target detection.
[0046] Furthermore, in the heterogeneous equilibrium distillation loss function module, the loss of normalized classification features is constructed based on the Pearson distance of each dimension of the teacher's normalized classification feature map and the student's normalized classification feature map; the loss of normalized localization features is constructed based on the Pearson distance of each dimension of the teacher's normalized localization feature map and the student's normalized localization feature map. This not only eliminates the negative impact of differences in model feature amplitudes, but also transmits knowledge of the consistency between classification accuracy and localization accuracy to the student model.
[0047] The advantages and beneficial effects of this invention are as follows:
[0048] This invention first calculates anchor box confidence based on classification probability maps and localization prediction maps, and evaluates the effectiveness of anchor boxes by combining the results of classification and localization branches. Then, it further calculates classification and localization information, using this information to convey the classification and localization knowledge contained in the anchor boxes. A square root operation is used to soften the distribution of information, enabling it to provide more hidden knowledge. Second, it calculates classification and localization weight coefficients based on the classification and localization information, and adjusts the weights of the loss function according to the student model's learning of the classification and localization knowledge transmitted by the teacher model. Finally, it constructs a heterogeneous equilibrium distillation loss function to guide the student model to learn the changing trends of the teacher model's feature distribution, rather than specific numerical values, avoiding interference from differences in model feature amplitudes. This invention introduces classification and localization information into the intermediate layer feature distillation and uses a heterogeneous equilibrium distillation loss function to train the student model, improving the consistency of classification accuracy and location accuracy while achieving heterogeneous distillation. Attached Figure Description
[0049] Figure 1 This is a diagram illustrating the mismatch between classification accuracy and location labeling accuracy.
[0050] Figure 2 This is a flowchart of the method in an embodiment of the present invention.
[0051] Figure 3 This is a schematic diagram of the device in an embodiment of the present invention. Detailed Implementation
[0052] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0053] This example provides a target detection method based on heterogeneous equilibrium distillation, such as... Figure 2 As shown, the specific steps include:
[0054] Step S1: Build a heterogeneous balanced distillation architecture, construct a training set, input the images in the training set into the heterogeneous balanced distillation architecture, and obtain the teacher neck feature map, teacher classification probability map and teacher localization prediction map of the teacher model, as well as the student neck feature map, student classification probability map and student localization prediction map of the student model.
[0055] Step S2: Calculate the teacher anchor box confidence, teacher classification information, teacher location information, student anchor box confidence, student classification information, and student location information based on the teacher classification probability map, teacher location prediction map, student classification probability map, and student location prediction map;
[0056] Step S3: Calculate the classification weight coefficient and the location weight coefficient based on the teacher classification information, teacher location information, student classification information, and student location information;
[0057] Step S4: Calculate the heterogeneous equilibrium distillation loss function based on the teacher classification information, teacher location information, classification weight coefficient, location weight coefficient, teacher neck feature map, and student neck feature map;
[0058] Step S5: Train the student model using the heterogeneous equilibrium distillation loss function, obtain the trained student model, and load it into the corresponding device for target detection.
[0059] The beneficial effects of the above embodiments are as follows: Through a heterogeneous balanced distillation architecture, the teacher's neck feature map, teacher classification probability map, and teacher localization prediction map are obtained for the teacher model, and the student's neck feature map, student classification probability map, and student localization prediction map are obtained for the student model. Based on the teacher classification probability map, teacher localization prediction map, student classification probability map, and student localization prediction map, the teacher anchor box confidence, teacher classification information, teacher localization information, student anchor box confidence, student classification information, and student localization information are calculated. Based on the teacher classification information, teacher localization information, student classification information, and student localization information, the classification weight coefficient and localization weight coefficient are calculated. Based on the teacher classification information, teacher localization information, classification weight coefficient, localization weight coefficient, teacher neck feature map, and student neck feature map, a heterogeneous balanced distillation loss function is calculated. The student model is trained using the heterogeneous balanced distillation loss function to obtain the trained student model, which is then loaded into the corresponding device for target detection. This invention introduces classification information and localization information in the intermediate layer feature distillation and uses a heterogeneous balanced distillation loss function to train the student model, improving the consistency of classification accuracy and location accuracy while achieving heterogeneous distillation.
[0060] In one embodiment, step S2 includes:
[0061] Calculate teacher anchor frame confidence based on teacher classification probability map and teacher location prediction map;
[0062] Calculate the amount of information about teacher classification based on teacher classification probability maps and teacher anchor box confidence scores;
[0063] Calculate the amount of teacher location information based on the teacher location prediction map and the teacher anchor frame confidence.
[0064] Calculate student anchor frame confidence based on student classification probability map and student location prediction map;
[0065] Calculate the amount of information about student classification based on student classification probability maps and student anchor box confidence scores;
[0066] Calculate the amount of student location information based on the student location prediction map and the student anchor frame confidence.
[0067] It should be explained that the anchor box confidence score, which combines the results of the classification branch and the localization branch, evaluates the effectiveness of the anchor box and mitigates the impact of inconsistencies between classification accuracy and localization accuracy in subsequent calculations. The information content includes the class probability information of the anchor box and the information on the consistency between the model's classification accuracy and localization accuracy, conveying the teacher's knowledge of the inter-class distribution and consistency of the model.
[0068] In one embodiment, the anchor frame confidence score includes teacher anchor frame confidence score and student anchor frame confidence score, and the formula for calculating the anchor frame confidence score is as follows:
[0069]
[0070] Where h represents the ordinate of the spatial position of the anchor frame's center point, and w represents the abscissa of the spatial position of the anchor frame's center point. This represents the classification probability map. The location prediction map is represented by ac. h,w The anchor box confidence level is represented by the classification probability map, which is either the teacher classification probability map or the student classification probability map, and the localization prediction map is either the teacher localization prediction map or the student localization prediction map.
[0071] In one embodiment, the classification information includes teacher classification information and student classification information, and the formula for calculating the classification information is as follows:
[0072]
[0073] in, This indicates the amount of information categorized.
[0074] In one embodiment, the location information includes teacher location information and student location information, and the formula for calculating the location information is as follows:
[0075]
[0076] in, This indicates the amount of location information.
[0077] In one embodiment, step S3 includes:
[0078] Construct a classification information tensor based on the classification information of teachers and students;
[0079] Construct a location information tensor based on the location information of teachers and students;
[0080] Calculate the classification weight coefficient and the location weight coefficient based on the classification information tensor and the location information tensor;
[0081] It should be explained that the classification weight coefficient and the localization weight coefficient represent the student model's learning of the teacher model's classification accuracy and localization accuracy, respectively. Since the magnitudes of the classification information and localization information are different, it is necessary to convolve the classification information tensor and the localization information tensor separately.
[0082] In one embodiment, the formula for constructing the classification information tensor is:
[0083] T cls =concat(i cls,t i cls,s );
[0084] Among them, icls,t i represents the amount of information categorized by teacher. cls,s The student classification information volume is represented by `concat`, which is a join function used to connect the teacher classification information volume and the student classification information volume in the channel dimension. cls Represents a classification information tensor.
[0085] In one embodiment, the formula for constructing the location information tensor is:
[0086] T reg =concat(i reg,t i reg,s );
[0087] Among them, i reg,t i represents the amount of teacher location information. reg,s T represents the amount of student location information. reg This represents a tensor containing location information.
[0088] In one embodiment, the weighting coefficients include classification weighting coefficients and location weighting coefficients, and the formula for calculating the weighting coefficients is as follows:
[0089] C cls C reg =softmax(AdaptiveAvgPool(cov2d(T cls )),AdaptiveAvgPool(cov2d(T cls )));
[0090] Where cov2d represents a two-dimensional convolution function, AdaptiveAvgPool represents an adaptive average pooling function, softmax represents a normalization function, and C... cls C represents the classification weight coefficient. reg This represents the positioning weight coefficient.
[0091] In one embodiment, step S4 includes:
[0092] The normalized classification feature maps for teachers and students are calculated based on the teacher classification information content, classification weight coefficients, teacher neck feature maps, and student neck feature maps.
[0093] The normalized positioning feature map of the teacher and the normalized positioning feature map of the student are calculated based on the teacher's positioning information, positioning weight coefficient, teacher's neck feature map and student's neck feature map.
[0094] The heterogeneous equilibrium distillation loss function is calculated based on the teacher normalized classification feature map, teacher normalized location feature map, student normalized classification feature map, and student normalized location feature map.
[0095] It should be explained that the heterogeneous equilibrium distillation loss function uses Pearson distance to calculate the loss on the weighted neck feature map, which not only eliminates the negative impact of differences in model feature amplitudes, but also transmits knowledge of the consistency between classification accuracy and localization accuracy to the student model.
[0096] In one embodiment, the normalized classification feature map includes a teacher normalized classification feature map and a student normalized classification feature map. The calculation formula for the normalized classification feature map is as follows:
[0097]
[0098] Among them, F h,w This represents a neck feature diagram. This represents the amount of information categorized by teachers, and norm represents the standardization function used to transform the distribution into a standard normal distribution. The normalized classification feature map is represented by the neck feature map, which is either the teacher's neck feature map or the student's neck feature map.
[0099] In one embodiment, the normalized localization feature map includes a teacher's normalized localization feature map and a student's normalized localization feature map. The calculation formula for the normalized localization feature map is as follows:
[0100]
[0101] in, This indicates the amount of information related to the teacher's location. This represents the normalized localization feature map.
[0102] In one embodiment, the formula for calculating the heterogeneous equilibrium distillation loss function is:
[0103]
[0104]
[0105] L distillation =2-(L) cls +L reg );
[0106] Where C represents the number of channels in the feature map, H represents the height of the feature map, W represents the width of the feature map, and L represents the number of channels in the feature map. distillation This represents the loss function of heterogeneous equilibrium distillation.
[0107] like Figure 3 As shown, the present invention also provides a target detection device based on heterogeneous equilibrium distillation, comprising:
[0108] The feature transformation and extraction module is used to obtain the teacher's neck feature map, the teacher's classification probability map, the teacher's localization prediction map, the student's neck feature map, the student's classification probability map, and the student's localization prediction map from the heterogeneous equilibrium distillation architecture.
[0109] The information content calculation module is used to calculate the teacher anchor box confidence, teacher classification information content, teacher location information content, student anchor box confidence, student classification information content, and student location information content based on the teacher classification probability map, the teacher location prediction map, the student classification probability map, and the student location prediction map.
[0110] The weight calculation module is used to calculate the classification weight coefficient and the location weight coefficient based on the teacher classification information, the teacher location information, the student classification information, and the student location information.
[0111] The heterogeneous equilibrium distillation loss function module is used to calculate the heterogeneous equilibrium distillation loss function based on the teacher classification information, the teacher location information, the classification weight coefficient, the location weight coefficient, the teacher neck feature map, and the student neck feature map, and to train the student model using the heterogeneous equilibrium distillation loss function;
[0112] The model deployment module is used to load the trained student model into the corresponding device and perform object detection.
[0113] The beneficial effects of the above embodiments are as follows: First, anchor box confidence is calculated based on the classification probability map and the localization prediction map. The effectiveness of the anchor box is evaluated by comprehensively considering the results of the classification branch and the localization branch. Then, the classification information and localization information are further calculated. The information is used to convey the classification and localization knowledge contained in the anchor box. The square root operation is used to soften the distribution of information, making it provide more hidden knowledge. Second, classification weight coefficients and localization weight coefficients are calculated based on the classification information and localization information. The weights of the loss function are adjusted automatically according to the student model's learning of the classification and localization knowledge transmitted by the teacher model. Finally, a heterogeneous equilibrium distillation loss function is constructed to guide the student model to learn the changing trend of the teacher model's feature distribution, rather than specific values, thus avoiding interference from differences in model feature amplitudes. This invention introduces classification information and localization information in the intermediate layer feature distillation and uses a heterogeneous equilibrium distillation loss function to train the student model, improving the consistency of classification accuracy and location accuracy while achieving heterogeneous distillation.
[0114] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A target detection method based on heterogeneous equilibrium distillation, characterized in that... Includes the following steps: Step S1: Build a heterogeneous balanced distillation architecture, including a teacher model and a student model. Construct an image training set and input it into the heterogeneous balanced distillation architecture to obtain the teacher's neck feature map, teacher classification probability map, and teacher localization prediction map of the teacher model, as well as the student's neck feature map, student classification probability map, and student localization prediction map of the student model. Step S2: Calculate the teacher anchor box confidence based on the teacher classification probability map and the teacher location prediction map, and calculate the teacher classification information based on the teacher anchor box confidence and the teacher classification probability map, and calculate the teacher location information based on the teacher anchor box confidence and the teacher location prediction map; similarly, calculate the student anchor box confidence based on the student classification probability map and the student location prediction map, and calculate the student classification information based on the student anchor box confidence and the student classification probability map, and calculate the student location information based on the student anchor box confidence and the student location prediction map; Step S3: Construct a classification information tensor based on the teacher classification information and the student classification information, and construct a location information tensor based on the teacher location information and the student location information. Calculate the classification weight coefficient and the location weight coefficient using the classification information tensor and the location information tensor. Step S4: Based on the teacher's neck feature map, the teacher's classification information content, and the classification weight coefficient, calculate the teacher's normalized classification feature map. Similarly, based on the student's neck feature map, the teacher's classification information content, and the classification weight coefficient, calculate the student's normalized classification feature map, and construct the loss of the corresponding normalized classification features of the teacher and the student. Based on the teacher's neck feature map, the teacher's location information content, and the location weight coefficient, the teacher's normalized location feature map is calculated. Similarly, based on the student's neck feature map, the teacher's location information content, and the location weight coefficient, the student's normalized location feature map is calculated, and the losses of the teacher's and student's corresponding normalized location features are constructed. Finally, through the normalized classification feature loss and the normalized location feature loss, a heterogeneous equilibrium distillation loss is constructed. The heterogeneous equilibrium distillation loss function calculates the loss using Pearson distance on a weighted neck feature map, as shown in the following formula: in, This represents the number of channels in the feature map. Indicates the height of the feature map. Indicates the width of the feature map. This represents the loss of normalized classification features. This represents the normalized localization feature loss. Represents the loss function of heterogeneous equilibrium distillation; Step S5: Train the student model using the heterogeneous equilibrium distillation loss function, and then use the trained student model for image object detection.
2. The target detection method based on heterogeneous equilibrium distillation according to claim 1, characterized in that: In step S2, the formula for calculating the anchor frame confidence level is as follows: ; in, The vertical coordinate representing the spatial position of the anchor frame's center point. The horizontal coordinate represents the spatial position of the anchor frame's center point. Represents a classification probability graph. This represents the location prediction map. This indicates the confidence level of the anchor frame.
3. The target detection method based on heterogeneous equilibrium distillation according to claim 1, characterized in that: In step S2, the formula for calculating the classification information content is as follows: ; in, Indicates the amount of categorized information. Represents a classification probability graph. Indicates the anchor frame confidence level; The formula for calculating the amount of location information is as follows: ; in, This indicates the amount of location information. This represents the location prediction map. This indicates the confidence level of the anchor frame.
4. The target detection method based on heterogeneous equilibrium distillation according to claim 1, characterized in that: In step S3, the formula for constructing the classification information tensor is as follows: in, This indicates the amount of information related to the teacher classification. This represents the amount of information related to the student classification. This represents a join function used to connect teacher classification information and student classification information along the channel dimension. Represents a classification information tensor; The formula for constructing the location information tensor is as follows: in, This represents the amount of teacher location information. This represents the amount of student location information. This represents a tensor containing location information.
5. The target detection method based on heterogeneous equilibrium distillation according to claim 4, characterized in that: In step S3, the formula for calculating the weighting coefficient is as follows: in, Represents a two-dimensional convolution function. This represents the adaptive average pooling function. Represents the normalization function. Represents the classification weight coefficient. This represents the positioning weight coefficient.
6. The target detection method based on heterogeneous equilibrium distillation according to claim 1, characterized in that: In step S4, the formula for calculating the normalized classification feature map is as follows: in, Represents the normalized classification feature map. Represents the classification weight coefficient. This represents the standardization function, used to transform a distribution into a standard normal distribution. This indicates the amount of information categorized by teacher. Represents neck features; The formula for calculating the normalized localization feature map is as follows: in, This represents the normalized localization feature map. This represents the positioning weight coefficient. This represents the standardization function, used to transform a distribution into a standard normal distribution. This indicates the amount of information related to the teacher's location. This represents a diagram of neck features.
7. A target detection device based on heterogeneous equilibrium distillation, comprising a feature transformation extraction module, an information content calculation module, a weight calculation module, a heterogeneous equilibrium distillation loss function module, and a model deployment module, characterized in that: The target detection method based on heterogeneous equilibrium distillation as described in claim 1 is employed. The feature transformation extraction module obtains the teacher neck feature map, teacher classification probability map, and teacher localization prediction map of the teacher model, as well as the student neck feature map, student classification probability map, and student localization prediction map of the corresponding student model from the heterogeneous equilibrium distillation architecture. The information content calculation module calculates the teacher anchor box confidence level based on the teacher classification probability map and the teacher location prediction map, and calculates the teacher classification information content based on the teacher anchor box confidence level and the teacher classification probability map, and calculates the teacher location information content based on the teacher anchor box confidence level and the teacher location prediction map; similarly, it calculates the student anchor box confidence level based on the student classification probability map and the student location prediction map, and calculates the student classification information content based on the student anchor box confidence level and the student location prediction map; The weight calculation module constructs a classification information tensor based on the teacher classification information and the student classification information, and constructs a location information tensor based on the teacher location information and the student location information. It then calculates the classification weight coefficient and the location weight coefficient using the classification information tensor and the location information tensor. The heterogeneous equilibrium distillation loss function module calculates the teacher's normalized classification feature map based on the teacher's neck feature map, the teacher's classification information content, and the classification weight coefficient. Similarly, it calculates the student's normalized classification feature map based on the student's neck feature map, the teacher's classification information content, and the classification weight coefficient, and constructs the loss of the corresponding normalized classification features of the teacher and the student. Based on the teacher's neck feature map, the teacher's location information content, and the location weight coefficient, the teacher's normalized location feature map is calculated. Similarly, based on the student's neck feature map, the teacher's location information content, and the location weight coefficient, the student's normalized location feature map is calculated, and the losses of the teacher's and student's corresponding normalized location features are constructed. Finally, through the normalized classification feature loss and the normalized location feature loss, a heterogeneous equilibrium distillation loss is constructed. The model deployment module trains the student model using a heterogeneous balanced distillation loss function, loads the trained student model into the corresponding device, and performs image target detection.
8. The target detection device based on heterogeneous equilibrium distillation according to claim 7, characterized in that: In the heterogeneous equilibrium distillation loss function module, the loss of normalized classification features is constructed based on the Pearson distance of each dimension of the teacher's normalized classification feature map and the student's normalized classification feature map; Based on the Pearson distance of each dimension of the teacher's and student's normalized localization feature maps, a loss function for normalized localization features is constructed.