Driver abnormal behavior detection system and method based on multiple views
Through the multi-view driver abnormal behavior detection system, the improved MVCNN model and view attention mechanism are used, combined with multi-view image feature fusion, to solve the problems of low recognition performance and long response time in the existing technology, and realize driver abnormality detection. The rapid and accurate recognition of behaviors and real-time reminders enhance the adaptability and efficiency of detection.
Patent Information
- Application Number
- CN202410842122.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-01
AI Technical Summary
Existing driver abnormal behavior detection methods have problems such as low recognition performance, large differences between data sets and real scenes, and long response times. In particular, methods based on deep learning perform poorly in situations of poor light, low contrast, and occlusion, and Real-time feedback is difficult to achieve.
A multi-view driver abnormal behavior detection system is adopted. Through the improved MVCNN model and view attention mechanism, combined with multi-view image feature fusion and voice reminder, it can quickly and accurately identify and remind the driver of abnormal behavior in real time.
It improves the accuracy and real-time performance of abnormal driver behavior detection, enhances the adaptability to different scenarios, reduces the number of parameters, and achieves high-precision and low-training time detection results.
Smart Images

Figure CN118736301A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of abnormal driver behavior detection, and in particular to a system and method for detecting abnormal driver behavior based on multiple views. Background Art
[0002] Many experts and scholars at home and abroad have conducted in-depth research on the problem of driver behavior detection and identification. At present, the driver behavior identification technology is mainly studied from three aspects: using multiple physiological characteristics of the human body for identification, using machine learning methods to identify driver behavior, and using deep learning methods to identify driver behavior. Multiple physiological characteristics detection often uses contact sensors to collect data. This method has high detection accuracy, but it is inconvenient to wear, and it will cause discomfort to the driver himself during the process of collecting information, affecting the driver's normal driving. The present invention uses a non-contact sensor to collect driving data through multiple cameras.
[0003] Traditional machine learning methods require manual feature setting, and then search for relevant information in the image based on the manual feature method, and then classify the driving behavior. There are many commonly used classification methods, such as nearest neighbor, Bayesian learning, etc. Craye et al. used hidden Markov model and Adaboost classifier to detect abnormal driver behavior; Chou Y et al. improved on Bayesian network and support vector machine to detect abnormal behavior; Gupter A et al. used feature fusion method to realize driver behavior detection. These methods have achieved remarkable results, but because manual features have weak adaptability in large scenes, they cannot have better performance in a single scene, and it is difficult to migrate to more scenes.
[0004] In recent years, with the rapid development of deep learning, many algorithms targeting driver behavior have also been proposed. Yu et al. proposed a method for network training using BP neural network and support vector machine; Peng et al. used VGG-19 network to extract semantic information and then detected the driver's behavior through LSTM; Xu analyzed the driver's abnormal behavior through lightweight network combined with multivariate time series.
[0005] With the rapid development of computer vision, more and more driver behavior detection algorithms have been proposed, but there are still some problems:
[0006] (1) The current deep learning-based method for detecting abnormal driver behavior only uses a single angle for encoding and recognition. In the experiment, there are problems such as poor lighting, which cause a large image signal-to-noise ratio, low contrast, and occlusion, resulting in low recognition performance.
[0007] (2) Most of the data sets used in the experiment come from simulated experimental conditions, which have certain errors compared to real scenarios, so they need to be as close to reality as possible;
[0008] (3) Many detection systems have a long response time and a large number of parameters, and cannot provide real-time feedback to the driver to avoid danger. Therefore, the present invention proposes a detection system that can quickly and accurately identify abnormal driver behavior and remind the driver in real time. Summary of the invention
[0009] In order to overcome the above technical problems, the purpose of the present invention is to provide a driver abnormal behavior detection system and method based on multi-views, which can quickly analyze the driver behavior information in different driving time periods, detect abnormal behavior through deep learning algorithms, display it in real time and remind the driver through voice information, so as to avoid and prevent the occurrence of some traffic accidents in advance.
[0010] In order to achieve the above object, the technical solution adopted by the present invention is:
[0011] A multi-view based driver abnormal behavior detection system, comprising a human-computer interaction UI module and a driver abnormal behavior detection module;
[0012] The human-computer interaction UI module is used for the driver to obtain instructions through touch or voice recognition, and returns the most matching results according to the driver's needs, realizing natural human-computer interaction; greatly improving the driver's safety protection ability;
[0013] The driver abnormal behavior detection module is used to process the input video information through the proposed behavior detection algorithm and feed back the results to the driver in the form of voice, image and text information.
[0014] The human-computer interaction UI module includes image and parameter display, behavior detection and recognition result display, and system control and operation;
[0015] The image and parameter display is used to display the parameters of abnormal actions detected in the video; for example, the appearance of a mobile phone and the number of blinks, as well as the selection of key parts;
[0016] The behavior detection and recognition result display is used to display the abnormal behavior of the driver after detection and indicate the type of abnormal behavior information;
[0017] The system control and operation are used to handle the interaction functions between the driver and the system.
[0018] The driver abnormal behavior detection module includes video stream input, abnormal behavior recognition and voice prompts;
[0019] The video stream input is used to transmit the video information collected by the sensor into the system;
[0020] The abnormal behavior recognition is used to process and analyze the input information through feature extraction, convolution, and feature fusion operations using an improved image classification algorithm;
[0021] The voice prompt is used to feed back the processing result to the background and to remind the driver by voice.
[0022] The system visualization interface is a visualization of the human-computer interaction UI module and the driver abnormal behavior detection module, including the driver abnormal behavior visualization interface, behavior recognition and data processing;
[0023] The abnormal behavior visualization interface is used to display the functions, operation interface and display area of the system;
[0024] The data processing is used to remove noise and outliers, normalize and remove redundant information from the data collected from different perspectives, so as to improve the accuracy and prediction performance of the model;
[0025] The behavior recognition is used to detect abnormal behavior of the driver through an algorithm.
[0026] The data processing includes dual-view image and multi-view image combination;
[0027] The dual-view image is used to collect driver behavior information from two different perspectives; the two perspectives are located directly in front of the driver and 45° to the right;
[0028] The multi-view image combination is used to perform a feature fusion on the image information of the dual perspectives to improve the detection accuracy of the model.
[0029] Multi-view image combination includes integrating the data extracted from different angles, inputting the input feature map into two branches for processing at the same time, and then splicing the feature maps processed by the two branches in the channel direction. At the same time, a convolution layer composed of a 1*1 convolution kernel is used to reduce the dimension and reduce the number of parameters.
[0030] The behavior recognition includes an improved MVCNN and a classifier;
[0031] The improved MVCNN is used to improve the traditional CNN for image recognition; by adding a new module MMobNet to the MVCNN basic framework, it consists of a feature extraction module, a feature fusion module and a classification module, which can effectively utilize multiple perspective image features to make the classification result more accurate;
[0032] The classifier is used to classify the abnormal behavior information after being processed by the algorithm; the classification task is performed through the output vector of the Softmax function.
[0033] A detection method for a driver abnormal behavior detection system based on multiple views comprises the following steps;
[0034] Step 1: Obtain driver behavior data through sensors with different viewpoints and create a multi-view driving behavior dataset;
[0035] Step 2: Take the data set in step 1 and use the feature extraction module to extract multi-scale feature information from the data set image, thereby ensuring that the network does not lose feature information in depth while obtaining more feature information under different receptive fields, avoiding excessive loss of key information of the source image;
[0036] Step 3: Fusing the multi-scale feature information through a feature fusion module to output a multi-view feature map;
[0037] The feature fusion module can be used in the model to better consider the feature differences between views. Combined with the introduced view attention module, the weight of the effective view can be increased, which can also help the model achieve higher recognition accuracy and better generalization ability, and improve the performance of the model.
[0038] Step 4: The classification module is used to classify the feature map obtained from the feature fusion module through the classifier;
[0039] The final result is to judge the specific abnormal behavior according to the different behavior identification methods.
[0040] In step 2:
[0041] The specific steps of extracting multi-scale feature information are to remove the fully connected layer of CNN, use the convolutional layer to extract Conv features, scale the image to obtain multiple images of different sizes, and then input them into CNN to extract Conv features and perform feature aggregation, and finally merge the features corresponding to images of different sizes.
[0042] In step 3:
[0043] (1) Extract spatial features from the feature maps of all images using a scheme based on the Spatial Attention Module (SAM);
[0044] The feature map size obtained in the feature extraction layer is [B, 576, 7, 7], where B is the batch size, 576 is the number of channels, and 7*7 is the height and width of the feature map;
[0045] In the channel direction, global max pooling and global mean pooling are used to perform global maximum pooling and global average pooling. The two [B, 1, 7, 7] are concatenated to obtain [B, 2, 7, 7]. Then, a 1*1 filter is used for convolution. After the activation function Sigmoid, the obtained [B, 1, 7, 7] is the spatial feature of each image.
[0046] (2) View-based spatial feature weight learning
[0047] The acquired spatial features of the image are weighted based on the view, that is, the spatial feature attention mechanism of the view. After obtaining the spatial features of [B, 1, 7, 7], the feature map size is converted, and a num_views scale is added, that is, the scale of the number of views, to obtain [B / num_views, num_views, 1, 7, 7], where B is set to b*num_views when the image is input, so B / num_views is always an integer; the images in a batchsize are divided according to the number of views (num_views), and the method of continuous input of images at the same time is used when the image is input, so that the view attention mechanism acts on multiple views within a time; since the second dimension size is 1, this dimension is omitted and then converted to [B / num_views, num_views, 7, 7], the second dimension of the feature map refers to the number of views (num_views), and the feature map can be represented as B / num_views groups of features, each group is B / num_views 7*7 features, that is, B / num_views groups of spatial features of multi-view feature maps; then global max is performed on the spatial features Pooling and global meanpooling are performed to implement global maximum pooling and global average pooling, and two feature maps [B / num_views, num_views, 1, 1] are obtained. The two feature maps are sent to a two-layer neural network. The number of 1*1 filters in the first layer is 1024, and the number of filters in the second layer is restored to num_views. ReLU is used as the activation function in the middle. Finally, the two feature maps output by the neural network are added together, and then activated by the Sigmoid function to obtain the final view-based attention feature after weight learning.
[0048] Finally, the view attention feature is multiplied with the corresponding multi-view feature map to obtain a multi-view feature map after view weight learning.
[0049] In step 4:
[0050] The full convolution layer with three layers of convolution replaces the usual fully connected layer, and the Dropout layer and h-swish activation function are used between the convolution layers;
[0051] The feature map size obtained from the feature fusion module is [B, 576, 7, 7], the convolution kernel size of the first convolution layer is 7*7, the number is 576, and the output is [B, 576, 1, 1];
[0052] The convolution kernel size of the second convolution layer is 1*1, the number is 1024, and the output is [B, 1024, 1, 1];
[0053] The convolution kernel size of the third convolution layer is 1*1, the number is the number of task classifications, and the output is [B,nclasses,1,1], where nclasses is the number of task classifications. The classifier outputs a predicted probability for each possible category.
[0054] Beneficial effects of the present invention:
[0055] (1) The present invention proposes a multi-view fusion strategy that can integrate the features of multiple behaviors and make more accurate decisions compared to the single-view method.
[0056] (2) Introducing transfer learning into abnormal behavior detection, achieving both high accuracy and low training time.
[0057] (3) A view attention mechanism (VAM) is proposed, which can effectively emphasize features that are important to the detection task while suppressing redundant features. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 Schematic diagram of camera distribution in the present invention.
[0059] Figure 2 This is the inverted residual structure diagram of the present invention.
[0060] Figure 3 It is a schematic diagram of the calculation curve of h-swish and swish of the present invention.
[0061] Figure 4 Schematic diagram of the spatial feature extraction submodule of the present invention.
[0062] Figure 5 Schematic diagram of the view-based spatial feature weight learning submodule of the present invention.
[0063] Figure 6 This is a schematic diagram of the system visualization interface.
[0064] Figure 7 This is the structural diagram of driver abnormal behavior detection.
[0065] Figure 8 This is a schematic diagram of the UI human-computer interaction interface. DETAILED DESCRIPTION
[0066] The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0067] The purpose of the present invention is to better regulate the driver's behavior and avoid dangerous accidents caused by the driver's abnormal behavior during driving, thereby regulating road traffic safety and protecting the life and property safety of people in the car.
[0068] The present invention proposes a driver abnormal behavior detection system based on deep learning, which quickly analyzes the driver behavior information in different driving time periods, detects abnormal behavior through deep learning algorithms, displays it in real time and reminds the driver through voice information, so as to avoid and prevent the occurrence of some traffic accidents in advance.
[0069] The technical solution of the invention of this abnormal behavior detection system is:
[0070] 1. There are many types of driving behaviors, including distracted driving, fatigue driving, and dangerous driving. The perspective requirements for dangerous driving are similar to those for distracted driving. Both require the image to show the driver's physical behavior as completely as possible. However, fatigue driving is different. The image perspective requirements for the driver are for the driver's upper body, especially the head and face area. Because the driver's fatigue is more obvious in head movement, eye closure, mouth movement, etc., the fatigue driving recognition model focuses more on this part. The existing State Farm dataset cannot be used as a complete driving behavior image dataset. Therefore, it is necessary to build a driver abnormal behavior dataset based on multiple perspectives. During the data set collection process, infrared binocular cameras need to be arranged in front of the driver and 45° to the right. Figure 1 , pixel size is 1280x720, 30fps, to obtain driver behavior information from multiple angles.
[0071] 2. Here, the driver's abnormal behavior can be divided into 6 categories, namely, making phone calls; sight deviation; dozing off; drinking water; chatting with the rear passengers. Remember that this data is collected in the form of video for driving behavior. The duration of the action is 60s, the action rate is moderate, and the real driving environment is simulated as much as possible. The collected video data set is split into video frames through the script to obtain a .jpg image data set. The frame extraction frequency is 10 frames per second. The data set is then labeled, and the image accuracy is manually checked based on the label to prevent invalid behavior from causing excessive noise in the data set. Due to the limited amount of data, the small number of experimental personnel and the large number of behavior classifications, the validation set is not divided for verification. The total images are divided into training set and test set, and the division ratio is 8:2.
[0072] 3. Detection Methods
[0073] Image recognition tasks can usually be classified as image classification tasks, and CNN models are widely used in this field. Based on the data input requirements and classification tasks of multi-view images, the model basic framework of this application will use the MVCNN model. The MVCNN model was originally used for 3D object recognition tasks, but using the MVCNN basic framework to complete multi-view driving behavior classification tasks can not only effectively solve the data input problem of the multi-view model, but also enable the new model to effectively utilize multiple view image features, and the classification results are more accurate. Through the improvement of the model, the new model obtained includes a feature extraction module, a feature fusion module and a classification module.
[0074] 3.1 Feature Extraction Module
[0075] The feature extraction module uses the image feature extraction scheme of MobileNetV3 as the framework. The feature extraction scheme of MobileNetV3 adopts a modular design and consists of 11 bnecks. Each bneck contains an inverted residual structure and an SE module. The input parameter list confirms whether to use them. In this module, since existing modules are used without large-scale changes, the transfer learning method is used for pre-training, and the parameters that have been trained on a super-large-scale dataset are used as the model initial values, so as to reduce the training time and improve the accuracy of the results.
[0076] The feature extraction module of the MobileNetV3 model has four characteristics:
[0077] (1) Depthwise separable convolution effectively reduces the number of model parameters;
[0078] (2) The inverted residual with linear bottleneck structure improves the propagation of gradients between convolutional layers
[0079] Capacity, memory usage is more efficient;
[0080] (3) SE module (squeeze and excitation), channel attention mechanism, improves the connection between feature map channels;
[0081] (4) h-swish replaces the swish activation function to reduce the computational cost.
[0082] The inverted residual structure is Figure 2 As shown in Figure 1, unlike the residual structure in the ResNet model, the inverted residual structure first increases the dimension and then reduces the dimension.
[0083] The reason for introducing this structure is that the original MobileNet model is a straight-tube network similar to the VGG model. It cannot reuse features like ResNet, thereby improving the correlation between gradients and losses, so a shortcut structure is added.
[0084] The SE module is a lightweight module. However, unlike the SE module in the SE-Net model, the activation function used by the SE module in MobileNet-V3 is the new activation function h-swish designed by the team that proposed the model. h-swish is an improved version of swish. As a replacement for ReLU, the swish nonlinear activation function can effectively improve the accuracy of the neural network. Its definition is as follows:
[0085] swishx=x·σ(x) (3.1)
[0086]
[0087] Where x is the input image, σ(x) is the sigmoid function. For lightweight networks, σ(x) is more complex to calculate and difficult to derive, which affects the deployment of the model. Therefore, the Google team proposed the h-swish activation function, which is defined as follows:
[0088]
[0089] ReLU6(x)=min(max(x,0),6) (3.4) where ReLU is a rectified linear unit. Figure 3 As shown in the figure, the calculation curves of h-swish and swish are almost the same, but the difference in calculation difficulty is significant.
[0090] 3.2 Feature Fusion Module
[0091] The feature fusion layer is the core of the model design, which is completely different from the View-pooling layer of MVCNN. The feature fusion solution of MVCNN only uses the feature maps of different views to take the maximum value of each element to achieve the "aggregation" effect, without considering the feature differences between views. Therefore, this application uses a module called View-based Attention Module (VAM) in the feature fusion layer. This module uses an attention mechanism for views, performs importance weight analysis on multiple views, increases the weight of valid views, and suppresses the weight of invalid or ineffective views.
[0092] like Figure 5 As shown in Figure 3, the VAM module is divided into two sub-modules: spatial feature extraction from feature maps and view-based spatial feature weight learning.
[0093] Spatial feature extraction of feature maps
[0094] (1) Extract spatial features from the feature maps of all images using a scheme based on the spatial attention module (SAM), such as Figure 4 shown.
[0095] The feature map size obtained in the feature extraction layer is [B, 576, 7, 7], where B is the batch size, 576 is the number of channels, and 7*7 is the height and width of the feature map. Global max pooling and global mean pooling are used in the channel direction to perform global maximum pooling and global average pooling. The two [B, 1, 7, 7] are concatenated to obtain [B, 2, 7, 7], and then a 1*1 filter is used for convolution. After the activation function Sigmoid, the obtained [B, 1, 7, 7] is the spatial feature of each image.
[0096] (2) View-based spatial feature weight learning
[0097] The acquired spatial features of the image are weighted based on the view, that is, the spatial feature attention mechanism of the view, such as Figure 5As shown. After obtaining the spatial features of [B, 1, 7, 7], the feature map size is converted, and a num_views scale is added, that is, the scale of the number of views, to obtain [B / num_views, num_views, 1, 7, 7], where B is set to b*num_views when the image is input, so B / num_views is always an integer. This operation is to divide the images in a batchsize according to the number of views (num_views), and the method of continuous input of images at the same time is used when the image is input, so that the view attention mechanism acts on multiple views at one time. Since the size of the second dimension is 1, this dimension can be omitted and then converted to [B / num_views, num_views, 7, 7]. Usually, for feature maps of the same scale, the second dimension is often the number of channels Channels, and the second dimension of the feature map refers to the number of views (num_views), so the feature map can be represented as B / num_views groups of features, each group is B / num_views 7*7 features, that is, B / num_views groups of spatial features of multi-view feature maps. Then, global max pooling and global mean pooling are performed on the spatial features to achieve global maximum pooling and global average pooling, and two feature maps [B / num_views, num_views, 1, 1] are obtained. Both are sent to a two-layer neural network. The number of 1*1 filters in the first layer is 1024, and the number of 1*1 filters in the second layer is restored to num_views. ReLU is used as the activation function in the middle. Finally, the two feature maps output by the neural network are added together, and then activated by the Sigmoid function to obtain the final view-based attention feature after weight learning.
[0098] Finally, the view attention feature is multiplied with the corresponding multi-view feature map to obtain a multi-view feature map after view weight learning.
[0099] 3.3 Classification Module
[0100] The classification module of the model uses a three-layer full convolution layer to replace the usual fully connected layer. Dropout layers and h-swish activation functions are used between convolution layers. The full convolution layer is more efficient and only needs to perform one forward calculation, reducing the amount of calculation. This operation has been increasingly used in a large number of neural network models. The feature map size obtained from the feature fusion module is [B, 576, 7, 7]. The convolution kernel size of the first convolution layer is 7*7, the number is 576, and the output is [B, 576, 1, 1]. The convolution kernel size of the second convolution layer is 1*1, the number is 1024, and the output is [B, 1024, 1, 1]. The convolution kernel size of the third convolution layer is 1*1, the number is the number of task categories, and the output is [B, nclasses, 1, 1]. nclasses is the number of task categories. The classifier outputs a predicted probability for each possible category.
[0101] 3.4 Model Training
[0102] 3.4.1 Data Preprocessing
[0103] The image data of a common single-view model does not require additional annotation of the image except for determining the label, so the position of the image in a category does not require to be fixed. However, the image data of a multi-view model requires additional annotation of the image in addition to determining the label, and the image must be in a relatively fixed position in the category file. The reason why the image data of a multi-view model requires such a requirement is the input format of the model. The multi-view model requires several images of the same view at the same time to be input together, so the data needs to be preprocessed to a certain extent.
[0104] The first step is to annotate the constructed dataset. Although the images have been labeled for content, the dataset needs to be re-labeled due to the data input requirements of the multi-view model. The image labels are re-labeled in the format of "collection batch-behavior number-volunteer number-time number-view number". After annotation, the images in the new file will be automatically sorted by name, so that the two view images at the same time will be fixed and arranged continuously, and will no longer be scattered like single-view model data. In addition, annotation in this format will also help the multi-view perspective comparison experiment later, making it easier to screen perspective images and form a new two-view or three-view dataset.
[0105] The second is to reduce the size of the image. A 720P image is too large for the model. In addition, too much input data during training will also limit the batch size. Too large a batch size will seriously compress the GPU memory and make the training time too long. The image is reduced from 720P to 224x224 through the reshape operation. This size is the common input size of most image classification models.
[0106] Then expand the data set and perform data augmentation. Since the number of participants in the NMDA data set is limited and the data size is also limited, data augmentation must be performed to expand the data set. Data augmentation is a common technique in deep learning. It is different from data enhancement. The core purpose of data augmentation is to expand the data set and increase the amount of data through various methods, while data enhancement is to enhance the quality of the data by removing the noise of the data itself and the label noise. The methods used for data augmentation in the field of computer vision (CV) include standard data augmentation, such as rotation, cropping and scaling, etc., image mirroring, pixel change processing, noise injection processing and model transformation processing.
[0107] There are two main data augmentation methods used in this experiment. One is random cropping, using the function transforms.RandomResizedCrop(), which randomly crops a given image into different sizes and aspect ratios, and then scales the cropped image to a specified size. The input parameters of this function mainly set the specified size to (224, 224), the random cropping range to (0.7, 1.0), and the scaling to (9.0 / 16.0, 16.0 / 9.0). The second is random color adjustment, using the function
[0108] transforms.ColorJitter(), whose function is to randomly modify the brightness, contrast, saturation and hue of an image. Each parameter is set to 0.5, that is, the color attribute values of the image are randomly changed between 50% and 150% of the original image.
[0109] Finally, the data is standardized. Before standardization, the image data format must be converted. Use the transforms.ToTensor() function to convert the original PILImage format into a tensor type that can be quickly processed by pytorch, and convert the [W,H,C] format of the input data to [C,W,H]. Data standardization refers to processing the data so that the new data conforms to the normal distribution, that is, the mean is 0 and the standard deviation is 1. Such data will make the model easier to converge. The function used for data standardization is transforms.Normalize(). This function requires the mean and standard deviation of the input data set. Therefore, it is necessary to write a Python script to obtain the mean and standard deviation of the NMDA data set. The final mean of the NMDA data set training set is [0.4148134, 0.4065143, 0.4115489], and the standard deviation is
[0110] [0.27508628, 0.2553274, 0.32647355], the mean of the test set is
[0111] [0.43159482, 0.42250603, 0.42940098], the standard deviation is
[0112] [0.2713834,0.24952935,0.22935694].
[0113] 3.4.2 Parameter setting and related function selection
[0114] Before training a deep neural network model, we must first determine the batchsize and epochs. Batchsize refers to the number of data samples input in a model training, and epochs refers to the number of times the model is trained. A suitable batchsize helps speed up the model training and reduce the loss oscillation during training. However, epochs do not need to be considered large, as too large epochs will seriously affect the training time. After testing and the memory limitation of the GPU in the training environment, the batchsize is set to 32 and the epochs is set to 50.
[0115] Since the feature extraction module of the new model uses the features part of MobileNet-V3, the idea of transfer learning can be used to apply the parameters of MobileNet-V3 that have been trained to the new model to obtain better initial parameters to reduce training time. Therefore, the feature extraction module in the new model loads the features parameters of MobileNet-V3, and the other parts are randomly initialized. The loss function of the model uses the cross entropy function (CrossEntropyLoss, CE), which is generally applicable to multi-classification models. In a batch, the cross entropy loss function calculation formula of the n-classification model is 3.5.
[0116]
[0117] Among them, yji is the true result, is the result predicted by the model. Overfitting is one of the inevitable phenomena when training models with small-scale data sets. In addition to using the Dropout layer in the feature extraction module, L2 regularization in regularization is also one of the effective methods to suppress overfitting. Regularization suppresses overfitting by reducing the complexity of the neural network during training. The Dropout layer is also one of the regularization methods. The essence of regularization is to punish too many model parameters. The usual punishment method is to add a regularization term after the loss function. L2 regularization corresponds to the L2 norm, as shown in formula (3.6).
[0118]
[0119] Here wi is the input parameter of the loss function, and the loss function with the L2 regularization term added can be expressed as formula (3.7).
[0120]
[0121] The λ is a parameter that controls the size of the regularization term. The larger the λ is, the greater the degree of suppression on the parameter. In this experiment, the value of λ is 0.001.
[0122] The training of the model requires the optimizer to update and calculate the model parameters so that the output of the model approaches or reaches the optimal value, thereby maximizing or minimizing the loss function. The optimizer used in this experiment is Adam, a general optimizer proposed in 2014. It is easy to use and has a fast gradient descent speed. The parameter that needs to be set in the optimizer is the learning rate (LR), which can determine the step size of each iteration so that the loss function converges to the minimum value. A learning rate that is too small converges slowly and the training time is too long, while a learning rate that is too large converges too quickly and easily crosses the minimum value without achieving convergence. After preliminary experimental testing, it is confirmed that the learning rate is set to 1e-3.
[0123] Since deep neural networks are trained on an unknown, huge and complex function, the purpose of training is to find the optimal solution for the function parameters. The training process requires multiple iterations, and the number of iterations is also called epochs. The number of iterations is limited, and the speed of parameter update, that is, the speed of model learning is fixed and controlled by the learning rate. In the early stage of training, the model needs a relatively large iterative step size to quickly reach the vicinity of the optimal solution. In the later stage of training, after reaching the vicinity of the optimal solution, the iterative step size needs to be reduced to facilitate finding the optimal solution. Therefore, this experiment sets up a dynamic adjustment learning plan. The specific method is to use the lr_scheduler.ReduceLROnPlateau function in the Pytorch framework. This function observes the changes in the loss or acc (accuracy) of the test set and changes the learning. This experiment adopts the method of observing loss to observe whether the loss has not decreased for three consecutive epochs. If so, the learning rate is reduced by 0.5 times, that is, it becomes half of the original learning rate.
[0124] 4. System structure
[0125] Figure 6 The overall structure of the driving behavior detection system is shown, which mainly includes data acquisition and processing from multiple perspectives and face area data processing obtained using the RetinaFace face detector, behavior recognition work on the input multi-perspective image data and face area data through the improved MTCNN model, and a visual interface that displays the data content.
[0126] It is compiled and run in Windows 10 system, using VS2018 as the software programming environment and MFC (Microsoft foundation classes) technology for its development. Because MFC encapsulates many functions, classes and APIs, it is programmed in C++ language and uses the open source OpenCV library function to write recognition programs to meet the user's user interface design requirements for the system.
[0127] This system mainly consists of two parts. The first part is the graphical interface UI, and the second part is the algorithm recognition and detection module. The content of human-computer interaction is mainly to display images, data, and abnormal driving detection results of drivers in real time, and to control certain systems. The driver abnormal behavior detection module is mainly to identify the driver's behavior such as making phone calls and not looking forward while driving, and the detection system will issue corresponding alarm prompts. The module design of the system is as follows: Figure 7 As shown:
[0128] In the system, Figure 7 Detection system and accessories Figure 6 The relationship between the system visualization interface is attached Figure 6 Yes Figure 7 Description of the entire system's processing of the driver abnormal behavior detection module and its internal logic;
[0129] According to the different requirements of each module, the user interface is divided into three modules: image display area, driver abnormal driving behavior detection result display area and system control area. Figure 8 shown.
Claims
1. A driver abnormal behavior detection system based on multiple views, characterized in that: Including human-computer interaction UI module and driver abnormal behavior detection module; The human-computer interaction UI module is used by the driver to obtain instructions through touch or voice recognition, and returns the most matching result according to the driver's needs to achieve natural human-computer interaction; The driver abnormal behavior detection module is used to process the input video information through the proposed behavior detection algorithm and feed back the results to the driver in the form of voice, image and text information.
2. The multi-view based driver abnormal behavior detection system according to claim 1, characterized in that: The human-computer interaction UI module includes image and parameter display, behavior detection and recognition result display, and system control and operation; The image and parameter display is used to display the parameters of abnormal actions detected in the video; The behavior detection and recognition result display is used to display the abnormal behavior of the driver after detection and indicate the type of abnormal behavior information; The system control and operation are used to handle the interaction functions between the driver and the system.
3. The multi-view based driver abnormal behavior detection system according to claim 1, characterized in that: The driver abnormal behavior detection module includes video stream input, abnormal behavior recognition and voice prompts; The video stream input is used to transmit the video information collected by the sensor into the system; The abnormal behavior recognition is used to process and analyze the input information through feature extraction, convolution, and feature fusion operations using an improved image classification algorithm; The voice prompt is used to feed back the processing result to the background and to remind the driver by voice.
4. The multi-view based driver abnormal behavior detection system according to claim 1, characterized in that: The system visualization interface is a visualization of the human-computer interaction UI module and the driver abnormal behavior detection module, including the driver abnormal behavior visualization interface, behavior recognition and data processing; The abnormal behavior visualization interface is used to display the functions, operation interface and display area of the system; The data processing is used to remove noise and outliers, normalize and remove redundant information from the data collected from different perspectives; The behavior recognition is used to detect abnormal behavior of the driver through an algorithm.
5. The multi-view based driver abnormal behavior detection system according to claim 4, characterized in that: The data processing includes dual-view image and multi-view image combination; The dual-view image is used to collect driver behavior information from two different perspectives; the two perspectives are located directly in front of the driver and 45° to the right; The multi-view image combination is used to perform a feature fusion on the image information of the dual-viewing angles; Multi-view image combination includes integrating the data extracted from different angles, inputting the input feature map into two branches for processing at the same time, and then splicing the feature maps obtained by the two branches in the channel direction, and using a convolution layer composed of a 1*1 convolution kernel to perform dimensionality reduction.
6. The multi-view based driver abnormal behavior detection system according to claim 4, characterized in that: The behavior recognition includes an improved MVCNN and a classifier; The improved MVCNN is used to improve the traditional CNN for image recognition; a module MMobNet is added to the MVCNN basic framework, which consists of a feature extraction module, a feature fusion module and a classification module; The classifier is used to classify the abnormal behavior information after being processed by the algorithm; the classification task is performed through the output vector of the Softmax function.
7. A detection method for a driver abnormal behavior detection system based on multiple views according to any one of claims 1 to 6, characterized in that: The steps include: Step 1: Obtain driver behavior data through sensors with different viewpoints and create a multi-view driving behavior dataset; Step 2: Take the data set in step 1 and use the feature extraction module to extract multi-scale feature information from the data set image; Step 3: Fusing the multi-scale feature information through a feature fusion module to output a multi-view feature map; Step 4: The classification module is used to classify the feature map obtained from the feature fusion module through the classifier; The final result is to judge the specific abnormal behavior according to the different behavior identification methods.
8. The detection method of a multi-view driver abnormal behavior detection system according to claim 7, characterized in that: In step 2: The specific steps of extracting multi-scale feature information are to remove the fully connected layer of CNN, use the convolutional layer to extract Conv features, scale the image to obtain multiple images of different sizes, and then input them into CNN to extract Conv features and perform feature aggregation, and finally merge the features corresponding to images of different sizes.
9. The detection method of a multi-view based driver abnormal behavior detection system according to claim 7, characterized in that: In step 3: (1) Extract spatial features from the feature maps of all images using a scheme based on the Spatial Attention Module (SAM); The feature map size obtained in the feature extraction layer is [B, 576, 7, 7], where B is the batch size, 576 is the number of channels, and 7*7 is the height and width of the feature map; In the channel direction, globalmax pooling and globalmean pooling are used to perform global maximum pooling and global average pooling. The two [B, 1, 7, 7] are concatenated to obtain [B, 2, 7, 7]. Then a 1*1 filter is used for convolution. After the activation function Sigmoid, the obtained [B, 1, 7, 7] is the spatial feature of each image. (2) View-based spatial feature weight learning The acquired spatial features of the image are weighted based on the view, that is, the spatial feature attention mechanism of the view. After obtaining the spatial features of [B, 1, 7, 7], the feature map size is converted, and a num_views scale is added, that is, the scale of the number of views, to obtain [B / num_views, num_views, 1, 7, 7], where B is set to b*num_views when the image is input, so B / num_views is always an integer; the images in a batchsize are divided according to the number of views (num_views), and the method of continuous input of images at the same time is used when the image is input, so that the view attention mechanism acts on multiple views within a time; since the second dimension size is 1, this dimension is omitted and then converted to [B / num_views, num_views, 7, 7], the second dimension of the feature map refers to the number of views (num_views), and the feature map can be represented as B / num_views groups of features, each group is B / num_views 7*7 features, that is, B / num_views groups of spatial features of multi-view feature maps; then global max is performed on the spatial features Pooling and global mean pooling are performed to implement global maximum pooling and global average pooling, and two feature maps [B / num_views, num_views, 1, 1] are obtained. The two feature maps are sent to a two-layer neural network. The number of 1*1 filters in the first layer is 1024, and the number of filters in the second layer is restored to num_views. ReLU is used as the activation function in the middle. Finally, the two feature maps output by the neural network are added together, and then activated by the Sigmoid function to obtain the final view-based attention feature after weight learning. Finally, the view attention feature is multiplied with the corresponding multi-view feature map to obtain a multi-view feature map after view weight learning.
10. The detection method of a multi-view based driver abnormal behavior detection system according to claim 7, characterized in that: In step 4: The full convolution layer with three layers of convolution replaces the usual fully connected layer, and the Dropout layer and h-swish activation function are used between the convolution layers; The feature map size obtained from the feature fusion module is [B, 576, 7, 7], the convolution kernel size of the first convolution layer is 7*7, the number is 576, and the output is [B, 576, 1, 1]; The convolution kernel size of the second convolution layer is 1*1, the number is 1024, and the output is [B, 1024, 1, 1]; The convolution kernel size of the third convolution layer is 1*1, the number is the number of task classifications, and the output is [B,nclasses,1,1], where nclasses is the number of task classifications. The classifier outputs a predicted probability for each possible category.
Citation Information
Patent Citations
Vehicle driving behavior detection and early warning system and method based on deep learning
CN109953763A
Driving behavior detection method based on multiple view angles
CN118015600A
Driver abnormal behavior recognition method, device and equipment and storage medium
CN118097626A
Driver fatigue detection method and system based on combining a pseudo-3d convolutional neural network and an attention mechanism
US20230154207A1
