Disclosure of Invention
In view of the above analysis, the embodiment of the invention aims to provide a method and a system for identifying abnormal driving behaviors of a commercial vehicle based on Beidou data, which are used for solving the problem that the existing identification method is difficult to accurately and reliably identify the abnormal driving behaviors of the commercial vehicle.
In one aspect, an embodiment of the present invention provides a method for identifying abnormal driving behavior of an operating vehicle based on beidou data, including:
collecting original Beidou data of an operating vehicle, cleaning the original Beidou data and unifying time intervals to obtain speed time sequence data;
adding a class label to the speed time sequence data to obtain sample data, wherein the class label comprises normal driving behavior, overspeed driving behavior, emergency stopping behavior, temporary stopping behavior or low-speed driving behavior;
constructing a symbolized multichannel convolutional neural network model, and training the symbolized multichannel convolutional neural network model based on the sample data;
and inputting the speed time series data to be identified into the trained symbolized multichannel convolutional neural network model to obtain the identification result of the abnormal driving behavior.
Further, the commercial vehicles comprise buses, trucks and dangerous goods vehicles; the original Beidou data comprise license plate numbers, vehicle types, longitudes, latitudes, locator speeds and locating time.
Further, the step of cleaning the original Beidou data and unifying the time intervals comprises the following steps:
deleting the same data and abnormal data in the original Beidou data according to the license plate number, longitude, latitude, locator speed and locating time, filling the missing speed data, and obtaining original speed time sequence data V o ;
According to the set time interval, the original speed time series data V o The time intervals of all the moments are uniform;
obtaining a velocity time series based on uniform time intervals
Wherein t is
n Speed value corresponding to time ∈>
The method comprises the following steps:
in the method, in the process of the invention,
and->
Representing the original time series V
o Continuous->
And->
Speed value of time, t
n For unifying the time interval after +.>
And->
The moments between the moments.
Further, the symbolized multi-channel convolutional neural network model includes:
the data symbolizing layer is used for symbolizing the input speed time sequence data to obtain static time sequence data and dynamic time sequence data;
the first convolution network layer is used for respectively normalizing the static time sequence data and the dynamic time sequence data which are output by the data symbolizing layer and the input speed time sequence data and then respectively convolving the static time sequence data and the dynamic time sequence data to obtain characteristic parameters;
and the second convolution network layer is used for merging the characteristic parameters output by the first convolution network layer and then carrying out convolution and category classification to obtain and output the identification result of the normal or abnormal driving behavior.
Further, the data symbolizing layer symbolizes the input speed time series data by the following manner to obtain static time series data:
dividing an input speed time sequence of the operating vehicle into an overspeed interval, a normal speed interval, a low speed interval and a parking interval;
and symbolizing each time sequence in the input speed time sequence data according to the dividing threshold value of each section to obtain static time sequence data.
Further, the data symbolizing layer symbolizes the input speed time series data in the following manner to obtain dynamic time series data, and the method comprises the following steps:
sequential extraction of velocity time series data V
n At time t
n And t
n+1 Velocity value of (2)
And->
And calculate the acceleration
If it is
Then->
And->
Using the symbol X
0 A representation; if n+1=n, the symbolization is finished, and dynamic time series data are obtained, otherwise, n=n+1;
if it is
Then->
Using the symbol-X
n A representation; wherein, if n+1=n, then +.>
Use of-X
n+1 Indicating that symbolization is finished to obtain dynamic time sequence data, otherwise, n=n+1;
if it is
Then->
Using the symbol X
n A representation; wherein, if n+1=n, then +.>
Using X
n+1 Indicating that symbolization is finished to obtain dynamic time sequence data, otherwise, n=n+1;
wherein N represents a time seriesData V n The total number of times in (a).
Further, a limit The value of (2) is 3.
Further, the first convolutional network layer comprises 3 independent convolutional neural networks, and each independent convolutional neural network comprises a normalization layer, a one-dimensional convolutional layer, a linear rectifying layer and a random rejection layer which are sequentially connected; each independent convolution neural network is used for carrying out normalization and convolution based on received static time sequence data, dynamic time sequence data or speed time sequence data respectively to obtain corresponding characteristic parameters.
Further, the second convolution network layer comprises a merging layer, a one-dimensional convolution layer, a linear rectification layer, a random rejection layer, two full-connection layers and a SOFTMAX function layer which are sequentially connected.
On the other hand, the embodiment of the invention provides a system for identifying abnormal driving behaviors of an operating vehicle based on Beidou data, which comprises the following steps:
the data acquisition module is used for acquiring original Beidou data of the operating vehicle, cleaning the original Beidou data and unifying time intervals to obtain speed time sequence data;
the sample data acquisition module is used for obtaining sample data by adding a category label to the speed time sequence data, wherein the category label comprises normal driving behavior, overspeed driving behavior, emergency stopping behavior, temporary stopping behavior or low-speed driving behavior;
the model construction module is used for constructing a symbolized multichannel convolutional neural network model and training the symbolized multichannel convolutional neural network model based on the sample data;
the recognition result acquisition module is used for inputting the speed time sequence data to be recognized into the trained symbolized multichannel convolutional neural network model to obtain the recognition result of the abnormal driving behavior.
Further, the operation vehicles in the data acquisition module comprise buses, trucks and dangerous goods vehicles; the original Beidou data comprise license plate numbers, vehicle types, longitudes, latitudes, locator speeds and locating time.
Compared with the prior art, the invention has the following beneficial effects:
according to the method and the system for identifying the abnormal driving behavior of the commercial vehicle based on the Beidou data, the original Beidou data of the commercial vehicle is firstly collected and processed to obtain the sample data, the symbolic multichannel convolutional neural network model constructed by training the sample data is utilized, finally the speed time series data to be identified is input into the trained symbolic multichannel convolutional neural network model to obtain the identification result of the abnormal driving behavior, the driving behavior characteristics of the commercial vehicle are fully utilized to process and construct the model, the accuracy and the reliability of identifying the abnormal behavior of the commercial vehicle are effectively improved, a support basis is provided for a highway management department to reasonably manage and control, the abnormal behavior of a driver can be assisted to monitor, and the safety degree of a road is further improved.
In the invention, the technical schemes can be mutually combined to realize more preferable combination schemes. Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and drawings.
Detailed Description
Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form a part hereof, and together with the description serve to explain the principles of the invention, and are not intended to limit the scope of the invention.
Example 1
An embodiment 1 of the present invention discloses a method for identifying abnormal driving behavior of a commercial vehicle based on Beidou data, as shown in fig. 1, including:
s1, acquiring original Beidou data of an operating vehicle, cleaning the original Beidou data, and unifying time intervals to obtain speed time sequence data.
When in implementation, the operating vehicles comprise buses, trucks and dangerous goods vehicles; the original Beidou data comprise license plate numbers, vehicle types, longitudes, latitudes, locator speeds and locating time.
Specifically, data of a passenger car, a truck and a dangerous goods vehicle are collected through the Beidou vehicle-mounted terminal, and 6 fields including license plate numbers, vehicle types, longitudes, latitudes, locator speeds and locating time in the data are extracted to serve as original Beidou data.
When the method is implemented, the original Beidou data are cleaned and the time intervals are unified, and the method comprises the following steps:
s11, deleting the same data and abnormal data in the original Beidou data according to the license plate number, longitude, latitude, locator speed and locating time, filling the missing speed data, and obtaining original speed time sequence data V o 。
Specifically, judging according to license plate numbers, longitudes, latitudes, speed of a locator and positioning time in the original Beidou data, and if different data are acquired by the same vehicle at the same time, only retaining a first piece of effective data; considering that the maximum running speed of the operating vehicle is 180km/h, if the speed value of the locator in the data exceeds 180km/h, indicating that the speed data of the data is wrong, deleting the data; if the vehicle data record is too few, the data is deleted, illustratively, less than 5 data records; if the longitude and latitude of the vehicle change, but the locator speed is 0, the nearest mean value is used for filling the locator speed. Processing the original Beidou data to obtain original speed time sequence data V o 。
S12、According to the set time interval, the original speed time series data V o The time intervals of all the moments are uniform.
Specifically, the time intervals of the original Beidou data acquisition are inconsistent, the time intervals between the velocity values in the obtained original velocity time sequence are inconsistent, the time intervals between the velocities in the original velocity time sequence are the same through setting the time intervals, so that training of a subsequent symbolized multichannel convolutional neural network model is facilitated, and the set time intervals can be 1 second, 1.5 seconds or 0.5 seconds.
S13, obtaining a speed time sequence based on the uniform time interval
Wherein t is
n Speed value corresponding to time ∈>
The method comprises the following steps:
in the method, in the process of the invention,
and->
Representing the original time series V
o Continuous->
And->
Speed value of time, t
n For unifying the time interval after +.>
And->
The moments between the moments.
S2, adding a class label to the speed time sequence data to obtain sample data, wherein the class label comprises a normal driving behavior label and an abnormal driving behavior label (comprising overspeed driving behavior, emergency stopping behavior, temporary stopping behavior or low-speed driving behavior). It can be understood that adding class labels to the speed time series data, and obtaining sample data provides support and basis for later symbolic multichannel convolutional neural network model training.
S3, constructing a symbolized multichannel convolutional neural network model, and training the symbolized multichannel convolutional neural network model based on the sample data.
In practice, the symbolized multi-channel convolutional neural network model comprises:
the data symbolizing layer is used for symbolizing the input speed time sequence data to obtain static time sequence data and dynamic time sequence data;
the first convolution network layer is used for respectively normalizing the static time sequence data and the dynamic time sequence data which are output by the data symbolizing layer and the input speed time sequence data and then respectively convolving the static time sequence data and the dynamic time sequence data to obtain characteristic parameters;
and the second convolution network layer is used for merging the characteristic parameters output by the first convolution network layer and then carrying out convolution and category classification to obtain and output the identification result of the normal or abnormal driving behavior.
In practice, the data symbolizing layer symbolizes the input speed time series data by the following way to obtain static time series data:
the input speed time series of the commercial vehicle is divided into an overspeed zone, a normal speed zone, a low speed zone and a parking zone.
And symbolizing each time sequence in the input speed time sequence data according to the dividing threshold value of each section to obtain static time sequence data.
In particular, if the vehicle is operatedIs a passenger car or a truck, the overspeed interval is over 100km/h, the normal speed interval is 60-100 km/h, the low speed interval is 0-60 km/h and the dividing threshold value of the parking interval is 0; if the operating vehicle is a dangerous goods vehicle, the overspeed interval exceeds 80km/h, the normal speed interval is 60-80 km/h, the low speed interval is 0-60 km/h and the dividing threshold value of the parking interval is 0. Based on the type of the operating vehicle and the speed value of each time series in the input speed time series data, the time series data is obtained by representing the time series data with different symbols from the dividing threshold value of the section, and the overspeed section uses the symbols
Representation, normal speed interval use symbol +.>
Indicating that the low speed section uses the symbol +.>
Sign indicating and parking interval use->
And (3) representing.
It can be understood that by symbolizing the speed time sequence division interval, the characteristics of the overspeed driving behavior, the low-speed driving behavior and the parking driving behavior of the operating vehicle in abnormal driving are more obvious, the extraction of relevant characteristics of the subsequent first convolution network layer is more facilitated, the support is provided for the classification of the second convolution network layer, and the classification is more accurate.
In practice, the data symbolizing layer symbolizes the input speed time series data in the following manner to obtain dynamic time series data, and the method comprises the following steps:
sequential extraction of velocity time series data V
n At time t
n And t
n+1 Velocity value of (2)
And->
And calculate the acceleration
If it is
Then->
And->
Using the symbol X
0 A representation; if n+1=n, the symbolization is finished, and dynamic time series data are obtained, otherwise, n=n+1; it will be appreciated that when the acceleration of the velocity values at adjacent times in the velocity time series data is within a set range, the symbol X is used for the velocity values at both times
0 A representation; if n+1=n, that is, the velocity values at the last adjacent time in the velocity time series data are extracted, the velocity values in the velocity time series data are represented by symbols, and dynamic time series data can be obtained.
If it is
Then->
Using the symbol-X
n A representation; wherein, if n+1=n, then +.>
Use of-X
n+1 Indicating that symbolization is finished to obtain dynamic time sequence data, otherwise, n=n+1; it will be appreciated that the sign-X is used for the velocity value at the previous time when the acceleration of the velocity value at the adjacent time in the velocity time series data is less than the set range
n A representation; if n+1=n, that is, extractionThe speed value of the last adjacent moment in the speed time series data is obtained, and the speed value of the last moment in the speed time series data at the next moment is used as-X
n+1 In this case, the velocity time series data are represented by symbols, and dynamic time series data can be obtained.
If it is
Then->
Using the symbol X
n A representation; wherein, if n+1=n, then +.>
Using X
n+1 Indicating that symbolization is finished to obtain dynamic time sequence data, otherwise, n=n+1; it will be appreciated that when the acceleration of the velocity values at adjacent times in the velocity time series data is greater than the set range, the velocity value at the previous time uses the symbol X
n A representation; if n+1=n, that is, the velocity value of the last adjacent time in the velocity time series data is extracted, the velocity value of the last time in the velocity time series data at the next time is used as X
n+1 In this case, the velocity time series data are represented by symbols, and dynamic time series data can be obtained.
Wherein N represents time-series data V n The total number of times in (a).
It should be noted that X
0 Any character may be used, exemplary, X
0 May be
XXn
n Any of the groups X can be used
0 Different characters and subscript n is different X
n Using different symbologies, i.e. X
n The symbols used being non-repeating, exemplary, X
n Can be used according to the difference of n +.>
Or->
Analogize to-X
n Can be used according to the difference of n +.>
Or (b)
And so on.
It can be appreciated that by symbolizing the speed time sequence according to the acceleration at adjacent moments, the features of emergency stop and temporary stop of the operation vehicle in abnormal driving can be more obvious, the subsequent first convolution network layer can be more helpful to extract relevant features, support is provided for classification of the second convolution network layer, and classification is more accurate.
Specifically, a limit The value of (2) is 3. It will be appreciated that will be a limit The method is set to be 3, so that the emergency parking behavior or the temporary parking behavior in the vehicle parking process can be better identified, and the dynamic time series data can better reflect the emergency parking behavior in abnormal driving.
Specifically, the first convolutional network layer comprises 3 independent convolutional neural networks, and each independent convolutional neural network comprises a normalization layer, a one-dimensional convolutional layer, a linear rectifying layer and a random rejection layer which are sequentially connected; each independent convolution neural network is used for carrying out normalization and convolution based on received static time sequence data, dynamic time sequence data or speed time sequence data respectively to obtain corresponding characteristic parameters. More specifically, the normalization layer maps the received data to numbers between 0 and 1 for processing by the one-dimensional convolution layer; the one-dimensional convolution layer carries out convolution operation on the received normalized data; the linear rectifying layer uses a relu function to carry out nonlinear processing on the independent convolutional neural network so as to obtain a characteristic diagram; the random discarding layer performs random discarding on the received feature map based on the Bernoulli distributed random variable vector so as to solve the problem of over-fitting and reduce the calculation cost, and the feature map after random discarding is the corresponding feature parameter.
Specifically, the second convolution network layer comprises a merging layer, a one-dimensional convolution layer, a linear rectification layer, a random discarding layer, two full-connection layers and a SOFTMAX function layer which are sequentially connected. More specifically, the merging layer merges the 3 feature parameters output by the received first convolutional network layer by using a concatate function of Keras; the one-dimensional convolution layer carries out convolution operation on the received combined characteristics; the linear rectifying layer uses a relu function to carry out nonlinear processing on the second convolution network layer so as to obtain a characteristic diagram; the random discarding layer performs random discarding on the received feature map based on the Bernoulli distributed random variable vector to obtain the feature map; the received feature images are classified by the combined structure of the two full-connection layers and the SOFTMAX function layer so as to obtain a classification result of normal or abnormal driving behaviors. It can be understood that the data are respectively extracted through the 3 convolutional neural networks in the first convolutional network layer, the overall driving behavior of the operating vehicle and the characteristics of the abnormal driving behavior of the operating vehicle are extracted more pertinently, the obtained characteristic parameters can better reflect the driving behavior of the operating vehicle, and the extracted characteristics are combined through the second convolutional network layer to obtain more accurate category classification.
And training the symbolized multi-channel convolutional neural network model based on the sample data, namely dividing the sample data into a training set and a testing set, training the constructed symbolized multi-channel convolutional neural network model by using the training set, adjusting parameters in a first convolutional network layer and a second convolutional network layer in the model to obtain the trained symbolized multi-channel convolutional neural network model, and testing and verifying the model by using the testing set to obtain the optimal model.
S4, inputting the speed time sequence data to be identified into the trained symbolized multichannel convolutional neural network model to obtain the identification result of the abnormal driving behavior.
Compared with the prior art, the method for identifying the abnormal driving behavior of the commercial vehicle based on the Beidou data provided by the invention has the advantages that firstly, the original Beidou data of the commercial vehicle is acquired and processed to obtain sample data, the symbolized multichannel convolutional neural network model constructed by training the sample data is utilized, finally, the speed time series data to be identified is input into the symbolized multichannel convolutional neural network model after training to obtain the identification result of the abnormal driving behavior, the driving behavior characteristics of the commercial vehicle are fully utilized to process and construct the model, the accuracy and the reliability of the identification of the abnormal behavior of the commercial vehicle are effectively improved, a support basis is provided for the reasonable management and control of a highway management department, the abnormal behavior of a driver can be assisted to be monitored, and the road safety degree is further improved.
Example 2
The embodiment 2 of the invention discloses a system for identifying abnormal driving behaviors of an operating vehicle based on Beidou data, which is characterized by comprising the following steps:
the data acquisition module is used for acquiring original Beidou data of the operating vehicle, cleaning the original Beidou data and unifying time intervals to obtain speed time sequence data;
the sample data acquisition module is used for obtaining sample data by adding a category label to the speed time sequence data, wherein the category label comprises normal driving behavior, overspeed driving behavior, emergency stopping behavior, temporary stopping behavior or low-speed driving behavior;
the model construction module is used for constructing a symbolized multichannel convolutional neural network model and training the symbolized multichannel convolutional neural network model based on the sample data;
the recognition result acquisition module is used for inputting the speed time sequence data to be recognized into the trained symbolized multichannel convolutional neural network model to obtain the recognition result of the abnormal driving behavior.
When the method is implemented, the operation vehicles in the data acquisition module comprise buses, trucks and dangerous goods vehicles; the original Beidou data comprise license plate numbers, vehicle types, longitudes, latitudes, locator speeds and locating time.
It should be noted that, since the relevant parts of the identification system and the foregoing identification method in this embodiment can be referred to each other, the description is repeated here, and thus the description is omitted here. The system embodiment has the same principle as the method embodiment, so the system also has the corresponding technical effects of the method embodiment.
Example 3
To verify the validity of the models in examples 1 and 2 of the present invention, 4000 sets of tagged vehicle speed time series data, i.e., sample data, were employed in specific example 3 of the present invention, wherein 800 sets of normal driving data, overdrive driving data, emergency stop data, temporary stop data, and low speed driving data were each employed. In this embodiment, the training set and the test set are divided according to a ratio of 4:1, i.e., 3200 sets of sample data are used for model training, and 800 sets of sample data are used for model verification.
In this embodiment, an independent convolutional neural network model (Convolutional Neural Networks, CNN) and a Multi-channel convolutional neural network model (Multi-scale Convolutional Neural Network, MCNN) are also selected for comparison analysis with the symbolized Multi-channel convolutional neural network model (Time series Symbolic Multi-scale Convolutional Neural Network, tsa_mcnn) in the present invention, and the recognition analysis of 3 models can be obtained under an experimental platform with a processor of Intel i5-6300HQ, a system memory of 8.0GB, a system of Windows10 (64 bits), and a programming language of python3.7 as shown in the following table.
As can be seen from the above table:
(1) The total accuracy of the TSA_MCNN model for identifying the driving behavior is obviously higher than that of the CNN model and the MCNN model, and is respectively higher than that of the CNN model and the MCNN model by 19.88% and 13.25%. The sizes of Kappa coefficients of the three models also indicate that the accuracy of the TSA_MCNN model is higher than that of the MCNN model and the CNN model, and the accuracy of the TSA_MCNN model is better.
(2) Because the speed limit value of the dangerous vehicle is different from that of the van, the three models have different effects in identifying and distinguishing normal driving behaviors from overspeed driving. The accuracy rate, recall rate and F1 score of the CNN model on normal driving and overspeed driving are low; the MCNN model has lower accuracy and good recall and F1 score for normal driving, and has lower recall and good accuracy and F1 score for overspeed driving; the TSA_MCNN model has excellent recall, precision, and F1 scores for both driving behaviors. It can be seen that the tsa_mcnn model recognizes better overdrive behavior and normal driving behavior for three types of vehicles.
(3) Temporary parking behavior and emergency parking behavior of vehicle are determined by emergency speed-changing threshold value a limit The three models are distinguished by different distinguishing effects on the two behaviors. The accuracy rate, recall rate and F1 score of the CNN model on temporary parking behaviors and emergency parking behaviors are low, wherein the recall rate of the emergency parking is close to 0.56; the MCNN model has good recall rate, accuracy rate and F1 score for temporary parking behavior and emergency parking behavior; the TSA_MCNN model has excellent recall rate, accuracy rate and F1 fraction; it can be seen that the TSA_MCNN model can well identify temporary parking behaviors and emergency parking behaviors.
(4) For the low-speed driving behavior, compared with other four behaviors, the method has the outstanding characteristics on the speed time sequence, and all three models have excellent recall rate, accuracy rate and F1 score for the low-speed driving behavior.
In summary, the tsa_mcnn model has better recognition effect on abnormal driving behavior of the operating vehicle.
As shown in fig. 2, it can be seen from a comparison of the confusion matrix of the three models, the tsa_mcnn model is more accurate in identifying abnormal driving behaviors of the commercial vehicle, and is significantly better than the CNN model and the MCNN model.
Those skilled in the art will appreciate that all or part of the flow of the methods of the embodiments described above may be accomplished by way of a computer program to instruct associated hardware, where the program may be stored on a computer readable storage medium. Wherein the computer readable storage medium is a magnetic disk, an optical disk, a read-only memory or a random access memory, etc.
The present invention is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present invention are intended to be included in the scope of the present invention.