Expressway secondary traffic accident avoidance method and system

By installing pressure sensors, positioning equipment, cameras and early warning devices in vehicles driving on highways, using on-board processors to collect and analyze data, automatically judge and issue early warning reminders, the signal interference in the existing system and the system not installed is solved The problem that vehicles cannot receive early warnings and drivers do not pay attention to in time has been achieved, which has achieved effective early warning and avoidance of second car accidents.

CN119479274APending Publication Date: 2025-02-18GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411520669.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing highway accident warning system has problems such as signal interference, vehicles that have not installed the system cannot receive early warnings, and drivers do not pay attention in time, resulting in the increase in secondary car accidents.

Method used

By installing pressure sensors, positioning equipment, cameras and early warning devices in the vehicle, using the on-board processor for data collection and analysis, we can determine whether the vehicle is hit or whether a car accident occurs in front of us, and automatically issue an early warning reminder when the conditions are met.

Benefits of technology

Based on the vehicle's stress situation and the results of the vehicle's accident detection, it has automatically issued a warning reminder in a timely manner to avoid the occurrence of a second car accident and ensure the safety of personnel. The system has strong anti-interference, and each vehicle operates independently, so early warning can be completed without communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119479274A_ABST
    Figure CN119479274A_ABST
Patent Text Reader

Abstract

The invention provides a highway secondary traffic accident avoidance method and system, and relates to the technical field of traffic accident prevention. The method comprises the steps of collecting pressure data of a vehicle through a pressure sensor of the vehicle, judging whether the vehicle is collided or not according to the pressure data, if yes, giving out early warning reminding, if not, collecting positioning information of the vehicle through positioning equipment of the vehicle, judging whether the positioning information meets set conditions or not, and if yes, giving out early warning reminding. The on-site video of the current road section is collected through a camera of a vehicle, the on-site video is detected through a traffic accident detection algorithm, a traffic accident result is obtained, and if the traffic accident result is that a traffic accident occurs, an early warning prompt is given out. The pressure data and the image data collected by the equipment on the vehicle are analyzed respectively, early warning reminding is carried out, the anti-interference performance is high, the vehicles can be kept independent from one another, and early warning can be carried out without communication with other vehicles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention mainly relates to the technical field of traffic accident prevention, and in particular to a method and system for avoiding secondary traffic accidents on highways. Background Art

[0002] Expressways are a vital part of modern transportation networks. However, emergencies caused by high vehicle speeds, dense traffic, human or natural factors are common on expressways. As vehicles travel very fast on expressways, if an accident occurs in front and the vehicles behind are not notified in time, it is very likely to cause a secondary accident, increasing casualties and property losses.

[0003] Existing warning schemes are divided into two categories: warning measures fixed on the roadside and vehicle-mounted warning systems. However, warning measures fixed on the roadside need to cover the entire highway or accident-prone sections, resulting in high costs. Vehicle-mounted warning systems usually need to send warning signals to other vehicles to remind car owners, but there are often some problems, including: when the signal is interfered, other vehicles cannot receive the signal, vehicles without the corresponding warning system cannot receive the warning signal, and drivers fail to pay attention to the warning signal in time. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method and system for avoiding secondary traffic accidents on highways in view of the deficiencies of the prior art.

[0005] The technical solution of the present invention to solve the above technical problems is as follows:

[0006] A method for avoiding secondary traffic accidents on a highway comprises the following steps:

[0007] The pressure data of the vehicle is collected by a pressure sensor installed in the vehicle, and whether the vehicle is hit is determined according to the pressure data. If hit, the vehicle is controlled to send an early warning to the outside;

[0008] If there is no collision, the positioning information of the vehicle is collected through the positioning device of the vehicle to determine whether the positioning information meets the set conditions. If so, the on-site video of the current road section is collected through the camera of the vehicle, and the on-site video is detected by the traffic accident detection algorithm to obtain the result of the traffic accident;

[0009] If the result of the traffic accident is a traffic accident, the vehicle is controlled to issue an early warning reminder to the outside.

[0010] Another technical solution of the present invention to solve the above technical problems is as follows:

[0011] A highway secondary traffic accident avoidance system, comprising: an on-vehicle processor, a pressure sensor, a positioning device, a camera and a warning device;

[0012] Respectively connecting the pressure sensor, the positioning device, the camera, and the warning device to the vehicle-mounted processor, wherein the vehicle-mounted processor includes a pressure warning unit, an image analysis unit, and an image warning unit;

[0013] The pressure warning unit is used to collect pressure data of the vehicle through a pressure sensor installed on the vehicle, and determine whether the vehicle is hit according to the pressure data. If the vehicle is hit, the warning device is controlled to issue a warning reminder;

[0014] The image analysis unit is used to collect the positioning information of the vehicle through the positioning device of the vehicle if there is no collision, and determine whether the positioning information meets the set conditions. If so, collect the on-site video of the current road section through the camera of the vehicle, and detect the on-site video through the traffic accident detection algorithm to obtain the result of the traffic accident;

[0015] The image warning unit is used to control the warning device to issue a warning reminder if the traffic accident result is a traffic accident.

[0016] The beneficial effects of the present invention are: by using the pressure sensor to analyze the impact situation from the force level of the vehicle, timely warning reminders are given to avoid secondary traffic accidents caused by the rear vehicle. In addition, by collecting the on-site video of the stationary section of the vehicle, the video is detected frame by frame through the traffic accident detection algorithm of image analysis to determine whether a traffic accident has occurred in front of the vehicle, so as to give warnings for secondary traffic accidents and ensure the safety of personnel. The present invention has strong anti-interference ability, each vehicle is independent of each other, and warnings to other vehicles can be completed without communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A flowchart of a method for avoiding secondary traffic accidents on highways provided by an embodiment of the present invention;

[0018] Figure 2 A structural diagram of a method for avoiding secondary traffic accidents on highways provided by an embodiment of the present invention;

[0019] Figure 3 A schematic diagram of the structure of a flexible sensor provided by an embodiment of the present invention;

[0020] Figure 4 A schematic diagram of a detection process of a traffic accident detection algorithm provided by an embodiment of the present invention;

[0021] Figure 5 A module block diagram of a highway secondary traffic accident avoidance system provided by an embodiment of the present invention;

[0022] Figure 6 A schematic diagram of warning processing by a warning device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0024] like Figure 1 and Figure 2 As shown, a method for avoiding secondary traffic accidents on highways provided by an embodiment of the present invention includes the following steps:

[0025] The pressure data of the vehicle is collected by a pressure sensor installed in the vehicle, and whether the vehicle is hit is determined according to the pressure data. If hit, the vehicle is controlled to send an early warning to the outside;

[0026] If there is no collision, the positioning information of the vehicle is collected through the positioning device of the vehicle to determine whether the positioning information meets the set conditions. If so, the on-site video of the current road section is collected through the camera of the vehicle, and the on-site video is detected by the traffic accident detection algorithm to obtain the result of the traffic accident;

[0027] If the result of the traffic accident is a traffic accident, the vehicle is controlled to issue an early warning reminder to the outside.

[0028] Specifically, the processing algorithms for pressure data, positioning information, on-site video and control of early warning devices can be integrated into the vehicle processor. The vehicle's current positioning information (such as position and speed information) is obtained through the GPS positioning module, and the vehicle processor determines whether the vehicle is in an abnormal state based on the vehicle position and speed information obtained by the GPS module. The pressure sensor is used to detect the current force condition of the vehicle, and the vehicle processor determines whether the vehicle has been hit based on the information from the pressure sensor. The vehicle camera is used to capture the conditions around the vehicle, and the vehicle processor determines whether a traffic accident has occurred ahead based on the information captured by the vehicle camera. The early warning device is used to alert the rear vehicle to let the rear vehicle know that a traffic accident has occurred ahead. After the vehicle processor determines that a traffic accident has occurred based on the vehicle camera or pressure sensor, it controls the early warning device to issue an early warning.

[0029] If the pressure data indicates that the vehicle has been hit, the warning device will be turned on directly to issue a warning. If the vehicle has not been hit and the accident detection algorithm detects that an accident has occurred, the driver will be reminded to turn on the warning device. If the driver does not respond within a period of time, the warning device will be automatically turned on; if the driver chooses to refuse, the warning device will be canceled. To avoid the situation where the warning device cannot be turned on due to a detection error in the accident detection algorithm, the driver can also manually turn on the warning device according to the situation.

[0030] It should be understood that the on-board processor needs to process the information of the GPS positioning module, pressure sensor and on-board camera, so it needs to have a certain computing power to meet the requirements. There are many options for on-board processors. In this embodiment, Snapdragon 665 is taken as an example. The GPU computing power of this chip reaches 115.2GFLOPS, and the floating-point computing amount of the VGG16 convolutional neural network when classifying a color picture with a resolution of (224, 224) is 15.47GFLOPS, which can obviously meet the requirements. The on-board camera can use the vehicle's own driving recorder. When the vehicle is in an abnormal state, the on-board processor calls the driving recorder to shoot the video around the vehicle, and then detects the video to determine whether a car accident has occurred.

[0031] In the embodiment of the present invention, the pressure sensor is used to analyze the impact situation from the force level of the vehicle, and a warning reminder is given in time to avoid secondary traffic accidents caused by the rear vehicle. In addition, by collecting the on-site video of the stationary section of the vehicle, the video is detected frame by frame through the traffic accident detection algorithm of image analysis to determine whether a traffic accident has occurred in front of the vehicle, so as to warn of the secondary traffic accident and ensure the safety of personnel. The present invention has strong anti-interference ability, each vehicle is independent of each other, and can complete the warning of other vehicles without communication.

[0032] like Figure 3 As shown, preferably, the pressure sensor is a flexible pressure sensor (i.e., a piezoresistive sensor), which is composed of multiple surface protection layers, wires, an upper electrode layer, a force-sensitive material layer, wires, and a lower electrode layer. It can change its shape arbitrarily and can be arranged in the front, back, left, and right of the vehicle; according to the force and deformation of the pressure sensor, it can fully detect whether the vehicle has collided.

[0033] It should be understood that the piezoresistive sensor is made by using the property that the resistivity of the elastomeric material changes with the pressure, and converts the pressure signal on the contact surface into an electrical signal. The sensor is made of flexible material and can change its shape arbitrarily, so it can be easily arranged in the front, back and sides of the vehicle, and can monitor the vehicle condition more comprehensively. When the vehicle collides, the force-sensitive material in the sensor changes its resistivity due to pressure, causing the electrical signal to change accordingly, thereby realizing the detection of the collision.

[0034] Preferably, the positioning information includes position information and vehicle speed;

[0035] The determining whether the positioning information satisfies a set condition includes:

[0036] It is determined whether the position information is consistent with the highway position information and whether the vehicle speed is zero. If the vehicle position information is consistent and the vehicle speed is zero, it is determined whether the position information is the set site position information.

[0037] It should be understood that high-precision GPS can provide the precise coordinates of the vehicle on the road, including longitude and latitude; by comparing with high-precision map data, it can be determined whether the vehicle is traveling on the highway. The set site location information includes toll booths and service areas. If the vehicle's location information is inconsistent with the set site location information, it is determined that the vehicle is in an abnormal state and video capture is performed on the current road section.

[0038] Specifically, the GPS positioning module obtains the current position and speed of the vehicle to determine whether the vehicle is located on a highway and whether the speed is zero. When the vehicle is located on a highway, the speed is zero, and it is not located at a toll station or service area, it is determined that the vehicle is in an abnormal condition.

[0039] In the embodiment of the present invention, whether the vehicle is in an abnormal state is determined based on the vehicle position and speed information.

[0040] like Figure 4 As shown, by encoding the spatiotemporal features and using domain adaptive target detection technology, the traffic accident detection under adverse weather conditions is achieved. The traffic accident detection algorithm includes two detection stages: a coarse detection stage and a fine detection stage.

[0041] Preferably, the detecting the on-site video by a car accident detection algorithm to obtain the result of a car accident comprises:

[0042] In the coarse detection stage, the on-site video is temporally characterized and the temporal feature encoding results are clustered to obtain an initial accident frame. In the fine detection stage, the initial accident frame is detected by a pre-trained target detector, the detection result is spatially characterized and the spatial feature encoding result is classified by a support vector machine to obtain the result of a traffic accident.

[0043] Preferably, in the rough detection stage, the on-site video is subjected to temporal feature encoding, and the temporal feature encoding result is clustered to obtain an initial accident frame, including:

[0044] In the rough detection stage, a plurality of continuous video frames of a preset number of frames are selected from the live video, and optical flow information of the plurality of continuous video frames is respectively counted to obtain a plurality of optical flow histogram feature vectors, and corresponding time sequence information is obtained based on index information of the plurality of optical flow histogram feature vectors, and the plurality of optical flow histogram feature vectors and the corresponding time sequence information are encoded by a first multi-layer neural network to obtain a time sequence encoding matrix;

[0045] The temporal coding matrix is ​​converted into a low-rank coefficient matrix through a self-representation constrained low-rank representation algorithm, an affinity graph is constructed according to the low-rank coefficient matrix, and the affinity graph is clustered through a Normalize Cut algorithm to obtain an initial accident frame.

[0046] Specifically, the coarse detection stage includes a temporal feature extraction operation and a frame clustering operation, specifically:

[0047] The temporal feature extraction operation includes: for each frame in the video and its 15 consecutive frames, extract the optical flow histogram descriptor (Histogram of Optical Flow, HOF, i.e., optical flow histogram feature vector) to represent the motion information of these frames. In addition to motion information, temporal order information is also an important clue to understand the content of the video. The temporal order information is fused into the HOF feature vector (i.e., optical flow histogram feature vector) using the frame index information (i.e., temporal order label). The optical flow histogram feature vector and temporal order information of the video frame are encoded into a coding matrix (i.e., temporal order coding matrix) through the first multi-layer neural network.

[0048] The frame clustering operation includes: using the Self-Representation Constrained Low-Rank Representation (SRLRR) algorithm to process the temporal coding matrix to obtain a low-rank coefficient matrix that can reflect the similarity between video frames (the larger the value, the higher the similarity). The low-rank coefficient matrix obtained by the SRLRR algorithm is used to construct an affinity graph. In this graph, the nodes represent video frames and the weights of the edges represent the affinity, which reflects the similarity between frames. Then, the Normalize Cut algorithm is used to cluster on the affinity graph to maximize the similarity difference between different groups while minimizing the similarity difference within the group. In the clustering results, frames between different clusters (i.e., boundary frames) are considered to be potential accident frames (i.e., initial accident frames) because they are visually significantly different from other frames.

[0049] It should be understood that optical flow is a vector field that describes the motion of pixels in an image, and HOF is a method of encoding optical flow information into histogram features. In this way, the motion information in the video is encoded into a series of HOF feature vectors, each of which represents the motion pattern information over a period of time. If the total number of video frames is t, an optical flow histogram descriptor is extracted from each frame and the 15 consecutive frames after the frame (a total of 16 frames), then the entire video can generate m descriptors, where m is t minus 15. The multi-layer neural network is the most basic neural network, which consists of a fully connected layer. The frame index is used as the temporal label of the previously obtained HOF feature vector, and then the complex mapping relationship between the HOF feature and the temporal label is learned by training the multi-layer neural network to achieve fusion (i.e. encoding).

[0050] The affinity graph can be represented by an adjacency matrix, where the elements of the matrix G are ij Indicates the similarity between frame node i and frame node j. In the affinity graph, each node represents a video frame, and the edge between frame nodes represents the similarity between frames. ij The calculation expression is:

[0051]

[0052] Among them, G ij represents the similarity of the edge between frame node i and frame node j, and Z represents the low-rank coefficient matrix.

[0053] In an embodiment of the present invention, a temporal feature coding matrix is ​​obtained by extracting temporal features from an image, and similar frames are clustered into the same category based on the temporal feature coding. In this way, all frames of the video are divided into multiple clusters, and there are significant differences between frames in different clusters. Since boundary frames are potential accident frames, boundary frame information located at the cluster boundary in the video frame is directly extracted through the Normalize Cut algorithm.

[0054] Preferably, the spatial feature encoding of the detection results and classification of the spatial feature encoding results by a support vector machine to obtain the traffic accident result include:

[0055] According to the detection result, the corresponding feature vector is extracted from the feature map obtained by the target detector to obtain multiple target feature vectors, the multiple target feature vectors are sorted according to the size of the coordinate value, the target feature vectors after the coordinate sorting are encoded by the second multi-layer neural network to obtain a coordinate space encoding matrix, the multiple target feature vectors are sorted according to the size of the object, the target feature vectors after the object sorting are encoded by the second multi-layer neural network to obtain an object space encoding matrix, the coordinate space encoding matrix and the object space encoding matrix are spliced ​​to obtain a space encoding matrix, the space encoding matrix is ​​classified by a support vector machine to obtain a result of a car accident.

[0056] Specifically, the fine detection stage includes target detection operations and spatial feature encoding operations, specifically:

[0057] The target detection operation includes: using the target detector trained by domain adaptation technology to detect the potential accident frame and obtain the detection results; all detection results are recorded as Among them, x and y represent the coordinates of the center point of the object, while w and h represent the width and height of the object, n is the total number of objects, and the object is the accident vehicle.

[0058] The spatial feature encoding operation includes: according to the target detection result obtained in the first step, the target feature vector of the corresponding area is extracted from the feature map of the YOLOv5L backbone network in reverse. All target feature vectors are represented as I = {I1, I2, ..., I n}, where n is the number of detected targets. First, the target feature vectors are sorted according to the size of the x-axis coordinates of the object; then, all the sorted target feature vectors are input into the second multi-layer neural network for encoding to obtain the encoding matrix A1. Similarly, the target feature vectors are sorted in descending order of object size, and then also sent to the second multi-layer neural network for encoding to obtain the encoding matrix A2. Finally, A1 and A2 are integrated into a feature vector (i.e., the spatial encoding matrix) and then input into the support vector machine for classification. If the classification result is an accident frame, it is judged that a car accident has occurred. If the classification result is a surrounding frame, it is damaged and no car accident has occurred.

[0059] It should be understood that the support vector machine is Support Vector Machine (SVM), which is applied to classification tasks. In order to reduce computational overhead, the efficient YOLOv5L algorithm is used as the target detector.

[0060] When the target detector detects the target in the potential accident frame, it outputs the feature map after passing through the backbone network. The prediction result of YOLOv5L will contain the coordinates and size information of the target. Based on this information, the feature vector of the corresponding area can be extracted from the feature map output by the backbone network.

[0061] In the embodiment of the present invention, a spatial feature encoding matrix is ​​obtained by extracting spatial features from potential accident frames, and whether a traffic accident occurs in front of the vehicle is determined based on the spatial features.

[0062] Preferably, the training process of the pre-trained object detector includes:

[0063] Construct source domain datasets and target domain datasets, and build initial student models and initial teacher models with the same configuration based on the YOLOv5L algorithm;

[0064] In a first training stage, a local domain classifier is set in the backbone network of the initial student model to obtain a new student model, the new student model is trained by the source domain data set and the target domain data set, a first prediction result is obtained by the new student model, a first local domain probability is obtained by the local domain classifier, the first prediction result and the first local domain probability are calculated by a first total loss function to obtain a first total loss, and the weight of the new student model is updated by the first total loss to obtain a student model;

[0065] In the second training stage, the weight of the student model is updated to the initial teacher model through an exponential moving average algorithm to obtain a teacher model, the target domain data set is predicted by the teacher model to obtain a pseudo label, the source domain data set is transformed by a style adaptive enhancement technology to obtain a target domain style data set, a global domain classifier is set at the end of the student model to obtain an optimized student model, the optimized student model is trained by the target domain style data set, a second prediction result is obtained by the optimized student model, the target domain data set is predicted by the optimized student model, a third prediction result is obtained by the optimized student model, a second local domain probability is obtained by the local domain classifier, a global domain probability is obtained by the global domain classifier, the second prediction result, the third prediction result, the pseudo label, the second local domain probability and the global domain probability are calculated by a second total loss function to obtain a second total loss, the weight of the optimized student model is updated by the second total loss, and the weight of the optimized student model after the weight update is updated to the teacher model by an exponential moving average algorithm;

[0066] Repeat the steps of the first training stage and the second training stage according to the preset number of iterations, and finally update the weights and optimize the student model as the target detector.

[0067] It should be understood that domain adaptation technology is a semi-supervised learning framework based on the mean-teacher architecture. The prediction results of the teacher model are filtered by the non-maximum suppression method and used as pseudo labels to guide the student model for iterative training. The domain adaptation technology used includes style adaptive enhancement, simplified adversarial training strategy and two-stage progressive training method.

[0068] The image data under normal weather conditions is defined as source domain data, and the image data under adverse weather conditions is defined as target domain data. The style adaptive enhancement technology is used to perform style conversion on the image to generate source domain data with a style similar to that of the target domain image, thereby reducing domain shift and improving the detection ability of the model under adverse weather conditions. In this embodiment, the CAP-VSTNet algorithm is used to generate images of different styles.

[0069] Conventional adversarial training strategies usually use multiple domain classifiers for adversarial training at the backbone network of the model, so that the model can extract domain invariant features. The present invention adopts a simplified adversarial training strategy to reduce the number of domain classifiers and streamline the domain classifier structure to alleviate the domain classification inconsistency problem existing in traditional methods. In this embodiment, a local domain classifier is set at the output of the 4th layer of the YOLOv5L algorithm backbone network, and a global domain classifier is set at the output of the 23rd layer at the end of the YOLOv5L algorithm model, taking into account local and global feature alignment, and further improving the domain adaptation ability of the model. Among them, the local domain classifier set at the 4th layer is used for local feature alignment, and the global domain classifier of the 23rd layer is used for global feature alignment, and the simplified adversarial training strategy is only used for student models. The input of the local domain classifier is the output of the 4th layer of the YOLOv5L algorithm backbone network, and the input of the global domain classifier is the output of the 23rd layer of the YOLOv5L algorithm.

[0070] All teacher models and student models also include image preprocessing (such as Mosaic image enhancement) before processing the image.

[0071] In the embodiment of the present invention, a model built based on the YOLOv5L algorithm is trained through supervised learning and semi-supervised learning to train a high-precision target detector to accurately detect traffic accidents.

[0072] Preferably, in the first training stage, the new student model is trained by the source domain dataset and the target domain dataset, a first prediction result is obtained by the new student model, and a first local domain probability is obtained by the local domain classifier, including:

[0073] The new student model is trained by the source domain data set to obtain a first prediction result, and a first local feature map output by the 4th layer of the backbone network of the new student model during training is obtained;

[0074] The new student model is trained using the target domain data set to obtain a second local feature map output by the 4th layer of the backbone network of the new student model during training, and the probabilities of the first local feature map and the second local feature map in the target domain data set are respectively calculated using the local domain classifier to obtain a first local domain probability.

[0075] Preferably, in the second training stage, the optimized student model is trained by the target domain style data set, a second prediction result is obtained by the optimized student model, the target domain data set is predicted by the optimized student model, a third prediction result is obtained by the optimized student model, a second local domain probability is obtained by the local domain classifier, and a global domain probability is obtained by the global domain classifier, including:

[0076] The optimized student model is trained by the target domain style data set to obtain a second prediction result, and a third local feature map output by the 4th layer of the backbone network of the optimized student model during training is obtained, and a first global feature map output by the 23rd layer of the optimized student model during training is obtained;

[0077] The target domain data set is predicted by the optimized student model to obtain a third prediction result, the fourth local feature map output by the 4th layer of the backbone network of the optimized student model during prediction is obtained, the second global feature map output by the 23rd layer of the optimized student model during prediction is obtained, the probabilities of the third local feature map and the fourth local feature map in the target domain data set are respectively calculated by the local domain classifier to obtain the second local domain probability, the probabilities of the first global feature map and the second global feature map in the target domain data set are respectively calculated by the global domain classifier to obtain the global domain probability.

[0078] Preferably, calculating the first prediction result and the first local domain probability by using a first total loss function to obtain a first total loss includes:

[0079] The first prediction result is calculated by using a supervision loss function to obtain a first supervision loss, and the supervision loss function is:

[0080]

[0081] Among them, L sup represents the first supervision loss, CE represents the cross entropy loss function, CIoU represents the bounding box regression loss function, X s Indicates the first prediction result, Y s represents the label, and the subscripts cls, reg, and obj represent the category, object coordinates and size, and confidence, respectively;

[0082] The first local domain probability is calculated by using a local domain adaptive loss function to obtain a first local domain adaptive loss, where the local domain adaptive loss function is:

[0083]

[0084] in, represents the first local domain adaptation loss, D represents the domain label, i is s or t, s represents the feature map from the source domain dataset, t represents the feature map from the target domain dataset, if the data comes from the source domain, D = 0, if the data comes from the target domain, D = 1, represents the first local domain probability;

[0085] The first supervision loss and the first local domain adaptation loss are calculated by a first total loss function to obtain a first total loss, where the first total loss function is:

[0086]

[0087] Among them, L first Represents the first total loss.

[0088] It should be understood that in the first training stage, both the source domain dataset and the target domain dataset are input into the new student model for prediction, but the supervision loss is only calculated for the prediction results of the source domain dataset, because the source domain dataset has labels, while the target domain dataset has no labels.

[0089] In an embodiment of the present invention, a local domain classifier is set at the backbone network, that is, only a simplified adversarial training strategy is partially used when training the student model, the student model is optimized through the first supervision loss and the local domain adaptive loss, the model parameter weights are updated, and the detection accuracy is improved.

[0090] Preferably, calculating the second prediction result, the third prediction result, the pseudo label, the second local domain probability and the global domain probability by a second total loss function to obtain a second total loss includes:

[0091] Calculating the second prediction result by using a supervision loss function to obtain a second supervision loss;

[0092] The third prediction result and the pseudo label are calculated by a semi-supervised loss function to obtain a semi-supervised loss, where the semi-supervised loss function is:

[0093]

[0094] Among them, L semirepresents the semi-supervised loss, CE represents the cross entropy loss function, CIoU represents the bounding box regression loss function, and X t Represents the third prediction result, Y t represents pseudo-label, subscripts cls, reg, and obj represent category, object coordinates and size, and confidence, respectively;

[0095] Calculating the second local domain probability by using a local domain adaptive loss function to obtain a second local domain adaptive loss;

[0096] The global domain probability is calculated by a global domain adaptive loss function to obtain a global domain adaptive loss, and the global domain adaptive loss function is:

[0097]

[0098] in, represents the global domain adaptation loss, D represents the domain label, i is s or t, s represents the feature map from the source domain dataset, t represents the feature map from the target domain dataset, if the data comes from the source domain, D = 0, if the data comes from the target domain, D = 1, Represents the prediction result of the global domain classifier;

[0099] The second local domain adaptation loss and the global domain adaptation loss are calculated by using a domain total loss function to obtain a domain total loss, where the domain total loss function is:

[0100]

[0101] Among them, L DC represents the total domain loss, represents the second local domain adaptive loss;

[0102] The second supervised loss, the semi-supervised loss and the domain total loss are calculated by a second total loss function to obtain a second total loss, where the second total loss function is:

[0103] L second =L sup ′+αL semi +δL DC ,

[0104] Among them, L second represents the second total loss, L sup ′ represents the second supervision loss, α and δ represent the balancing parameters, which are used to balance the weights of the loss functions of each part.

[0105] It should be understood that in the second training stage, supervised training is performed using the target domain style dataset, semi-supervised training is performed using the target domain dataset, and the semi-supervised loss is calculated based on the semi-supervised training results and the pseudo labels.

[0106] In an embodiment of the present invention, a local domain classifier and a global domain classifier are set in the student model, that is, a simplified adversarial training strategy is used when training the student model, and the student model is trained by supervised learning and semi-supervised learning. The student model is optimized through the second supervised loss, semi-supervised loss and domain total loss, and the model parameter weights are updated through iterative training to improve the detection accuracy and obtain the final target detector.

[0107] Preferably, if the vehicle is not hit and the result of the traffic accident is a traffic accident, the warning device is used to issue a warning, including:

[0108] If the vehicle is not hit and the result of the accident is a car accident, a reminder signal is sent to remind the driver to turn on the early warning device. When the early warning device is not detected to be turned on within a preset time, the early warning device is turned on for early warning.

[0109] In the embodiment of the present invention, when the driver does not take corresponding measures, the warning device is activated according to the preset time to avoid missing the critical warning period.

[0110] like Figure 5 As shown, a highway secondary traffic accident avoidance system provided by an embodiment of the present invention includes: an on-vehicle processor, a pressure sensor, a positioning device, a camera and an early warning device;

[0111] Respectively connecting the pressure sensor, the positioning device, the camera, and the warning device to the vehicle-mounted processor, wherein the vehicle-mounted processor includes a pressure warning unit, an image analysis unit, and an image warning unit;

[0112] The pressure warning unit is used to collect pressure data of the vehicle through a pressure sensor installed on the vehicle, and determine whether the vehicle is hit according to the pressure data. If the vehicle is hit, the warning device is controlled to issue a warning reminder;

[0113] The image analysis unit is used to collect the positioning information of the vehicle through the positioning device of the vehicle if there is no collision, and determine whether the positioning information meets the set conditions. If so, collect the on-site video of the current road section through the camera of the vehicle, and detect the on-site video through the traffic accident detection algorithm to obtain the result of the traffic accident;

[0114] The image warning unit is used to control the warning device to issue a warning reminder if the traffic accident result is a traffic accident.

[0115] like Figure 6 As shown, preferably, the controlling the early warning device to issue an early warning reminder includes:

[0116] The warning device is constructed by using a photosensitive sensor, a laser light, an air pump and a balloon, and the warning device is installed on the top of the vehicle;

[0117] The current day and night conditions are determined based on the photosensitive data collected by the photosensitive sensor. If it is daytime, the air pump is controlled to inflate the balloon, and the inflated balloon is controlled to alert the rear vehicles. If it is nighttime, the laser light is turned on to alert the rear vehicles.

[0118] Specifically, the early warning device is composed of a microcontroller, a voltage stabilizing module, a box switch, a photosensitive sensor, a laser light, an air pump and a balloon. In this embodiment, the microcontroller takes the STC89C51 single-chip microcomputer as an example, which is used to control the opening and closing of the air pump and the device switch. The voltage stabilizing module is used to reduce the vehicle battery voltage to 5V for power supply of the single-chip microcomputer. The voltage stabilizing module used in this example is LM2596. In order to avoid wind and sun, each device is placed in a sealed box, and the box switch is used to control the opening and closing of the box to release the balloon. The photosensitive sensor is used to determine whether it is day or night. In this embodiment, a 5516 photoresistor is used for judgment; the characteristic of the 5516 photoresistor is that the stronger the incident light, the smaller the resistance value, and the weaker the incident light, the larger the resistance value. When the light intensity is lower than the preset threshold, the sensor outputs a high level, otherwise it outputs a low level, so as to judge day and night. There are two laser lights placed on both sides of the sealed box, emitting red light; transparent materials are used where the laser lights are placed to facilitate the irradiation of the laser lights; the light beams emitted by the two laser lights cross in the air to form an X-shaped pattern. There are many options for air pumps. In this embodiment, in order to take into account the volume, power supply, inflation speed and other issues, a car-used wireless air pump is selected to inflate the balloon; in order to take into account the inflation speed and warning effect, the balloon is cylindrical in shape, 1 meter in length, 0.2 meter in width, bright yellow in color and with a warning sign.

[0119] The workflow of the early warning device includes: First, the on-board processor determines that a car accident has occurred and sends a command to the microcontroller, causing the module to enter a working state. Then, the microcontroller determines whether it is day or night based on the photosensitive sensor. If it is daytime, turn on the box switch and the air pump, release the balloon and inflate the balloon. The air pump will pre-set the specified air pressure. When the air pressure of the balloon reaches the preset value, the air pump stops working and completes the inflation of the balloon. If it is night, turn on the laser light, and the two laser light poles cross to form an X shape to remind the rear vehicle of an accident ahead.

[0120] In the embodiment of the present invention, different early warning reminders are performed according to different environments, which can more intuitively remind the vehicles behind to avoid secondary traffic accidents and ensure the safety of people.

[0121] Compared with other avoidance schemes, the advantages of the present invention are: for the early warning system fixed on the roadside, the present invention is more cost-effective, and the vehicle-mounted processor, GPS positioning module and camera used are all devices that the vehicle itself has. The early warning method is simple and efficient. During the day, a large balloon with a warning sign is used for early warning, and at night, a laser light is used to give a conspicuous early warning signal, so that the rear vehicles can easily see the warning information and take corresponding measures to avoid the occurrence of secondary accidents; at the same time, this early warning method has no directional blind spots, and early warning information can be obtained in any direction. The present invention has strong anti-interference ability, and the various vehicle systems are independent of each other, and early warnings to other vehicles can be completed without communication. The present invention can not only turn on the early warning device for early warning when a car accident occurs, but also manually start the early warning device when the vehicle fails and needs to remind the rear vehicles to pay attention. It is easy and flexible to use.

[0122] The above-mentioned highway secondary traffic accident avoidance system can refer to the implementation content and beneficial effects of the highway secondary traffic accident avoidance method specifically described above, which will not be repeated here.

[0123] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0124] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0125] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0126] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for avoiding secondary traffic accidents on highways, characterized in that: The steps include: The pressure data of the vehicle is collected by a pressure sensor installed in the vehicle, and whether the vehicle is hit is determined according to the pressure data. If hit, the vehicle is controlled to send an early warning to the outside; If there is no collision, the positioning information of the vehicle is collected through the positioning device of the vehicle to determine whether the positioning information meets the set conditions. If so, the on-site video of the current road section is collected through the camera of the vehicle, and the on-site video is detected by the traffic accident detection algorithm to obtain the result of the traffic accident; If the result of the traffic accident is a traffic accident, the vehicle is controlled to issue an early warning reminder to the outside.

2. The method for avoiding secondary traffic accidents on highways according to claim 1 is characterized in that: The positioning information includes position information and vehicle speed; The determining whether the positioning information satisfies a set condition includes: It is determined whether the position information is consistent with the highway position information and whether the vehicle speed is zero. If the vehicle position information is consistent and the vehicle speed is zero, it is determined whether the position information is the set site position information.

3. The method for avoiding secondary traffic accidents on highways according to claim 1 is characterized in that: The detecting the on-site video by using a car accident detection algorithm to obtain a car accident result includes: In the coarse detection stage, the on-site video is temporally characterized and the temporal feature encoding results are clustered to obtain an initial accident frame. In the fine detection stage, the initial accident frame is detected by a pre-trained target detector, the detection result is spatially characterized and the spatial feature encoding result is classified by a support vector machine to obtain the result of a traffic accident.

4. The method for avoiding secondary traffic accidents on highways according to claim 3 is characterized in that: The step of encoding the on-site video with time series features in the rough detection stage and clustering the results of the time series feature encoding to obtain an initial accident frame includes: In the rough detection stage, a plurality of continuous video frames of a preset number of frames are selected from the live video, and optical flow information of the plurality of continuous video frames is respectively counted to obtain a plurality of optical flow histogram feature vectors, and corresponding time sequence information is obtained based on index information of the plurality of optical flow histogram feature vectors, and the plurality of optical flow histogram feature vectors and the corresponding time sequence information are encoded by a first multi-layer neural network to obtain a time sequence encoding matrix; The temporal coding matrix is ​​converted into a low-rank coefficient matrix through a self-representation constrained low-rank representation algorithm, an affinity graph is constructed according to the low-rank coefficient matrix, and the affinity graph is clustered through a Normalize Cut algorithm to obtain an initial accident frame.

5. The method for avoiding secondary traffic accidents on highways according to claim 3 is characterized in that: The detection result is encoded with spatial features, and the spatial feature encoding result is classified by a support vector machine to obtain the result of the traffic accident, including: According to the detection result, the corresponding feature vector is extracted from the feature map obtained by the target detector to obtain multiple target feature vectors, the multiple target feature vectors are sorted according to the size of the coordinate value, the target feature vectors after the coordinate sorting are encoded by the second multi-layer neural network to obtain a coordinate space encoding matrix, the multiple target feature vectors are sorted according to the size of the object, the target feature vectors after the object sorting are encoded by the second multi-layer neural network to obtain an object space encoding matrix, the coordinate space encoding matrix and the object space encoding matrix are spliced ​​to obtain a space encoding matrix, the space encoding matrix is ​​classified by a support vector machine to obtain a result of a car accident.

6. The method for avoiding secondary traffic accidents on highways according to claim 3 is characterized in that: The training process of the pre-trained target detector includes: Construct source domain datasets and target domain datasets, and build initial student models and initial teacher models with the same configuration based on the YOLOv5L algorithm; In a first training stage, a local domain classifier is set in the backbone network of the initial student model to obtain a new student model, the new student model is trained by the source domain data set and the target domain data set, a first prediction result is obtained by the new student model, a first local domain probability is obtained by the local domain classifier, the first prediction result and the first local domain probability are calculated by a first total loss function to obtain a first total loss, and the weight of the new student model is updated by the first total loss to obtain a student model; In the second training stage, the weight of the student model is updated to the initial teacher model through an exponential moving average algorithm to obtain a teacher model, the target domain data set is predicted by the teacher model to obtain a pseudo label, the source domain data set is transformed by a style adaptive enhancement technology to obtain a target domain style data set, a global domain classifier is set at the end of the student model to obtain an optimized student model, the optimized student model is trained by the target domain style data set, a second prediction result is obtained by the optimized student model, the target domain data set is predicted by the optimized student model, a third prediction result is obtained by the optimized student model, a second local domain probability is obtained by the local domain classifier, a global domain probability is obtained by the global domain classifier, the second prediction result, the third prediction result, the pseudo label, the second local domain probability and the global domain probability are calculated by a second total loss function to obtain a second total loss, the weight of the optimized student model is updated by the second total loss, and the weight of the optimized student model after the weight update is updated to the teacher model by an exponential moving average algorithm; Repeat the steps of the first training stage and the second training stage according to the preset number of iterations, and finally update the weights and optimize the student model as the target detector.

7. The method for avoiding secondary traffic accidents on highways according to claim 6 is characterized in that: The calculating the first prediction result and the first local domain probability by using a first total loss function to obtain a first total loss includes: The first prediction result is calculated by using a supervision loss function to obtain a first supervision loss, and the supervision loss function is: Among them, L sup represents the first supervision loss, CE represents the cross entropy loss function, CIoU represents the bounding box regression loss function, X s Indicates the first prediction result, Y s represents the label, and the subscripts cls, reg, and obj represent the category, object coordinates and size, and confidence, respectively; The first local domain probability is calculated by using a local domain adaptive loss function to obtain a first local domain adaptive loss, where the local domain adaptive loss function is: in, represents the first local domain adaptation loss, D represents the domain label, represents the first local domain probability, s represents the feature map coming from the source domain dataset, and t represents the feature map coming from the target domain dataset; The first supervision loss and the first local domain adaptation loss are calculated by a first total loss function to obtain a first total loss, where the first total loss function is: Among them, L first Represents the first total loss.

8. The method for avoiding secondary traffic accidents on highways according to claim 6 is characterized in that: The calculating the second prediction result, the third prediction result, the pseudo label, the second local domain probability and the global domain probability by using a second total loss function to obtain a second total loss includes: Calculating the second prediction result by using a supervision loss function to obtain a second supervision loss; The third prediction result and the pseudo label are calculated by a semi-supervised loss function to obtain a semi-supervised loss, where the semi-supervised loss function is: Among them, L semi represents the semi-supervised loss, CE represents the cross entropy loss function, CIoU represents the bounding box regression loss function, and X t Represents the third prediction result, Y t represents pseudo-label, subscripts cls, reg, and obj represent category, object coordinates and size, and confidence, respectively; Calculating the second local domain probability by using a local domain adaptive loss function to obtain a second local domain adaptive loss; The global domain probability is calculated by a global domain adaptive loss function to obtain a global domain adaptive loss, and the global domain adaptive loss function is: in, represents the global domain adaptation loss, D represents the domain label, Represents the prediction result of the global domain classifier, s indicates that the feature map comes from the source domain dataset, and t indicates that the feature map comes from the target domain dataset; The second local domain adaptation loss and the global domain adaptation loss are calculated by using a domain total loss function to obtain a domain total loss, where the domain total loss function is: Among them, L DC represents the total domain loss, represents the second local domain adaptive loss; The second supervised loss, the semi-supervised loss and the domain total loss are calculated by a second total loss function to obtain a second total loss, where the second total loss function is: L second =L sup ′+αL semi +δL DC , Among them, L second represents the second total loss, L sup ′ represents the second supervised loss, and α and δ represent the balancing parameters.

9. A highway secondary accident avoidance system, characterized in that: include: On-board processors, pressure sensors, positioning equipment, cameras and warning devices; Respectively connecting the pressure sensor, the positioning device, the camera, and the warning device to the vehicle-mounted processor, wherein the vehicle-mounted processor includes a pressure warning unit, an image analysis unit, and an image warning unit; The pressure warning unit is used to collect pressure data of the vehicle through a pressure sensor installed on the vehicle, and determine whether the vehicle is hit according to the pressure data. If the vehicle is hit, the warning device is controlled to issue a warning reminder; The image analysis unit is used to collect the positioning information of the vehicle through the positioning device of the vehicle if there is no collision, and determine whether the positioning information meets the set conditions. If so, collect the on-site video of the current road section through the camera of the vehicle, and detect the on-site video through the traffic accident detection algorithm to obtain the result of the traffic accident; The image warning unit is used to control the warning device to issue a warning reminder if the traffic accident result is a traffic accident.

10. The highway secondary traffic accident avoidance system according to claim 9, characterized in that: The controlling the early warning device to issue an early warning reminder comprises: The warning device is constructed by using a photosensitive sensor, a laser light, an air pump and a balloon, and the warning device is installed on the top of the vehicle; The current day and night conditions are determined based on the photosensitive data collected by the photosensitive sensor. If it is daytime, the air pump is controlled to inflate the balloon, and the inflated balloon is controlled to alert the rear vehicles. If it is nighttime, the laser light is turned on to alert the rear vehicles.