A lightweight traffic fixation target detection method based on knowledge distillation
Through knowledge distillation technology, we design a salient area and gaze target distillation strategy, optimize the traffic gaze target detection model, solve the problems of large parameters and slow detection speed of the existing model, and achieve efficient detection on the vehicle platform.
Patent Information
- Application Number
- CN202310605751.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-25
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2043-05-25
AI Technical Summary
The existing traffic gaze target detection model has large parameters and slow detection speed, and the lightweight model based on the full target detection paradigm has insufficient accuracy in detecting traffic gaze targets, making it difficult to effectively deploy on vehicle-mounted platforms with limited computing resources.
Using a method based on knowledge distillation, by building a teacher model and a student model, we design a salient area distillation strategy and a gaze target distillation strategy to reduce model parameters and improve detection speed and accuracy. We use the loss function to optimize the model and extract rich salient area features and Contextual information on gaze target location and category.
Significantly reducing model parameters, while achieving fast detection speed and high detection accuracy, it provides a lightweight and effective solution for traffic gaze target detection, and is suitable for vehicle-mounted platforms with limited computing resources.
Smart Images

Figure CN116665145B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a lightweight traffic gaze target detection method based on knowledge distillation. Background Art
[0002] Traffic gaze target detection is a traffic scene perception task that combines visual saliency and target detection properties. It can not only predict which areas and targets closely related to the driving task the driver should focus on, but also detect the target categories that attract the driver's attention, providing an alternative strategy for the development of highly intelligent assisted driving systems.
[0003] The current models focusing on traffic gaze target detection generally have large parameters and slow detection speed, which is not conducive to the deployment of vehicle-mounted platforms with limited computing resources. The lightweight model developed based on the full target detection paradigm is insufficient in the accuracy of traffic gaze target detection. Therefore, there is an urgent need for a lightweight model targeting the characteristics of traffic gaze target detection to reduce model parameters while achieving fast detection speed and high detection accuracy. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides a lightweight traffic attention target detection method based on knowledge distillation, which has the advantages of being able to achieve fast detection speed and high detection accuracy while significantly reducing model parameters.
[0005] The above technical objectives of the present invention are achieved through the following technical solutions:
[0006] A lightweight traffic gaze target detection method based on knowledge distillation includes the following steps:
[0007] S1, based on the FOD-Net model, a teacher model with strong detection capabilities is built to extract rich salient area features and traffic attention target features;
[0008] S2, based on the teacher model constructed in S1, builds a lightweight student model to reduce model parameters while achieving fast detection speed;
[0009] S3, design a salient region distillation strategy, and use the salient region features that attract the driver's attention extracted by the salient region guidance module in the teacher model, that is, the non-predicted saliency map, to distill the rich salient region features extracted by the corresponding salient region guidance module in the student model;
[0010] S4, design a fixation target distillation strategy, and use the context information representing the fixation target position and category extracted by the target detection module in the teacher model to distill the corresponding context information in the student model;
[0011] S5, after scaling the images in the training set to a given input resolution, input the images into the teacher model constructed in S1 and the student model constructed in S2, and train the student model using the salient region distillation strategy established in S3 and the fixation target distillation strategy established in S4, thereby improving the detection performance of the student model.
[0012] The present invention is further configured as follows: in S1, the number of channels per layer of the FOD-Net model and the number of CSP modules are respectively increased by 25% and 33%, so as to establish a teacher model with strong detection capability for extracting fine-grained salient area features that attract the driver's attention and context information that characterizes the location and category of the gaze target;
[0013] The teacher model is optimized using the loss function, as shown in the following formula (1):
[0014]
[0015] In the formula, It is the loss function in the YOLOv5 model and is used to supervise the training of the target detection module in the teacher model; is the loss function defined in the FOD-Net model, which is used to supervise the training of the salient area guidance module in the teacher model; α is the weight coefficient.
[0016] The present invention is further configured as follows: in S2, the number of channels in each layer of the teacher model is reduced by 60%, the number of CSP modules in the third downsampling layer and the number of CSP modules in the fourth downsampling layer are set to 2, and the number of remaining CSP modules is reduced to 1, thereby establishing a lightweight student model for reducing model parameters while obtaining a fast detection speed.
[0017] The present invention is further configured as follows: in S3, the salient region features extracted by the salient region guiding module in the teacher model established in S1, i.e., the non-predicted saliency map, are used to distill the salient region features extracted by the corresponding salient region guiding module in the student model established in S2;
[0018] The student model is optimized using the constructed significant region distillation loss as shown in the following formula (2):
[0019]
[0020] In the formula, F i is the salient region feature extracted by the salient region guidance module in the teacher model in S1, i.e., the non-predicted saliency map, F i The scale is w and h represent the width and height of the input image respectively, F i ′The salient region features extracted by the salient region guidance module in the student model in S2, with their scale and F i The agreement, is the mean square error loss.
[0021] The present invention is further configured as follows: in S4, the context information representing the position and category of the fixation target extracted by the target detection module in the teacher model established in S1 is used to distill the corresponding context information in the student model established in S2;
[0022] The student model is optimized using the constructed gaze target distillation loss as shown in the following equation (3):
[0023]
[0024] In the formula, f i The features representing the location and category of the gaze target extracted by the target detection module in the teacher model established in S1, f i ′ The features representing the location and category of the gaze target extracted by the target detection module in the student model established in S2, is the mean square error loss.
[0025] The present invention is further configured as follows: in S5, the teacher model established in S1 is pre-trained using the training set, and when the mAP value of the validation set is maximized, the pre-trained teacher model parameters are retained for distilling the student model established in S2; at the same time, the student model is trained using the training set, and the loss function is shown in Formula (4):
[0026]
[0027] In the formula, is the loss defined in formula (1), is the loss defined in equation (2), is the loss defined in equation (3), β and γ are weight coefficients;
[0028] When the mAP value of the validation set reaches the maximum, the student model parameters are retained for testing.
[0029] The invention has the following beneficial effects: the invention uses knowledge distillation to develop a lightweight detection model to detect the fixation target that is closely related to the current driving task. For this purpose, a salient region distillation strategy and a fixation target distillation strategy are designed to distill the salient region features extracted by the salient region guidance module in the teacher model and the context information representing the fixation target position and category extracted by the target detection module to the corresponding features in the student model, thereby significantly reducing the model parameters while achieving fast detection speed and high detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A structural diagram of a salient region distillation and a fixation target distillation provided in an embodiment of the present invention;
[0031] Figure 2 This is a detection effect diagram of an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0033] A lightweight traffic gaze target detection method based on knowledge distillation includes the following implementation process: In order to carry out the study of lightweight gaze target detection method, the ETFOD dataset is used. The dataset contains 29053 frames of pictures, including 20299 frames for training, 2917 frames for validation, 5837 frames for test, and 5 target categories, namely: traffic-sign, person, car, motorcycle, traffic-light.
[0034] The implementation steps of this embodiment are:
[0035] S1, in order to extract rich salient region features and characterize the contextual information of the gaze target location and category, the number of channels per layer of the FOD-Net model and the number of CSP modules are increased by 25% and 33% respectively, thereby establishing a teacher model TFOD-Net with strong detection capabilities. The established TFOD-Net consists of a salient region guidance module (SRGM) and an object detection module (ODM), such as Figure 1 As shown in Figure 2. The salient region guidance module predicts the salient regions that attract the driver's attention in the traffic scene from two different feature layers, which helps the model extract fine-grained features of the salient regions. The object detection module has two detection heads (H2 and H4) corresponding to 4x and 16x downsampling rates, which can aggregate contextual information representing the location and category of gaze targets of different scales.
[0036] The teacher model TFOD-Net is optimized using the loss function as shown in the following formula (1):
[0037]
[0038] In the formula, It is the loss function in the YOLOv5 model and is used to supervise the training of the target detection module in the teacher model; is the loss function defined in the FOD-Net model, which is used to supervise the training of the salient area guidance module in the teacher model; α is the weight coefficient, which is set to 0.1 in this case.
[0039] S2, adopts the same network structure as the teacher model TFOD-Net established in S2, and reduces the number of channels per layer by 60%, reduces the number of CSP modules to 1, except that the number of CSP modules in the third and fourth downsampling layers is set to 2; thus, a lightweight student model SFOD-Net is established to significantly reduce model parameters while achieving fast detection speed. The student model SFOD-Net is optimized using the loss function in formula (1).
[0040] S3, in order to improve the detection ability of the student model SFOD-Net for the salient areas that attract the driver's attention in the traffic scene, a salient area distillation strategy is established. The fine-grained salient area features (non-predicted saliency maps) of two different layers extracted by the teacher model TFOD-Net are used to distill the corresponding features in the student model SFOD-Net. The student model is optimized using the constructed salient area distillation loss, as shown in the following formula (2):
[0041]
[0042] In the formula, F i is the salient region feature extracted by the salient region guidance module in the teacher model TFOD-Net established in S2, F i The scale is w and h represent the width and height of the input image respectively, F i ′ The salient region features extracted by the salient region guidance module in the SFOD-Net student model in S3, with their scale and F i The agreement, is the mean square error loss.
[0043] S4, in order to improve the detection ability of the student model SFOD-Net on the location and category of traffic gaze targets, a gaze target distillation strategy is established. The context information representing the location and category of gaze targets at different scales aggregated by the two detection heads H2 and H4 of the gaze target detection module in the teacher model TFOD-Net is used to distill the corresponding features in the student model SFOD-Net. The student model is optimized using the constructed gaze target distillation loss, as shown in the following formula (3):
[0044]
[0045] In the formula, f i The context information of the positions and categories of the gaze targets of different scales is aggregated by the two detection heads H2 and H4 in the teacher model TFOD-Net established in S2. i ′The context information representing the positions and categories of the gaze targets at different scales is aggregated by the two detection heads H2 and H4 in the student model SFOD-Net established in S3. is the mean square error loss.
[0046] S5, uses the rich features extracted by the teacher model as a priori to guide the student model, specifically:
[0047] a,First, the images of the training set are scaled to a given resolution to pre-train the teacher model TFOD-Net, and the loss is shown in formula (1). When the mAP value of the validation set is the largest, the pre-trained teacher model parameters are retained for distillation of the student model SFOD-Net.
[0048] b. Scale the images in the training set to a given resolution to train the student model SFOD-Net. At the same time, the salient region features extracted by the teacher model TFOD-Net and the contextual information representing the position of the gaze target and the category are used to distill the features and contextual information corresponding to the student model SFOD-Net. A composite loss function is established to optimize the student model, as shown in formula (4):
[0049]
[0050] In the formula, is the loss defined in formula (1), is the loss defined in equation (2), is the loss defined in equation (3), β and γ are weight coefficients. In this example, β and γ are set to 0.15.
[0051] When the mAP value of the validation set is maximized, the student model parameters are retained for testing. The quantitative test results between different advanced models are shown in Table 1 (SFOD-Net represents the test results without using the distillation method, and SFOD-Net / distil represents the test results using the distillation method proposed by the present invention). Figure 2As shown. It can be found that compared with large models, such as TOOD, the SFOD-Net / distil proposed in the present invention not only significantly reduces the model parameters and GFLOPs, but also improves the calculation speed FPS and the detection accuracy mAP. Compared with lightweight models, such as YOLOX-S and YOLOv5s-seg, the SFOD-Net / distil proposed in the present invention significantly improves the detection accuracy. The excellent comprehensive detection performance demonstrated by SFOD-Net / distil provides an effective method for the application of traffic gaze target detection and provides another strategy for advanced driver assistance systems. It should be noted that during the training of the teacher model and the student model, the resolution of the image input to the network is set to 416×256 pixels, the data enhancement method uses left-right flipping and scale scaling, and the batch size is set to 24. The hyperparameters used are consistent with the YOLOv5 model. During the test phase, the batch size was set to 1, and no data enhancement method was used.
[0052]
[0053] Table 1 Quantitative detection results between different advanced models
[0054] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A lightweight traffic gaze target detection method based on knowledge distillation, characterized by: The following steps are involved: S1, based on the FOD-Net model, a teacher model with strong detection capabilities is built to extract rich salient area features and traffic attention target features; S2, based on the teacher model constructed in S1, builds a lightweight student model to reduce model parameters while achieving fast detection speed; S3, design a salient region distillation strategy, and use the salient region features that attract the driver's attention extracted by the salient region guidance module in the teacher model, that is, the non-predicted saliency map, to distill the rich salient region features extracted by the corresponding salient region guidance module in the student model; S4, design a fixation target distillation strategy, and use the context information representing the fixation target position and category extracted by the target detection module in the teacher model to distill the corresponding context information in the student model; S5, after scaling the images in the training set to a given input resolution, input the images into the teacher model constructed in S1 and the student model constructed in S2, and train the student model using the salient region distillation strategy established in S3 and the fixation target distillation strategy established in S4, thereby improving the detection performance of the student model; In S3, the salient region features extracted by the salient region guidance module in the teacher model established in S1, i.e., the non-predicted saliency map, are used to distill the salient region features extracted by the corresponding salient region guidance module in the student model established in S2; The student model is optimized using the constructed significant region distillation loss as shown in the following formula (2): In the formula, F i is the salient region feature extracted by the salient region guidance module in the teacher model in S1, i.e., the non-predicted saliency map, F i The scale is w and h represent the width and height of the input image respectively, F′ i The salient region features extracted by the salient region guidance module in the student model in S2, with their scale and F i The agreement, is the mean square error loss; In S4, the context information representing the position and category of the fixation target extracted by the target detection module in the teacher model established in S1 is used to distill the corresponding context information in the student model established in S2; The student model is optimized using the constructed gaze target distillation loss as shown in the following equation (3): In the formula, f i The features representing the location and category of the gaze target extracted by the target detection module in the teacher model established in S1, f i ′ is the feature representing the position and category of the gaze target extracted by the target detection module in the student model established in S2, is the mean square error loss; In S5, the training set is used to pre-train the teacher model established in S1. When the mAP value of the validation set is maximized, the pre-trained teacher model parameters are retained for distilling the student model established in S2. At the same time, the training set is used to train the student model, and the loss function is shown in formula (4): In the formula, is the loss defined in formula (1), is the loss defined in equation (2), is the loss defined in equation (3), β and γ are weight coefficients; When the mAP value of the validation set reaches the maximum, the student model parameters are retained for testing.
2. A lightweight traffic attention target detection method based on knowledge distillation as claimed in claim 1, characterized in that: In S1, the number of channels per layer of the FOD-Net model and the number of CSP modules are increased by 25% and 33% respectively, so as to establish a teacher model with strong detection ability to extract fine-grained salient area features that attract the driver's attention and contextual information that characterizes the location and category of the gaze target; The teacher model is optimized using the loss function, as shown in the following formula (1): In the formula, It is the loss function in the YOLOv5 model and is used to supervise the training of the target detection module in the teacher model; is the loss function defined in the FOD-Net model, which is used to supervise the training of the salient area guidance module in the teacher model; α is the weight coefficient.
3. A lightweight traffic attention target detection method based on knowledge distillation as claimed in claim 2, characterized in that: In S2, the number of channels per layer of the teacher model is reduced by 60%, the number of CSP modules in the third downsampling layer and the number of CSP modules in the fourth downsampling layer is set to 2, and the number of remaining CSP modules is reduced to 1, thereby establishing a lightweight student model for reducing model parameters while achieving fast detection speed.
