A visual object detection method based on cross-interchange distillation for intelligent driving
Through the cross-exchange distillation method, the student model is optimized using cross entropy loss, squared error loss, cross-exchange loss and distillation loss, which solves the target conflict problem in the student model training process in visual target detection and improves the detection accuracy and adaptability to diverse scenarios.
Patent Information
- Application Number
- CN202510032769.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-01-09
AI Technical Summary
In existing visual object detection methods based on knowledge distillation, the student model is disturbed by target conflicts during training, which affects the optimization effect, resulting in low average precision of visual object detection and poor adaptability to diverse scenarios.
The cross-interchange distillation method is adopted to improve the detection performance of the student model by constructing a deep learning-based visual transformation target detection teacher network and a deep transformation student network for detecting image features. The cross entropy loss, square error loss, cross-interchange loss and distillation loss are used for optimization.
It effectively solves the problem of target conflict in the student model during training, improves the average accuracy of visual target detection, and enhances the adaptability to diverse scenarios.
Smart Images

Figure CN119445539B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of computer vision and artificial intelligence, and specifically relates to a visual target detection method based on cross-interchange distillation for intelligent driving. Background Art
[0002] In recent years, with the rapid development of autonomous driving and intelligent transportation systems, visual object detection methods for intelligent driving have attracted widespread attention. These methods aim to accurately identify and locate objects in the environment, thereby enhancing the vehicle's autonomous perception capabilities. However, deep learning models typically have a large number of parameters and complex computational processes, making their efficient deployment in resource-constrained embedded devices or in-vehicle systems a significant challenge. Therefore, optimizing model structure to reduce computational complexity and memory usage while maintaining performance has become a key research topic in this field.
[0003] Currently, a feasible solution is knowledge distillation. Knowledge distillation is a technique that improves the performance of lightweight models by transferring knowledge between a teacher model and a student model. Its core idea is to allow a more complex, high-performance teacher model to guide a smaller, simplified student model, enabling the student model to approach the teacher's performance even under limited resources. Wang et al. proposed a fine-grained feature mimicking method that leverages prior knowledge of the target class's ground-truth bounding box to guide the student model to mimic the teacher's feature responses at locations close to the target class's ground-truth bounding box. Li et al. designed a rank mimicking method that compares the detection results of the teacher and student models and globally transfers the teacher model's target class ranking distribution to the student model, thereby narrowing the gap in detection performance between the two. Yang et al. proposed focal distillation and global distillation. Focal distillation enables the student model to focus on key pixels and channels in the teacher model's visual feature map, while global distillation transfers global relationships between pixels, compensating for the information lost in focal distillation. Bang et al. used radar data to train a visual target detection network, divided the radar image features into active and inactive regions according to the activation intensity, and performed selective feature distillation on these regions, thereby promoting the effective transfer of radar image features from the teacher network to the student network.
[0004] During the implementation of this invention, the inventors discovered that existing visual object detection methods for knowledge distillation suffer from target conflict. Specifically, during training, the student model must imitate both the real object categories and the predictions of the teacher model. This causes interference during the student model training, hindering optimization results. This, in turn, leads to low average precision of visual object detection and poor adaptability to diverse scenarios. Summary of the Invention
[0005] The present invention provides a visual target detection method based on cross-interchange distillation for intelligent driving. The purpose of the present invention is to solve the technical problem of target conflict existing in the visual target detection method based on knowledge distillation, so as to effectively improve the average accuracy of visual target detection and enhance the adaptability to diversified scenarios.
[0006] To achieve the above-mentioned purpose, the present invention proposes a visual target detection method based on cross-interchange distillation for intelligent driving, which includes the following steps:
[0007] Step S1, constructing a deep learning-based visual transformation target detection teacher network;
[0008] Step S2: determining a training set, inputting the training detection images in the training set into the deep learning-based visual transformation target detection teacher network to optimize the deep learning-based visual transformation target detection teacher network to obtain a trained visual transformation target detection teacher network;
[0009] Step S3: constructing a detection image feature depth transformation student network based on the trained visual transformation target detection teacher network, freezing the weights of the trained visual transformation target detection teacher network, and inputting the training detection images in the training set into the constructed detection image feature depth transformation student network and the visual transformation target detection teacher network with frozen weights, respectively, to obtain corresponding prediction results;
[0010] Step S4, based on the prediction results generated by the deep transformation student network of the detection image features and the trained visual transformation target detection teacher network, for the soft labels and bounding boxes of the target categories, calculate the cross entropy loss value, squared error loss value, cross exchange loss value and distillation loss value of the training detection image;
[0011] Step S5, randomly selecting M detection images each time to form a small batch sample, and calculating the total loss of the small batch sample according to the cross entropy loss value, square error loss value, cross exchange loss value and distillation loss value of each detection image in the small batch sample, so as to optimize the detection image feature deep transformation student network to obtain an optimized detection image feature deep transformation student network;
[0012] Step S6: Based on the optimized detection image feature, the student network is deeply transformed to extract the features of the image to be detected for target recognition, and obtain the result of visual target detection.
[0013] Optionally, step S1 includes the following steps:
[0014] Step S11: constructing a feature extraction module in the deep learning-based visual transformation target detection teacher network ;
[0015] Step S12: constructing a feature transformation module in the deep learning-based visual transformation target detection teacher network ;
[0016] Step S13: constructing a result prediction module in the deep learning-based visual transformation target detection teacher network , combining the feature extraction modules , feature transformation module And the result prediction module , and obtain the deep learning-based visual transformation target detection teacher network.
[0017] Optionally, step S2 includes the following steps:
[0018] Step S21, preprocessing the training detection images in the training set;
[0019] Step S22: input the pre-processed training detection images into the feature extraction module of the deep learning-based visual transformation target detection teacher network in sequence. and feature transformation module , obtaining a visual feature map of the training detection image;
[0020] Step S23: input the visual feature map of the training detection image into the result prediction module of the deep learning-based visual transformation target detection teacher network. , predicting the target category soft label and target category bounding box of the training detection image;
[0021] Step S24: Based on the predicted target category soft label and target category bounding box of the training detection image, a cross entropy loss is used to calculate the target category soft label and target category bounding box. Sum squared error loss The deep learning-based visual transformation target detection teacher network is jointly optimized to obtain a trained visual transformation target detection teacher network.
[0022] Optionally, in step S24, the cross entropy loss Sum squared error loss The overall optimization loss function composed of Expressed as:
[0023] ,
[0024] in, and They represent the weights of controlling the corresponding losses.
[0025] Optionally, step S3 includes the following steps:
[0026] Step S31: constructing a feature extraction module in the student network for detecting image feature depth transformation , feature transformation module And the result prediction module , and then combine them to obtain the detected image feature deep transformation student network;
[0027] Step S32: input the training detection images in the training set into the feature extraction module of the detection image feature depth transformation student network in sequence. and feature transformation module , obtain the visual feature map of the training detection image , and then the visual feature map Input to the detection image feature deep transformation student network result prediction module , obtain the prediction result corresponding to the training detection image ;
[0028] Step S33: Under the supervision of the trained visual transformation target detection teacher network, the weights of the trained visual transformation target detection teacher network are kept in a frozen state, and the training detection images are sequentially input into the feature extraction module of the trained visual transformation target detection teacher network. and feature transformation module , obtain the visual feature map of the training detection image , and then the visual feature map Input to the result prediction module of the trained visual transformation target detection teacher network , obtain the prediction result corresponding to the training detection image ;
[0029] Step S34: exchange the visual feature map and visual feature maps , the visual feature map Input to the detection image feature deep transformation student network result prediction module Get the prediction results , and the visual feature map Input to the result prediction module of the trained visual transformation target detection teacher network Get the prediction results .
[0030] Optionally, step S4 includes the following steps:
[0031] Step S41, based on the detected image feature depth transformation student network generated prediction results and the actual target category of the training detection image, using cross entropy loss Sum squared error loss Calculate the cross entropy loss value of each training detection image Sum squared error loss ;
[0032] Step S42: generating prediction results based on the depth transformation student network of the detected image features and the trained visual transformation target detection teacher network. and , using adaptive focal loss and mixed intersection-over-union loss Calculate the cross-exchange loss value for each training test image ;
[0033] Step S43: generating prediction results based on the trained visual transformation target detection teacher network and , using adaptive focal loss and mixed intersection-over-union loss Calculate the distillation loss value of each training detection image .
[0034] Optionally, in step S42, adaptive focus loss Expressed as:
[0035] ,
[0036] in, represents the weight used to adjust the loss function, Indicates that it is used to control The strength, represents the soft label predicted by the student network for each target category, represents the soft label predicted by the teacher network for each target category, is the predicted soft label and The KL divergence between and The difference between.
[0037] Optionally, in step S42, the mixed intersection-and-combination ratio loss Expressed as:
[0038] L mix = l 1 [ 1 − IoU ( b S , b T )] + l 2 d cent 2 ( b S , b T ) k 2 + l 3 | c − ( b S ∪ b T ) | | c | ,
[0039] in, , and Respectively represent the weights for adjusting the corresponding losses, represents the target category bounding box coordinate value predicted by the student network, represents the target category bounding box coordinate value predicted by the teacher network, express and The intersection-over-union ratio between express and The Euclidean distance between the center points, express and The length of the diagonal of the minimum enclosing rectangle, express and The minimum bounding rectangle of represents the area difference between the two, express and The area of the minimum enclosing rectangle.
[0040] Optionally, in step S42, the cross-exchange loss value Expressed as:
[0041] ,
[0042] in, Represents the weight controlling the adaptive focal loss.
[0043] Optionally, in step S43, the distillation loss value Expressed as:
[0044] ,
[0045] in, Represents the weight controlling the mixed intersection-over-union loss.
[0046] The present invention proposes a cross-exchange distillation method for visual object detection. By cross-exchanging the visual feature maps of a teacher network and a student network, this method not only effectively transfers the teacher network's soft labels and bounding box information, but also resolves the object conflict problem that exists during training. This allows the student model to approach the performance of the teacher model under resource-limited conditions, improving the average accuracy of visual object detection in intelligent driving systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1This is a flowchart of a visual target detection method based on cross-interchange distillation for intelligent driving according to one embodiment of the present invention. DETAILED DESCRIPTION
[0048] To make the objectives, technical solutions, and advantages of the present invention more clearly understood, the present invention will be further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present invention.
[0049] Figure 1 This is a flow chart of a visual target detection method based on cross-interchange distillation for intelligent driving according to an embodiment of the present invention. Figure 1 Take some specific implementation processes of the present invention as an example. Figure 1 As shown, the visual target detection method based on cross-interchange distillation for intelligent driving includes the following steps:
[0050] Step S1, constructing a deep learning-based visual transformation target detection teacher network;
[0051] Furthermore, the step S1 includes the following steps:
[0052] Step S11: constructing a feature extraction module in the deep learning-based visual transformation target detection teacher network ;
[0053] In one embodiment of the present invention, the feature extraction module in the deep learning-based visual transformation target detection teacher network It is obtained by sequentially connecting a convolutional layer with a stride of 2 and four residual blocks. Each residual block is composed of three convolutional layers of 1×1, 3×3, and 1×1 connected in sequence. The 1×1 convolutional layer is used for dimensionality reduction and dimensionality increase, respectively, and the 3×3 convolutional layer is used for feature extraction.
[0054] Step S12: constructing a feature transformation module in the deep learning-based visual transformation target detection teacher network ;
[0055] In one embodiment of the present invention, the feature transformation module in the deep learning-based visual transformation target detection teacher network The system includes a visual feature encoding layer, a visual feature construction layer, and a fully connected layer. The visual feature encoding layer includes a layer normalization structure, a multi-head self-attention structure, and a multi-layer perceptron structure. In one embodiment of the present invention, the number of layers of the visual feature encoding layer is set to 8, wherein each layer includes the above three structures. The visual feature construction layer includes a multi-head cross-attention structure and a multi-layer perceptron structure. In one embodiment of the present invention, the number of layers of the visual feature construction layer is set to 1.
[0056] Among them, the layer normalization structure, multi-head self-attention structure, multi-layer perceptron structure and multi-head cross-attention structure are commonly used deep learning algorithm structures in this field, and the present invention will not introduce them in detail.
[0057] Step S13: constructing a result prediction module in the deep learning-based visual transformation target detection teacher network , combining the feature extraction modules , feature transformation module And the result prediction module , and obtain the deep learning-based visual transformation target detection teacher network.
[0058] In one embodiment of the present invention, the result prediction module in the deep learning-based visual transformation target detection teacher network It consists of 5 sequentially connected fully connected layers.
[0059] Step S2: determining a training set, inputting the training detection images in the training set into the deep learning-based visual transformation target detection teacher network to optimize the deep learning-based visual transformation target detection teacher network to obtain a trained visual transformation target detection teacher network;
[0060] Furthermore, step S2 includes the following steps:
[0061] Step S21, preprocessing the training detection images in the training set;
[0062] In one embodiment of the present invention, pre-processing the training detection image includes: adjusting the size of the training detection image to a predetermined size, such as 512 512. Scale down all pixel values in the training detection image to a preset range, such as between 0 and 1. Then, subtract the global mean value of each pixel in the training detection image from the global mean value of the image and divide the value by the standard deviation of the image to reduce brightness differences between different images.
[0063] Step S22: input the pre-processed training detection images into the feature extraction module of the deep learning-based visual transformation target detection teacher network in sequence. and feature transformation module , obtaining a visual feature map of the training detection image;
[0064] In one embodiment of the present invention, the size of the visual feature map is P 1024, where P is the preset maximum number of objects in a detection image and 1024 is the dimension of the visual feature map. When training on the COCO dataset, the size of P can be set to 20.
[0065] Step S23: input the visual feature map of the training detection image into the result prediction module of the deep learning-based visual transformation target detection teacher network. , predicting the target category soft label and target category bounding box of the training detection image;
[0066] In one embodiment of the present invention, the result prediction module The size of the output prediction result is 20 6. Among them, 6 represents the dimension of the output result. The first 4 dimensions represent the coordinate values of the target category bounding box, the fifth dimension represents the confidence of the target category, and the sixth dimension represents the soft label of the target category.
[0067] Step S24: Based on the predicted target category soft label and target category bounding box of the training detection image, a cross entropy loss is used to calculate the target category soft label and target category bounding box. Sum squared error loss The deep learning-based visual transformation target detection teacher network is jointly optimized to obtain a trained visual transformation target detection teacher network.
[0068] Among them, the cross entropy loss is Sum squared error loss The overall optimization loss function composed of Expressed as:
[0069] ,
[0070] in, and Respectively represent the weights of controlling the corresponding losses. In one embodiment of the present invention, the weights and The value can be set to 1 and 3.
[0071] The process of optimizing a deep learning-based network model through a loss function is a technique that those skilled in the art should master, and the present invention does not provide any further explanation of the specific optimization process.
[0072] Furthermore, in step S24, the cross entropy loss It can be expressed as:
[0073] ,
[0074] Where N represents the number of target categories, represents the first prediction obtained by the deep learning-based visual transformation target detection teacher network soft labels for target categories, is the one-hot encoding of the true target category. Time-like ,otherwise .
[0075] Furthermore, in step S24, the square error loss It can be expressed as:
[0076] ,
[0077] in, represents the first prediction obtained by the deep learning-based visual transformation target detection teacher network The coordinate values of the target category bounding box, Represents the coordinate value of the corresponding real bounding box, Represents the squared error of each bounding box coordinate value.
[0078] Step S3: constructing a detection image feature depth transformation student network based on the trained visual transformation target detection teacher network, freezing the weights of the trained visual transformation target detection teacher network, and inputting the training detection images in the training set into the constructed detection image feature depth transformation student network and the visual transformation target detection teacher network with frozen weights, respectively, to obtain corresponding prediction results;
[0079] Furthermore, step S3 includes the following steps:
[0080] Step S31: constructing a feature extraction module in the student network for detecting image feature depth transformation , feature transformation module And the result prediction module , and then combine them to obtain the detected image feature deep transformation student network;
[0081] In one embodiment of the present invention, the feature extraction module in the detection image feature deep transformation student network It is obtained by sequentially connecting a convolutional layer with a stride of 2 and 4 residual blocks, where each residual block is composed of 2 sequentially connected 3×3 convolutional layers for feature extraction. The feature transformation module in the deep transformation student network of the image feature detection The system includes a visual feature encoding layer, a visual feature construction layer, and a fully connected layer. The visual feature encoding layer includes a layer normalization structure, a multi-head self-attention structure, and a multi-layer perceptron structure. In one embodiment of the present invention, the number of layers of the visual feature encoding layer is set to 4, wherein each layer includes the above three structures. The visual feature construction layer includes a multi-head cross-attention structure and a multi-layer perceptron structure. In one embodiment of the present invention, the number of layers of the visual feature construction layer is set to 1.
[0082] Step S32: input the training detection images in the training set into the feature extraction module of the detection image feature depth transformation student network in sequence. and feature transformation module , obtain the visual feature map of the training detection image , and then the visual feature map Input to the detection image feature deep transformation student network result prediction module , obtain the prediction result corresponding to the training detection image ;
[0083] In one embodiment of the present invention, the visual feature map of the training detection image The size is 20 1024, where 20 indicates that 20 target categories may be detected in the image, and 1024 is the visual feature map The dimension of the prediction result The size is 20 6.
[0084] Step S33: Under the supervision of the trained visual transformation target detection teacher network, the weights of the trained visual transformation target detection teacher network are kept in a frozen state, and the training detection images are sequentially input into the feature extraction module of the trained visual transformation target detection teacher network. and feature transformation module , obtain the visual feature map of the training detection image , and then the visual feature map Input to the result prediction module of the trained visual transformation target detection teacher network , obtain the prediction result corresponding to the training detection image ;
[0085] In one embodiment of the present invention, the visual feature map The size is 20 1024, the prediction result The size is 20 6.
[0086] Step S34: exchange the visual feature map and visual feature maps , the visual feature map Input to the detection image feature deep transformation student network result prediction module Get the prediction results , and the visual feature map Input to the result prediction module of the trained visual transformation target detection teacher network Get the prediction results .
[0087] In one embodiment of the present invention, the prediction result and Size is 20 6.
[0088] Step S4, based on the prediction results generated by the deep transformation student network of the detection image features and the trained visual transformation target detection teacher network, for the soft labels and bounding boxes of the target categories, calculate the cross entropy loss value, squared error loss value, cross exchange loss value and distillation loss value of the training detection image;
[0089] Furthermore, step S4 includes the following steps:
[0090] Step S41, based on the detected image feature depth transformation student network generated prediction results and the actual target category of the training detection image, using cross entropy loss Sum squared error loss Calculate the cross entropy loss value of each training detection image Sum squared error loss ;
[0091] In one embodiment of the present invention, the Kuhn-Munkres matching algorithm is first used to transform the prediction results generated by the student network in the detection image feature depth for each target category. Match an optimal prediction result, that is, the result closest to the true value, and then use the cross entropy loss Sum squared error loss Calculate the cross entropy loss value of each training detection image Sum squared error loss .
[0092] Step S42: generating prediction results based on the depth transformation student network of the detected image features and the trained visual transformation target detection teacher network. and , using adaptive focal loss and mixed intersection-over-union loss Calculate the cross-exchange loss value for each training test image ;
[0093] In one embodiment of the present invention, the cross-exchange loss value of the training detection image is for:
[0094] ,
[0095] in, represents the weight for controlling the adaptive focus loss. In one embodiment of the present invention, the weight The value can be set to 0.4.
[0096] The prediction results generated by calculating the detection image feature depth transformation student network and the trained visual transformation target detection teacher network and By cross-exchanging the loss values between them, the prediction ability of the student network can be brought close to that of the teacher network. At the same time, this method avoids the student network from imitating the prediction results of the teacher network and the true target category at the same time.
[0097] Furthermore, the adaptive focus loss Expressed as:
[0098] ,
[0099] in, represents the weight used to adjust the loss function, Indicates that it is used to control The strength, represents the soft label predicted by the student network for each target category, represents the soft label predicted by the teacher network for each target category, is the predicted soft label and The KL divergence between and The difference between.
[0100] In one embodiment of the present invention, the The value of is set to 0.25, the The value of can be expressed as:
[0101] ,
[0102] in, The value of is related to the soft label of the target category predicted by the student network.
[0103] Furthermore, the hybrid intersection-to-combination loss Expressed as:
[0104] L mix = l 1 [ 1 − IoU ( b S , b T )] + l 2 d cent 2 ( b S , b T ) k 2 + l 3 | c − ( b S ∪ b T ) | | c | ,
[0105] in, , and Respectively represent the weights for adjusting the corresponding losses, represents the target category bounding box coordinate value predicted by the student network, represents the target category bounding box coordinate value predicted by the teacher network, express and The intersection-over-union ratio between express and The Euclidean distance between the center points, express and The length of the diagonal of the minimum enclosing rectangle, express and The minimum bounding rectangle of represents the area difference between the two, express and The area of the minimum enclosing rectangle. Weight , and Can be set to 1, 2 and 2 respectively.
[0106] Step S43: generating prediction results based on the trained visual transformation target detection teacher network and , using adaptive focal loss and mixed intersection-over-union loss Calculate the distillation loss value of each training detection image .
[0107] In one embodiment of the present invention, the distillation loss value of the training detection image is for:
[0108] ,
[0109] in, represents the weight for controlling the loss of the hybrid intersection-over-union ratio. In one embodiment of the present invention, the weight The value can be set to 0.7.
[0110] By transforming the detected image features into a deep visual feature map of the student network Input the trained visual transformation target detection teacher network result prediction module Get the prediction results ,calculate and Distillation loss between , which can make the visual feature map of the student network closer to that of the teacher network, thereby effectively improving the feature representation ability and detection performance of the student network.
[0111] Step S5, randomly selecting M detection images each time to form a small batch sample, and calculating the total loss of the small batch sample according to the cross entropy loss value, square error loss value, cross exchange loss value and distillation loss value of each detection image in the small batch sample, so as to optimize the detection image feature deep transformation student network to obtain an optimized detection image feature deep transformation student network;
[0112] Among them, the total loss function Expressed as:
[0113] L S = 1 M ∑ i = 1 M [ β ( L cro i + L msm i ) + ( 1 − β )( L cex i + L dis i )] ,
[0114] in, represents the weight coefficient used to adjust between the two types of losses, represents the cross entropy loss value of the i-th detection image in the mini-batch sample, Represents the square error loss value of the i-th detection image in the small batch sample, represents the cross-exchange loss value of the i-th detection image in the mini-batch sample, represents the distillation loss value of the i-th detection image in the small batch sample. In one embodiment of the present invention, the The value of is 0.6.
[0115] In one embodiment of the present invention, when optimizing the detection image feature depth transformation student network, the number of detection images M selected is 32, and the parameters of the detection image feature depth transformation student network are adjusted by iterative calculation so that the total loss Minimum.
[0116] Step S6: Based on the optimized detection image feature, the student network is deeply transformed to extract the features of the image to be detected for target recognition, and obtain the result of visual target detection.
[0117] In one embodiment of the present invention, the dimension of the visual feature map of the image to be detected extracted by the student network for detecting image features is 512.
[0118] Among them, the feature extraction module is used After obtaining the visual feature map of the image to be detected, the feature transformation module can be used based on the extracted visual feature map. It is further processed and finally used in the result prediction module Get the result of visual target detection.
[0119] Using a large, publicly available online person re-identification database as a test subject, such as the COCO database, the proposed method achieved an average precision (AP) of 45.1% in visual object detection. This method, based on cross-interchange distillation, effectively enhances the student model's detection capabilities and improves its adaptability in diverse environments. This not only enables deployment on resource-constrained devices but also significantly improves the average precision of object detection, demonstrating the effectiveness of the proposed method.
[0120] It should be understood that the above-described specific embodiments of the present invention are merely illustrative or illustrative of the principles of the present invention and do not constitute limitations of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included within the scope of protection of the present invention. In addition, the appended claims are intended to cover all variations and modifications that fall within the scope and metes and bounds of the appended claims, or equivalents thereof.
Claims
1. A visual target detection method based on cross-interchange distillation for intelligent driving, characterized by: The method comprises the following steps: Step S1, constructing a deep learning-based visual transformation target detection teacher network; Step S2: determining a training set, inputting the training detection images in the training set into the deep learning-based visual transformation target detection teacher network to optimize the deep learning-based visual transformation target detection teacher network to obtain a trained visual transformation target detection teacher network; Step S3: constructing a detection image feature depth transformation student network based on the trained visual transformation target detection teacher network, freezing the weights of the trained visual transformation target detection teacher network, and inputting the training detection images in the training set into the constructed detection image feature depth transformation student network and the visual transformation target detection teacher network with frozen weights, respectively, to obtain corresponding prediction results; Step S4, based on the prediction results generated by the deep transformation student network of the detection image features and the trained visual transformation target detection teacher network, for the soft labels and bounding boxes of the target categories, calculate the cross entropy loss value, squared error loss value, cross exchange loss value and distillation loss value of the training detection image, wherein the cross exchange loss value is expressed as: , in, represents the cross-exchange loss value, represents the weight controlling the adaptive focal loss, represents the adaptive focal loss, represents the mixed intersection loss; Step S5, randomly selecting M detection images each time to form a small batch sample, and calculating the total loss of the small batch sample according to the cross entropy loss value, square error loss value, cross exchange loss value and distillation loss value of each detection image in the small batch sample, so as to optimize the detection image feature deep transformation student network to obtain an optimized detection image feature deep transformation student network; Step S6: Based on the optimized detection image feature, the student network is deeply transformed to extract the features of the image to be detected for target recognition, and obtain the result of visual target detection.
2. The method according to claim 1, characterized in that The step S1 comprises the following steps: Step S11: constructing a feature extraction module in the deep learning-based visual transformation target detection teacher network ; Step S12: constructing a feature transformation module in the deep learning-based visual transformation target detection teacher network ; Step S13: constructing a result prediction module in the deep learning-based visual transformation target detection teacher network , combining the feature extraction modules , feature transformation module And the result prediction module , and obtain the deep learning-based visual transformation target detection teacher network.
3. The method according to claim 1, characterized in that The step S2 comprises the following steps: Step S21, preprocessing the training detection images in the training set; Step S22: input the pre-processed training detection images into the feature extraction module of the deep learning-based visual transformation target detection teacher network in sequence. and feature transformation module , obtaining a visual feature map of the training detection image; Step S23: input the visual feature map of the training detection image into the result prediction module of the deep learning-based visual transformation target detection teacher network. , predicting the target category soft label and target category bounding box of the training detection image; Step S24: Based on the predicted target category soft label and target category bounding box of the training detection image, a cross entropy loss is used to calculate the target category soft label and target category bounding box. Sum squared error loss The deep learning-based visual transformation target detection teacher network is jointly optimized to obtain a trained visual transformation target detection teacher network.
4. The method according to claim 3, characterized in that In step S24, the cross entropy loss Sum squared error loss The overall optimization loss function composed of Expressed as: , in, and They represent the weights of controlling the corresponding losses.
5. The method according to claim 1, wherein The step S3 comprises the following steps: Step S31, constructing the feature extraction module in the student network of the detected image feature depth transformation , feature transformation module And the result prediction module , and then combine them to obtain the detected image feature deep transformation student network; Step S32: input the training detection images in the training set into the feature extraction module of the detection image feature depth transformation student network in sequence. and feature transformation module , obtain the visual feature map of the training detection image , and then the visual feature map Input to the detection image feature deep transformation student network result prediction module , obtain the prediction result corresponding to the training detection image ; Step S33: Under the supervision of the trained visual transformation target detection teacher network, the weights of the trained visual transformation target detection teacher network are kept in a frozen state, and the training detection images are sequentially input into the feature extraction module of the trained visual transformation target detection teacher network. and feature transformation module , obtain the visual feature map of the training detection image , and then the visual feature map Input to the result prediction module of the trained visual transformation target detection teacher network , obtain the prediction result corresponding to the training detection image ; Step S34: exchange the visual feature map and visual feature maps , the visual feature map Input to the detection image feature deep transformation student network result prediction module Get the prediction results , and the visual feature map Input to the result prediction module of the trained visual transformation target detection teacher network Get the prediction results .
6. The method according to claim 1, characterized in that The step S4 comprises the following steps: Step S41, based on the detected image feature depth transformation student network generated prediction results and the actual target category of the training detection image, using cross entropy loss Sum squared error loss Calculate the cross entropy loss value of each training detection image Sum squared error loss ; Step S42, based on the detected image feature depth transformation student network and the trained Predictions generated by a teacher network for visually transformed object detection and , using adaptive focal loss and mixed intersection-over-union loss Calculate the cross-exchange loss value for each training test image ; Step S43: generating prediction results based on the trained visual transformation target detection teacher network. and , using adaptive focal loss and mixed intersection-over-union loss Calculate the distillation loss value of each training detection image .
7. The method according to claim 6, characterized in that In step S42, adaptive focus loss Expressed as: , in, represents the weight used to adjust the loss function, Indicates that it is used to control The strength, represents the soft label predicted by the student network for each target category, represents the soft label predicted by the teacher network for each target category, is the predicted soft label and The KL divergence between and The difference between.
8. The method according to claim 6, characterized in that In step S42, the mixed intersection-to-combination ratio loss Expressed as: , in, , and Respectively represent the weights for adjusting the corresponding losses, represents the target category bounding box coordinate value predicted by the student network, represents the target category bounding box coordinate value predicted by the teacher network, express and The intersection-over-union ratio between express and The Euclidean distance between the center points, express and The length of the diagonal of the minimum enclosing rectangle, express and The minimum bounding rectangle of represents the area difference between the two, express and The area of the minimum enclosing rectangle.
9. The method according to claim 6, characterized in that In step S43, the distillation loss value Expressed as: , in, Represents the weight controlling the mixed intersection-over-union loss.
Citation Information
Patent Citations
Neural network training method and device
CN107247989A
Distraction driving detection method based on generative adversarial network and knowledge chart distillation
CN116386013A