AI detection method and device for illegal occupation of emergency lane based on drone
By using a multi-task detection model on a drone to perform vehicle detection and lane segmentation on inspection images, combined with illegal occupation detection and license plate recognition, the problem of poor detection results and high cost of illegal occupation of emergency lanes in the existing technology is solved, achieving It achieves efficient and low-cost detection results.
Patent Information
- Application Number
- CN202410362084.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-03-28
AI Technical Summary
Existing technologies are not effective in detecting illegal occupation of emergency lanes during highway inspections, and AI-based detection usually has high computational costs and requires high-end hardware, resulting in higher costs.
UAV-based AI detection method is used to perform vehicle detection and lane segmentation tasks on inspection images through a pre-trained multi-task detection model to determine whether the vehicle is in the emergency lane, and collect vehicle images for illegal occupation when it is determined that it is. For detection and license plate recognition, the improved network structure is used to achieve multi-task detection results in one inspection image, reducing the amount of calculation and hardware requirements.
It achieves accurate detection of illegal occupation of emergency lanes, significantly reduces the amount of calculations and hardware requirements required for detection, reduces detection costs, and can automatically switch the image focus, improving the inconvenience of manual control.
Smart Images

Figure CN118038385B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an AI detection method and device for illegally occupying an emergency lane based on a drone. Background Art
[0002] Currently, drones have important applications in highway inspections. Among them, the detection of emergency lane occupancy based on traditional detection algorithms is not effective in practice. The inspection of emergency lane occupancy based on AI (Artificial Intelligence) usually has high computational costs and requires high-end hardware, which requires huge costs. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide an AI detection method and device for illegal occupation of emergency lanes based on drones, which can accurately detect the situation of vehicles illegally occupying emergency lanes, and can also significantly reduce the amount of calculation required to detect illegal occupation of emergency lanes, which helps to reduce hardware requirements and detection costs.
[0004] In a first aspect, an embodiment of the present invention provides an AI detection method for illegal occupation of emergency lanes based on drones, comprising:
[0005] Controlling a drone to inspect a target road along a preset route, and controlling the drone to collect an inspection image corresponding to the target road at a first focal length; wherein the inspection image displays content including the target road and vehicles traveling on the target road;
[0006] By using a pre-trained multi-task detection model, a vehicle detection task and a lane segmentation task are performed on the inspection image to obtain a vehicle detection result and an emergency lane segmentation result to determine whether there is a vehicle located in the emergency lane of the target road;
[0007] If yes, controlling the drone to collect a vehicle image corresponding to the vehicle at a second focal length; wherein the second focal length is greater than the first focal length;
[0008] Based on the vehicle image, an illegal occupation detection task is performed on the vehicle to obtain an illegal occupation detection result, and / or a license plate recognition task is performed on the vehicle to obtain a license plate recognition result.
[0009] In one embodiment, the multi-task detection model includes an encoder and a decoder, wherein the encoder includes a feature extraction network, a vehicle detection network, and a lane segmentation network;
[0010] The steps of performing a vehicle detection task and a lane segmentation task on the inspection image through a pre-trained multi-task detection model to obtain a vehicle detection result and an emergency lane segmentation result include:
[0011] Extracting multi-scale initial feature information of the inspection image through the feature extraction network; wherein the feature extraction network includes a plurality of feature extraction sub-networks;
[0012] By means of the vehicle detection network, the initial feature information of multiple sizes is fused to obtain vehicle feature information; and by means of the lane segmentation network, the initial feature information of multiple sizes is fused to obtain lane feature information;
[0013] Through the decoder, a vehicle detection result is determined based on the vehicle feature information, and an emergency lane segmentation result is determined based on the lane feature information.
[0014] In one embodiment, the vehicle detection network includes a plurality of vehicle detection subnetworks, each of the vehicle detection subnetworks corresponds one-to-one to each of the feature extraction subnetworks, and a first hybrid attention module is introduced between the vehicle detection subnetwork and the feature extraction subnetwork;
[0015] The step of fusing the initial feature information of multiple sizes to obtain vehicle feature information through the vehicle detection network includes:
[0016] By means of the first hybrid attention module, feature fusion is performed based on the initial feature information output by the feature extraction subnetwork corresponding to the current vehicle detection network and the initial feature information output by the feature extraction subnetwork corresponding to the previous vehicle detection subnetwork to obtain target fused feature information;
[0017] Through the vehicle detection subnetwork, based on the target fused feature information output by the first hybrid attention unit and the vehicle feature information output by the previous vehicle detection subnetwork, the vehicle feature information output by the current vehicle detection subnetwork is determined.
[0018] In one embodiment, the lane segmentation network includes a plurality of lane segmentation subnetworks, the lane segmentation subnetworks correspond one-to-one to the specified plurality of feature extraction subnetworks, and a second hybrid attention module is introduced between the lane segmentation subnetwork and the feature extraction subnetwork;
[0019] The step of fusing the initial feature information of multiple sizes to obtain lane feature information through the lane segmentation network includes:
[0020] By means of the second hybrid attention module, feature fusion is performed based on the initial feature information output by the feature extraction subnetwork corresponding to the current lane segmentation network and the initial feature information output by the feature extraction subnetwork corresponding to the next vehicle detection subnetwork to obtain target fused feature information;
[0021] Through the lane segmentation subnetwork, based on the target fused feature information output by the second hybrid attention module and the lane feature information output by the previous lane segmentation subnetwork, the lane feature information output by the current lane segmentation subnetwork is determined.
[0022] In one embodiment, the first hybrid attention unit and the second hybrid attention unit each include a first attention sub-unit and a second attention sub-unit;
[0023] The first attention sub-unit is used to perform spatial attention processing on two input feature information; the second attention sub-unit is used to perform channel attention processing on two input feature information.
[0024] In one embodiment, based on the vehicle image, the step of performing an illegal occupation detection task on the vehicle to obtain an illegal occupation detection result, and / or performing a license plate recognition task on the vehicle to obtain a license plate recognition result includes:
[0025] Based on the vehicle image, performing an illegal occupation detection task on the vehicle to obtain an illegal occupation detection result;
[0026] In a case where the illegal occupation detection result indicates that the vehicle illegally occupies the emergency lane, a license plate recognition task is performed on the vehicle based on the vehicle image information to obtain a license plate recognition result.
[0027] In one embodiment, based on the vehicle image, the step of performing an illegal occupation detection task on the vehicle to obtain an illegal occupation detection result includes:
[0028] Segmenting and identifying the taillight area of the vehicle from the vehicle image, and detecting the color change of the taillight area at a preset frequency to obtain the taillight change situation;
[0029] And, using a pre-trained facility detection model, based on the vehicle image, detecting whether a designated facility is placed within the vehicle area, and obtaining a facility detection result;
[0030] The illegal occupation detection result includes the tail light change and / or facility detection result.
[0031] In one embodiment, based on the vehicle image information, the step of performing a license plate recognition task on the vehicle to obtain a license plate recognition result includes:
[0032] Identifying and cropping a vehicle bounding box in the vehicle image information;
[0033] Detecting license plate position information based on the license plate bounding box using a pre-trained license plate detection model;
[0034] A license plate recognition result corresponding to the vehicle is determined based on the license plate position information.
[0035] In a second aspect, an embodiment of the present invention further provides an AI detection device for illegal occupation of emergency lanes based on drones, comprising:
[0036] A first control module is used to control the drone to inspect the target road along a preset route, and control the drone to collect an inspection image corresponding to the target road at a first focal length; wherein the inspection image displays content including the target road and vehicles traveling on the target road;
[0037] A multi-task detection module is used to perform a vehicle detection task and a lane segmentation task on the inspection image through a pre-trained multi-task detection model to obtain a vehicle detection result and an emergency lane segmentation result to determine whether there is a vehicle located in the emergency lane of the target road;
[0038] A second control module, configured to control the drone to collect a vehicle image corresponding to the vehicle at a second focal length when the judgment result of the multi-task detection module is yes; wherein the second focal length is greater than the first focal length;
[0039] The illegal occupation detection and license plate recognition module is used to perform an illegal occupation detection task on the vehicle based on the vehicle image to obtain an illegal occupation detection result, and / or to perform a license plate recognition task on the vehicle to obtain a license plate recognition result.
[0040] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement any one of the methods provided in the first aspect.
[0041] An embodiment of the present invention provides an AI detection method and device for illegal occupation of an emergency lane based on a drone. First, the drone is controlled to patrol the target road along a preset route, and the drone is controlled to collect a patrol image corresponding to the target road at a first focal length, and the content displayed in the patrol image includes the target road and the vehicle traveling on the target road; then, through a pre-trained multi-task detection model, a vehicle detection task and a lane segmentation task are performed on the patrol image to obtain a vehicle detection result and an emergency lane segmentation result to determine whether there is a vehicle in the emergency lane of the target road; if the judgment result is yes, the drone is continued to be controlled to collect a vehicle image corresponding to the vehicle at a second focal length, and the second focal length is greater than the first focal length; finally, based on the vehicle image, an illegal occupation detection task is performed on the vehicle to obtain an illegal occupation detection result, and / or a license plate recognition task is performed on the vehicle to obtain a license plate recognition result. The above method proposes a multi-task detection model by improving the network structure, so that the vehicle detection result and the emergency lane segmentation result can be obtained simultaneously by inputting a patrol image once, so as to determine the illegal occupation detection result and / or the license plate recognition result on this basis. The embodiment of the present invention can accurately detect the situation of vehicles illegally occupying the emergency lane, and greatly reduce the amount of calculation required for detecting illegal occupation of the emergency lane, which helps to reduce the hardware requirements and detection costs; in addition, the embodiment of the present invention can also automatically control the pod when the vehicle is located in the emergency lane of the target road, that is, automatically switch the focal length of the drone to collect images, effectively improving the inconvenience caused by manual control.
[0042] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0043] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 A flowchart of an AI detection method for illegal occupation of emergency lanes based on drones provided in an embodiment of the present invention;
[0046] Figure 2 A schematic diagram of a framework of a multi-task detection model provided by an embodiment of the present invention;
[0047] Figure 3 A schematic diagram of the specific structure of a multi-task detection model provided by an embodiment of the present invention;
[0048] Figure 4 A schematic diagram of the structure of a hybrid attention unit provided by an embodiment of the present invention;
[0049] Figure 5 A schematic diagram of a license plate recognition result provided by an embodiment of the present invention;
[0050] Figure 6 A schematic diagram of an inspection output result provided by an embodiment of the present invention;
[0051] Figure 7 An overall flow chart of an AI detection method for illegal occupation of emergency lanes based on drones provided in an embodiment of the present invention;
[0052] Figure 8 A schematic diagram of the structure of an AI detection device for illegal occupation of emergency lanes based on drones provided in an embodiment of the present invention;
[0053] Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] At present, it is difficult for relevant technologies to take into account both the effect and cost of detecting illegal occupation of emergency lanes. Based on this, the present invention provides an AI detection method and device for illegal occupation of emergency lanes based on drones, which can accurately detect the situation of vehicles illegally occupying emergency lanes, and can also significantly reduce the amount of calculation required for detecting illegal occupation of emergency lanes, which helps to reduce hardware requirements and detection costs.
[0056] To facilitate understanding of this embodiment, firstly, an AI detection method for illegal occupation of emergency lanes based on drones disclosed in an embodiment of the present invention is described in detail, see Figure 1The flowchart of an AI detection method for illegal occupation of emergency lanes based on drones is shown, and the method mainly includes the following steps S102 to S108:
[0057] Step S102: Control the drone to inspect the target road along a preset route, and control the drone to collect inspection images corresponding to the target road at a first focal length.
[0058] The inspection image displays the target road and the vehicles traveling on the target road. In one embodiment, the inspection route can be pre-configured to control the drone to inspect the target road according to the inspection route. During the inspection process, the camera carried by the drone will collect the inspection image corresponding to the target road at the first focal length. Preferably, the camera carried by the drone can be controlled to tilt at a certain angle to facilitate the subsequent shooting of the vehicle's license plate.
[0059] Step S104, using a pre-trained multi-task detection model, performs a vehicle detection task and a lane segmentation task on the inspection image to obtain a vehicle detection result and an emergency lane segmentation result to determine whether there is a vehicle in the emergency lane of the target road.
[0060] In one embodiment, the one-stage network of the multi-task detection model has an encoder-decoder architecture, the encoder includes a Backbone network (also known as a feature extraction network) and two Neck networks (also known as a vehicle detection network and a lane segmentation network), and the decoder is composed of a Head. The embodiment of the present invention uses two Neck networks: one is a vehicle detection network for vehicle detection, and the other is a lane segmentation network for the emergency lane. The model has a simple and efficient structure, which not only expands its scope of application, but also ensures real-time reasoning performance. Among them, the vehicle detection results may include target categories, vehicle bounding boxes, and vehicle masks Mask, and the emergency lane segmentation results may also include target categories, emergency lane bounding boxes, and emergency lane masks Mask.
[0061] Step S106: if yes, control the drone to collect a vehicle image corresponding to the vehicle at a second focal length; wherein the second focal length is greater than the first focal length.
[0062] In one embodiment, if there is a vehicle parked in the emergency lane, the drone is switched from the first focal length to the second focal length, and the camera carried by the drone is controlled to capture a vehicle image corresponding to the vehicle at the second focal length. Optionally, the area occupied by the vehicle in the vehicle image is at least 1 / 5, so that the license plate can be clearly captured.
[0063] Step S108, based on the vehicle image, performing an illegal occupation detection task on the vehicle to obtain an illegal occupation detection result, and / or performing a license plate recognition task on the vehicle to obtain a license plate recognition result.
[0064] The illegal occupation detection result can be judged by whether the vehicle's head or tail has double flashes, and / or whether there are tripods or cones placed around the vehicle. The illegal occupation detection result is used to characterize whether the vehicle parked in the emergency lane is illegally occupied; the license plate recognition result is the license plate number of the vehicle parked in the emergency lane. In one embodiment, the vehicle's license plate number can be identified when it is determined that the vehicle is illegally occupied, so that its license plate number is reported; or, if the vehicle's license plate number cannot be identified, it will be photographed and reported as a blocked license plate or other situation.
[0065] The AI detection method for illegal occupation of emergency lanes based on drones provided in an embodiment of the present invention proposes a multi-task detection model by improving the network structure, so that the vehicle detection results and the emergency lane segmentation results can be obtained simultaneously by inputting a patrol image once, so as to determine the illegal occupation detection results and / or license plate recognition results on this basis. The embodiment of the present invention can accurately detect the situation of vehicles illegally occupying emergency lanes, and greatly reduce the amount of calculation required for detecting illegal occupation of emergency lanes, which helps to reduce hardware requirements and detection costs; in addition, the embodiment of the present invention can also automatically control the pod when the vehicle is located in the emergency lane of the target road, that is, automatically switch the focal length of the drone to collect images, effectively improving the inconvenience caused by manual control.
[0066] For ease of understanding, an embodiment of the present invention provides a specific implementation of an AI detection method for illegal occupation of an emergency lane based on a drone.
[0067] For the aforementioned step S104, the embodiment of the present invention provides a multi-task detection model, see Figure 2 The figure shows a framework diagram of a multi-task detection model. The multi-task detection model inputs an inspection image once and outputs a vehicle detection result and an emergency lane segmentation result. The bounding box in the vehicle detection result is the vehicle bounding box, and the area covered by the diagonal line in the emergency lane segmentation result is the area where the emergency lane is located.
[0068] In one embodiment, the multi-task detection model includes an encoder and a decoder, and the encoder includes a feature extraction network, a vehicle detection network, and a lane segmentation network. On this basis, the vehicle detection result and the emergency lane segmentation result can be determined according to the following steps 1 to 3:
[0069] Step 1: extract multi-scale initial feature information of the inspection image through a feature extraction network; wherein the feature extraction network includes multiple feature extraction sub-networks.
[0070] In one example, the feature extraction network is a shared Backbone network, which consists of a series of convolutional layers specifically designed to extract features from input data. Given YOLOv8's outstanding performance in detection tasks, the Backbone network follows YOLOv8.
[0071] See also Figure 3 The specific structural diagram of a multi-task detection model shown in FIG. 1 is a schematic diagram of a multi-task detection model. The main difference of the Backbone network provided by the embodiment of the present invention is that the c2f unit is used instead of the c3 unit. Figure 3 The specific structure of the c2f unit is also shown, which includes a CBS layer, a Split layer, n Bottleneck layers, a Concat layer, and another CBS layer. The c2f unit combines high-level features with contextual information to further improve performance.
[0072] Step 2: Through the vehicle detection network, the multi-scale initial feature information is fused to obtain vehicle feature information; and through the lane segmentation network, the multi-scale initial feature information is fused to obtain lane feature information.
[0073] In one embodiment, both the vehicle detection network and the lane segmentation network are Neck networks. The Neck network is responsible for fusing features extracted from the Backbone network. The embodiment of the present invention uses two Neck networks: one for vehicle detection tasks and the other for emergency lane segmentation tasks.
[0074] For the vehicle detection network, a PAN structure is adopted, including two FPNs, top-down and bottom-up. This structure merges low-level detail features with high-level semantic features to enrich the overall feature representation. This is very important for object detection, because small objects rely on low-level detail features, while larger entities benefit from the broader context provided by high-level semantic features. In detection tasks, objects of different scales usually appear. This diversity of object sizes is the main reason for choosing the PAN structure as the detection neck.
[0075] For the lane segmentation network, the FPN structure is adopted, which is well-known for effectively processing multi-scale targets. For details, please refer to the above explanation of the FPN structure, which will not be described in detail in the embodiment of the present invention.
[0076] In addition, a hybrid attention unit (MA) is introduced between the Neck network and the Backbone network. The hybrid attention unit operates on each of the same resolutions. This addition enhances the universality of the multi-task detection model, making it applicable to various segmentation tasks.
[0077] The vehicle detection network is explained. The vehicle detection network includes multiple vehicle detection subnetworks. The vehicle detection subnetworks correspond to each feature extraction subnetwork one by one. A first hybrid attention module (MA) is introduced between the vehicle detection subnetwork and the feature extraction subnetwork. On this basis, when performing the task of vehicle detection, the first hybrid attention module (MA) is first used to perform feature fusion based on the initial feature information output by the feature extraction subnetwork corresponding to the current vehicle detection network and the initial feature information output by the feature extraction subnetwork corresponding to the previous vehicle detection subnetwork to obtain the target fused feature information; then, the vehicle detection subnetwork is used to determine the vehicle feature information output by the current vehicle detection subnetwork based on the target fused feature information output by the first hybrid attention unit (MA) and the vehicle feature information output by the previous vehicle detection subnetwork.
[0078] Please continue to see Figure 3 For each vehicle detection subnetwork, the initial feature information output by the corresponding feature extraction subnetwork is processed by the c2f unit and input into the first hybrid attention unit (MA); and the initial feature information output by the feature extraction subnetwork corresponding to the previous vehicle detection subnetwork is processed by the upsampling unit and input into the first hybrid attention unit (MA); the first hybrid attention unit (MA) performs feature fusion on the two input features to obtain target fused feature information; the target fused feature information output by the first hybrid attention unit (MA) and the feature information output by the previous vehicle detection subnetwork are input into the vehicle detection subnetwork to obtain the vehicle feature information output by the vehicle detection subnetwork; the vehicle feature information output by the last vehicle detection subnetwork is used as the final vehicle feature information.
[0079] The lane segmentation network is explained. The lane segmentation network includes multiple lane segmentation subnetworks. The lane segmentation subnetworks correspond to multiple specified feature extraction subnetworks one by one. A second hybrid attention module (MA) is introduced between the lane segmentation subnetwork and the feature extraction subnetwork. On this basis, when performing the lane segmentation task, the second hybrid attention module (MA) is first used to perform feature fusion based on the initial feature information output by the feature extraction subnetwork corresponding to the current lane segmentation network and the initial feature information output by the feature extraction subnetwork corresponding to the next vehicle detection subnetwork to obtain the target fused feature information; then, the lane segmentation subnetwork is used to determine the lane feature information output by the current lane segmentation subnetwork based on the target fused feature information output by the second hybrid attention module (MA) and the lane feature information output by the previous lane segmentation subnetwork.
[0080] Please continue to see Figure 3In order from top to bottom, the input of the first second hybrid attention module (MA) includes the initial feature information output by the first feature extraction subnetwork and the features processed by the feature information output by the second feature extraction subnetwork; the input of the second second hybrid attention module (MA) includes the features processed by the feature information output by the second feature extraction subnetwork and the features processed by the feature information output by the third feature extraction subnetwork. For details, please refer to Figure 3 , the embodiments of the present invention will not be described in detail.
[0081] Furthermore, both the first hybrid attention unit and the second hybrid attention unit are used to enhance small target recognition, and both the first hybrid attention unit and the second hybrid attention unit include a first attention subunit (also referred to as a spatial attention subunit) and a second attention subunit (also referred to as a channel attention subunit). The first attention subunit is used to perform spatial attention processing on two input feature information; the second attention subunit is used to perform channel attention processing on two input feature information.
[0082] After obtaining the feature map from Backone, one of the core points of the embodiment of the present invention is to use the hybrid attention unit block to process the extracted features. Figure 4 The structure diagram of a hybrid attention unit shown in FIG. 4 includes a spatial attention subunit and a channel attention subunit. The spatial attention subunit aims to incorporate more extensive contextual information into local features and enhance their representation capabilities. On the other hand, the channel attention subunit exploits the interdependence between channel maps, highlights the interdependence of feature maps, and enhances the representation of specific semantics. The outputs of the two attention subunits are transformed through convolutional layers, and feature fusion is achieved using element-wise addition operations.
[0083] Please continue to see Figure 4 Taking the first hybrid attention unit as an example, X and Y are the features processed by the c2f unit and the features processed by the upsampling unit respectively. The spatial attention subunit extracts the maximum feature MAX_X and the average feature MEAN_X of X, and extracts the maximum feature MAX_Y and the average feature MEAN_X of Y, and then outputs the first fused feature information after processing by the CONCAT layer, the convolution layer (Conv) and the activation function layer (ReLU); similarly, the spatial attention subunit outputs the second fused feature information, and the first fused feature information and the second fused feature information are element-wise added to realize feature fusion, and the target fused feature information is obtained.
[0084] Step 3: Determine the vehicle detection result based on the vehicle feature information and the emergency lane segmentation result based on the lane feature information through the decoder.
[0085] The decoder processes the feature maps from Neck and makes predictions for each task. This includes predicting object categories, their corresponding bounding boxes, and masks for specific segmentation objects.
[0086] The embodiment of the present invention adopts two different heads: detection head and segmentation head. Among them, the detection head adopts a separation method, following the YOLOv8 Detect Head, using convolutional layers to convert high-dimensional features into category predictions and bounding boxes.
[0087] After decoding, a detection image (i.e., vehicle detection result) and a segmentation image (i.e., lane segmentation result) are returned for emergency lane area and vehicle detection tasks. The feature extraction capability of the model is enhanced by utilizing the Backone network and the feature analysis block mixed attention unit. In addition, the simple decoder block helps to reduce the computational cost and improve the efficiency of the model.
[0088] Furthermore, an embodiment of the present invention also provides a loss function used by a multi-task detection model, wherein the detection task uses two loss functions: Focal Loss and Tversky Loss, and the segmentation task uses IOU loss. The sum of the three loss values is taken as the final loss value to train the multi-task detection model.
[0089] In one example, the goal of Focal Loss is to reduce the classification error between pixels and address the impact of easy-to-predict samples and severely penalize difficult-to-predict samples, as shown below:
[0090]
[0091] Where the symbols mean the following: N: the number of pixels in the input image; C: the number of classes, in this case one class represents the drivable area or lane and the rest represent the background; Pi(c): the predicted value used to determine which class the pixel belongs to; The true value of the pixel in the category (i.e., the label corresponding to the GT); γ: balance correction factor.
[0092] In another example, Tversky Loss was inspired by Dice Loss and solved the class imbalance problem in segmentation tasks. However, unlike Dice Loss, Tversky Loss introduces α and β parameters to adjust the importance of false positives and false negatives in the calculation process, as shown in the Tversky equation below:
[0093]
[0094] Among them, TP: True Positives, for example, the predicted category is vehicle and the true value is vehicle; FN: False Negatives, for example, the predicted category is vehicle and the true value is not vehicle; FP: False Positives, for example, the predicted category is not vehicle and the true value is vehicle; C: the number of categories, in this case, one category represents the drivable area or lane, and the remaining categories represent the background; α, β: control the degree of penalty for false positives and false negatives.
[0095] After the vehicle detection results and emergency lane segmentation results are determined by the multi-task detection model, the position of each vehicle detected can be compared to see if it is within the emergency lane. If so, it is determined that there is a vehicle in the emergency lane, so as to control the drone's camera to collect corresponding vehicle images for the vehicle.
[0096] For the aforementioned step S108, an embodiment of the present invention further provides an implementation method of performing an illegal occupation detection task on a vehicle based on a vehicle image to obtain an illegal occupation detection result, and / or performing a license plate recognition task on a vehicle to obtain a license plate recognition result. The illegal occupation detection task can be first performed on the vehicle based on the vehicle image to obtain an illegal occupation detection result; when the illegal occupation detection result indicates that the vehicle illegally occupies the emergency lane, the license plate recognition task is performed on the vehicle based on the vehicle image information to obtain a license plate recognition result; if the vehicle does not illegally occupy the emergency lane, there is no need to further identify the license plate number of the vehicle.
[0097] Furthermore, the illegal occupation detection result includes the taillight change and / or facility detection result. The embodiment of the present invention also provides an implementation method for performing the illegal occupation detection task, see (1) to (2) below:
[0098] (1) Segment and identify the taillight area of the vehicle from the vehicle image, and detect the color change of the taillight area according to the preset frequency to obtain the taillight change situation. Specifically, first use the HSV color space segmentation to identify the taillights on both sides of the rear of the vehicle; if the taillights are yellow, then detect the on and off status of the lights here at the next one or two moments at the set frequency. If the taillights on both sides of the rear of the vehicle are detected for the first time, then detect again at this frequency. If not detected, you can use several more frequencies to detect whether the yellow light is on to obtain the taillight change situation, which is used to indicate whether the taillights of the vehicle are performing double flashing action.
[0099] (2) Through the pre-trained facility detection model, based on the vehicle image, detect whether there are designated facilities within the vehicle area and obtain the facility detection results. Specifically, the facilities refer to tripods and cones. The tripod and cone recognition are trained and recognized using the yolov8 network. The network architecture of yolov8 is consistent with the Backone network used in the steps, and will not be repeated here. The only difference is that the output is the detection result without the segmentation result, and there is no mixed attention unit, which is replaced by the concat module.
[0100] Furthermore, the embodiment of the present invention also provides an implementation method of a license plate recognition task, see (a) to (c) below:
[0101] (a) Identify and crop the vehicle bounding box (i.e., bbox area) in the vehicle image information.
[0102] (b) The license plate position information is detected based on the license plate bounding box through the pre-trained license plate detection model. In one example, the pre-processed vehicle bounding box is input into the license plate detection model. The license plate detection model is similar to the multi-task detection model. It is applicable to the yolov5 network. The backbone network is changed from the Backbone network to the ShuffleNet network. The bbox and four key points are predicted at the same time. The key points are also the four corner points of the license plate, so as to obtain the license plate position information. Specifically, the network structure of the license plate detection model is shown in the following table:
[0103] Type Configurations Transcription - Bidirectional-LSTM #hidden untis:256 Bidirectional-LSTM #hidden untis:256 Map-to Sequence - Convliution #maps:512,k:2x 2,s:1,p:0 MaxPooling Window:1x 2,s:2 BatchNormalization - Convolution #maps:512,k:3x 3,s:1,p:1 BatchNormalization - Convolution #maps:512,k:3x 3,s:1,p:1 MaxPooling Window:1x 2,s:2 Convolution #maps:256,k:3x 3,s:1,p:1 Convolution #maps:256,k:3x 3,s:1,p:1 MaxPooling Window:2x 2,s:2 Convolution #maps:128,k:3x 3,s:1,p:1 MaxPooling Window:2x 2,s:2 Convolution #maps:64,k:3x 3,s:l,p:1 Input Wx 32 gray-scale image
[0104] (c) Determine the license plate recognition result corresponding to the vehicle based on the license plate position information. In one example, the license plate character recognition uses the network: CRNN+CTC, character category (78): Character category: #Beijing Shanghai Tianjin Chongqing Hebei Shanxi Mongolia Liaoning Jilin Heilongjiang Jiangsu Zhejiang Anhui Fujian Jiangxi Shandong Henan Hunan Guangdong Guangxi Qiongchuan Guizhou Yunzang Shaanxi Gansu Qinghai Ningxin Xuejing Hong Kong Macao Hanging Mission Civil Aviation Dangerous Goods 0123456789ABCDEFGHJKLMNPORSTUVWXYZ Dangerous Goods. In the case of vehicles illegally occupying the emergency lane, the final output result is as follows: Figure 5 As shown, Figure 5 is a schematic diagram of a license plate recognition result; in the case where there is no vehicle illegally occupying the emergency lane, the final output result is as follows Figure 6 As shown, Figure 6 A schematic diagram of an inspection output result.
[0105] For further information, see Figure 7 The overall flow chart of an AI detection method for illegal occupation of emergency lanes based on drones shown in FIG. 1 includes the following steps S702 to S720:
[0106] Step S702, cruising at a small focal length according to a predetermined route, and tilting the camera at a certain angle to facilitate photographing the license plate;
[0107] Step S704, based on improved YOLOV8+OCSORT vehicle detection + tracking, that is, vehicle detection and lane segmentation are performed through a multi-task detection model, and vehicle tracking is performed using OCSORT;
[0108] Step S706, determining whether the vehicle is in the emergency lane; if yes, executing step S708; if no, executing step S702;
[0109] Step S708, switching to a large focal length so that the vehicle occupies at least 1 / 5 of the screen and the license plate can be photographed;
[0110] Step S710, detecting whether the front or rear of the vehicle has double flashes; if yes, executing step S712; if no, executing step S716;
[0111] Step S712, tripod / cone barrel identification;
[0112] Step S714, whether there is a tripod or a cone barrel; if yes, it is legal; if not, go to step S716;
[0113] Step S716, illegal occupation;
[0114] Step S718, license plate recognition based on CRNN+CTC;
[0115] Step S720, the license plate is recognized; if so, an illegal recognition result is reported and the process ends; if not, a photo is taken to report the license plate being blocked or other situations.
[0116] In summary, the embodiments of the present invention have at least the following features:
[0117] (I) Based on a new multi-task detection algorithm on drones for emergency lane segmentation and vehicle detection, it can achieve one-time input and one-time reasoning to obtain detection and segmentation results, thereby greatly reducing the amount of calculation and saving computing resources;
[0118] (ii) Based on a lightweight algorithm architecture, a hybrid attention module is proposed to enhance model performance, which can greatly enhance the detection capability of small objects while ensuring real-time detection results;
[0119] (III) In the process of practice, a process method for controlling the pod according to the test results was proposed, which effectively improved the inconvenience caused by manual control.
[0120] Based on the above embodiments, the present invention provides an AI detection device for illegal occupation of emergency lanes based on drones, see Figure 8 The structure diagram of an AI detection device for illegal occupation of emergency lanes based on drones is shown in FIG. The device mainly includes the following parts:
[0121] The first control module 802 is used to control the drone to inspect the target road along a preset route, and control the drone to collect an inspection image corresponding to the target road at a first focal length; wherein the inspection image displays content including the target road and vehicles traveling on the target road;
[0122] The multi-task detection module 804 is used to perform vehicle detection tasks and lane segmentation tasks on the inspection image through a pre-trained multi-task detection model to obtain vehicle detection results and emergency lane segmentation results to determine whether there is a vehicle located in the emergency lane of the target road;
[0123] The second control module 806 is used to control the drone to collect a vehicle image corresponding to the vehicle at a second focal length when the judgment result of the multi-task detection module is yes; wherein the second focal length is greater than the first focal length;
[0124] The illegal occupation detection and license plate recognition module 808 is used to perform an illegal occupation detection task on the vehicle based on the vehicle image to obtain an illegal occupation detection result, and / or to perform a license plate recognition task on the vehicle to obtain a license plate recognition result.
[0125] The AI detection device for illegal occupation of emergency lanes based on drones provided in the embodiment of the present invention proposes a multi-task detection model by improving the network structure, so that the vehicle detection results and the emergency lane segmentation results can be obtained simultaneously by inputting a patrol image once, so as to determine the illegal occupation detection results and / or license plate recognition results on this basis. The embodiment of the present invention can accurately detect the situation of vehicles illegally occupying emergency lanes, and greatly reduce the amount of calculation required for detecting illegal occupation of emergency lanes, which helps to reduce hardware requirements and detection costs; in addition, the embodiment of the present invention can also automatically control the pod when the vehicle is located in the emergency lane of the target road, that is, automatically switch the focal length of the drone to collect images, effectively improving the inconvenience caused by manual control.
[0126] In one embodiment, the multi-task detection model includes an encoder and a decoder, the encoder includes a feature extraction network, a vehicle detection network and a lane segmentation network; the multi-task detection module 804 is also used to:
[0127] Extracting multi-scale initial feature information of the inspection image through a feature extraction network; wherein the feature extraction network includes multiple feature extraction sub-networks;
[0128] The vehicle detection network is used to fuse the initial feature information of multiple sizes to obtain the vehicle feature information; and the lane segmentation network is used to fuse the initial feature information of multiple sizes to obtain the lane feature information;
[0129] Through the decoder, a vehicle detection result is determined based on the vehicle feature information, and an emergency lane segmentation result is determined based on the lane feature information.
[0130] In one embodiment, the vehicle detection network includes multiple vehicle detection sub-networks, each of which corresponds to each feature extraction sub-network. A first hybrid attention module is introduced between the vehicle detection sub-network and the feature extraction sub-network. The multi-task detection module 804 is also used to:
[0131] Through the first hybrid attention module, feature fusion is performed based on the initial feature information output by the feature extraction subnetwork corresponding to the current vehicle detection network and the initial feature information output by the feature extraction subnetwork corresponding to the previous vehicle detection subnetwork to obtain target fused feature information;
[0132] Through the vehicle detection subnetwork, the vehicle feature information output by the current vehicle detection subnetwork is determined based on the target fused feature information output by the first hybrid attention unit and the vehicle feature information output by the previous vehicle detection subnetwork.
[0133] In one embodiment, the lane segmentation network includes multiple lane segmentation sub-networks, the lane segmentation sub-networks correspond one-to-one to the specified multiple feature extraction sub-networks, and a second hybrid attention module is introduced between the lane segmentation sub-network and the feature extraction sub-network; the multi-task detection module 804 is also used for:
[0134] Through the second hybrid attention module, feature fusion is performed based on the initial feature information output by the feature extraction subnetwork corresponding to the current lane segmentation network and the initial feature information output by the feature extraction subnetwork corresponding to the next vehicle detection subnetwork to obtain the target fused feature information;
[0135] Through the lane segmentation subnetwork, the lane feature information output by the current lane segmentation subnetwork is determined based on the target fused feature information output by the second hybrid attention module and the lane feature information output by the previous lane segmentation subnetwork.
[0136] In one embodiment, the first hybrid attention unit and the second hybrid attention unit each include a first attention sub-unit and a second attention sub-unit;
[0137] The first attention subunit is used to perform spatial attention processing on the two feature information of the input; the second attention subunit is used to perform channel attention processing on the two feature information of the input.
[0138] In one embodiment, the illegal occupation detection and license plate recognition module 808 is also used to:
[0139] Based on the vehicle image, the illegal occupation detection task is performed on the vehicle to obtain the illegal occupation detection result;
[0140] In the case where the illegal occupation detection result indicates that the vehicle illegally occupies the emergency lane, a license plate recognition task is performed on the vehicle based on the vehicle image information to obtain a license plate recognition result.
[0141] In one embodiment, the illegal occupation detection and license plate recognition module 808 is also used to:
[0142] Segment and identify the taillight area of the vehicle from the vehicle image, and detect the color change of the taillight area according to a preset frequency to obtain the taillight change situation;
[0143] And, through the pre-trained facility detection model, whether the designated facilities are placed within the vehicle area is detected based on the vehicle image to obtain the facility detection result;
[0144] Illegal occupancy detection results include taillight changes and / or facility detection results.
[0145] In one embodiment, the illegal occupation detection and license plate recognition module 808 is also used to:
[0146] Identify and crop a vehicle bounding box in the vehicle image information;
[0147] The license plate location information is detected based on the license plate bounding box through the pre-trained license plate detection model;
[0148] The license plate recognition result corresponding to the vehicle is determined based on the license plate position information. The device provided in the embodiment of the present invention has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brief description, for any part not mentioned in the device embodiment, reference can be made to the corresponding content in the aforementioned method embodiment.
[0149] An embodiment of the present invention provides an electronic device. Specifically, the electronic device includes a processor and a storage device. The storage device stores a computer program, and when the computer program is executed by the processor, it executes any one of the methods in the above implementation manners.
[0150] Fig. 9 A structural diagram of an electronic device provided in an embodiment of the present invention, the electronic device 100 includes: a processor 90, a memory 91, a bus 92 and a communication interface 93, wherein the processor 90, the communication interface 93 and the memory 91 are connected via the bus 92; the processor 90 is used to execute an executable module stored in the memory 91, such as a computer program.
[0151] The memory 91 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 93 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0152] The bus 92 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0153] Among them, the memory 91 is used to store programs, and the processor 90 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiments of the present invention can be applied to the processor 90 or implemented by the processor 90.
[0154] The processor 90 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 90. The above processor 90 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 91, and the processor 90 reads the information in the memory 91 and completes the steps of the above method in combination with its hardware.
[0155] The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be referred to the previous method embodiments, which will not be repeated here.
[0156] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0157] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. An AI detection method for illegal occupation of emergency lanes based on drones, characterized in that: include: Controlling a drone to inspect a target road along a preset route, and controlling the drone to collect an inspection image corresponding to the target road at a first focal length; wherein the inspection image displays content including the target road and vehicles traveling on the target road; By using a pre-trained multi-task detection model, a vehicle detection task and a lane segmentation task are performed on the inspection image to obtain a vehicle detection result and an emergency lane segmentation result to determine whether there is a vehicle located in the emergency lane of the target road; If yes, controlling the drone to collect a vehicle image corresponding to the vehicle at a second focal length; wherein the second focal length is greater than the first focal length; Based on the vehicle image, performing an illegal occupation detection task on the vehicle to obtain an illegal occupation detection result, and / or performing a license plate recognition task on the vehicle to obtain a license plate recognition result; The multi-task detection model includes an encoder and a decoder, the encoder includes a feature extraction network, a vehicle detection network and a lane segmentation network; the feature extraction network is a shared Backbone network, the Backbone network uses a c2f unit instead of a c3 unit, and the c2f unit includes a CBS layer, a Split layer, n Bottleneck layers, a connection layer and another CBS layer; the feature extraction network includes a plurality of feature extraction subnetworks; the vehicle detection network includes a plurality of vehicle detection subnetworks, the vehicle detection subnetwork corresponds one-to-one to each of the feature extraction subnetworks, and a first hybrid attention module is introduced between the vehicle detection subnetwork and the feature extraction subnetwork; the lane segmentation network includes a plurality of lane segmentation subnetworks, the lane segmentation subnetwork corresponds one-to-one to a plurality of specified feature extraction subnetworks, and a second hybrid attention module is introduced between the lane segmentation subnetwork and the feature extraction subnetwork; The steps of performing a vehicle detection task and a lane segmentation task on the inspection image through a pre-trained multi-task detection model to obtain a vehicle detection result and an emergency lane segmentation result include: extracting multi-scale initial feature information of the inspection image through the feature extraction network; fusing the multi-scale initial feature information through the vehicle detection network to obtain vehicle feature information; and fusing the multi-scale initial feature information through the lane segmentation network to obtain lane feature information; determining a vehicle detection result based on the vehicle feature information through the decoder, and determining an emergency lane segmentation result based on the lane feature information; The step of fusing the initial feature information of multiple sizes to obtain vehicle feature information through the vehicle detection network includes: performing feature fusion based on the initial feature information output by the feature extraction subnetwork corresponding to the current vehicle detection network and the initial feature information output by the feature extraction subnetwork corresponding to the previous vehicle detection subnetwork through the first hybrid attention module to obtain target fused feature information; determining the vehicle feature information output by the current vehicle detection subnetwork based on the target fused feature information output by the first hybrid attention module and the vehicle feature information output by the previous vehicle detection subnetwork through the vehicle detection subnetwork; The step of fusing the initial feature information of multiple sizes to obtain lane feature information through the lane segmentation network includes: performing feature fusion based on the initial feature information output by the feature extraction subnetwork corresponding to the current lane segmentation network and the initial feature information output by the feature extraction subnetwork corresponding to the next vehicle detection subnetwork through the second hybrid attention module to obtain target fused feature information; determining the lane feature information output by the current lane segmentation subnetwork based on the target fused feature information output by the second hybrid attention module and the lane feature information output by the previous lane segmentation subnetwork through the lane segmentation subnetwork; The first hybrid attention module and the second hybrid attention module both include a first attention sub-unit and a second attention sub-unit; the first attention sub-unit is used to perform spatial attention processing on the two input feature information; the second attention sub-unit is used to perform channel attention processing on the two input feature information.
2. The AI detection method for illegal occupation of emergency lanes based on drones according to claim 1 is characterized in that: Based on the vehicle image, the steps of performing an illegal occupation detection task on the vehicle to obtain an illegal occupation detection result, and / or performing a license plate recognition task on the vehicle to obtain a license plate recognition result include: Based on the vehicle image, performing an illegal occupation detection task on the vehicle to obtain an illegal occupation detection result; In a case where the illegal occupation detection result indicates that the vehicle illegally occupies the emergency lane, a license plate recognition task is performed on the vehicle based on the vehicle image information to obtain a license plate recognition result.
3. The AI detection method for illegal occupation of emergency lanes based on drones according to claim 1 or 2 is characterized in that: Based on the vehicle image, the step of performing an illegal occupation detection task on the vehicle to obtain an illegal occupation detection result includes: Segmenting and identifying the taillight area of the vehicle from the vehicle image, and detecting the color change of the taillight area at a preset frequency to obtain the taillight change situation; And, using a pre-trained facility detection model, based on the vehicle image, detecting whether a designated facility is placed within the vehicle area, and obtaining a facility detection result; The illegal occupation detection result includes the tail light change and / or facility detection result.
4. The AI detection method for illegal occupation of emergency lanes based on drones according to claim 1 or 3 is characterized in that: The step of performing a license plate recognition task on the vehicle based on the vehicle image information to obtain a license plate recognition result includes: Identifying and cropping a vehicle bounding box in the vehicle image information; Detecting license plate position information based on the license plate bounding box using a pre-trained license plate detection model; A license plate recognition result corresponding to the vehicle is determined based on the license plate position information.
5. An AI detection device for illegal occupation of emergency lanes based on drones, characterized in that: include: A first control module is used to control the drone to inspect the target road along a preset route, and control the drone to collect an inspection image corresponding to the target road at a first focal length; wherein the inspection image displays content including the target road and vehicles traveling on the target road; A multi-task detection module is used to perform a vehicle detection task and a lane segmentation task on the inspection image through a pre-trained multi-task detection model to obtain a vehicle detection result and an emergency lane segmentation result to determine whether there is a vehicle located in the emergency lane of the target road; A second control module, configured to control the drone to collect a vehicle image corresponding to the vehicle at a second focal length when the judgment result of the multi-task detection module is yes; wherein the second focal length is greater than the first focal length; An illegal occupation detection and license plate recognition module, for performing an illegal occupation detection task on the vehicle based on the vehicle image to obtain an illegal occupation detection result, and / or performing a license plate recognition task on the vehicle to obtain a license plate recognition result; The multi-task detection model includes an encoder and a decoder, wherein the encoder includes a feature extraction network, a vehicle detection network and a lane segmentation network; the feature extraction network is a shared Backbone network, wherein the Backbone network uses a c2f unit instead of a c3 unit, wherein the c2f unit includes a CBS layer, a Split layer, n Bottleneck layers, a connection layer and another CBS layer; the feature extraction network includes a plurality of feature extraction subnetworks; the vehicle detection network includes a plurality of vehicle detection subnetworks, wherein the vehicle detection subnetwork corresponds one-to-one to each of the feature extraction subnetworks, and a first hybrid attention module is introduced between the vehicle detection subnetwork and the feature extraction subnetwork; the lane segmentation network includes a plurality of lane segmentation subnetworks, wherein the lane segmentation subnetwork corresponds one-to-one to a plurality of specified feature extraction subnetworks, and a second hybrid attention module is introduced between the lane segmentation subnetwork and the feature extraction subnetwork; The multi-task detection module is also used to: extract multi-scale initial feature information of the inspection image through the feature extraction network; fuse the multi-scale initial feature information to obtain vehicle feature information through the vehicle detection network; and fuse the multi-scale initial feature information to obtain lane feature information through the lane segmentation network; determine the vehicle detection result based on the vehicle feature information through the decoder, and determine the emergency lane segmentation result based on the lane feature information; The multi-task detection module is also used to: perform feature fusion based on the initial feature information output by the feature extraction subnetwork corresponding to the current vehicle detection network and the initial feature information output by the feature extraction subnetwork corresponding to the previous vehicle detection subnetwork through the first hybrid attention module to obtain target fused feature information; determine the vehicle feature information output by the current vehicle detection subnetwork through the vehicle detection subnetwork based on the target fused feature information output by the first hybrid attention module and the vehicle feature information output by the previous vehicle detection subnetwork; The multi-task detection module is also used to: perform feature fusion based on the initial feature information output by the feature extraction subnetwork corresponding to the current lane segmentation network and the initial feature information output by the feature extraction subnetwork corresponding to the next vehicle detection subnetwork through the second hybrid attention module to obtain target fused feature information; determine the lane feature information output by the current lane segmentation subnetwork through the lane segmentation subnetwork based on the target fused feature information output by the second hybrid attention module and the lane feature information output by the previous lane segmentation subnetwork; The first hybrid attention module and the second hybrid attention module both include a first attention sub-unit and a second attention sub-unit; the first attention sub-unit is used to perform spatial attention processing on the two input feature information; the second attention sub-unit is used to perform channel attention processing on the two input feature information.
6. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 4.
