A Distracted Driving Behavior Detection Method Based on Cascaded Convolutional Neural Networks
By using a cascaded convolutional neural network model and optimization techniques, the problems of improper model training parameter selection, inaccurate feature extraction, and overfitting in distracted driving detection were solved, achieving higher detection accuracy and generalization ability.
Patent Information
- Application Number
- CN202411724928.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-11-28
AI Technical Summary
Existing methods for detecting distracted driving suffer from poor detection results and insufficient generalization ability due to improper selection of model training parameters, inaccurate image feature extraction, and model overfitting.
A cascaded convolutional neural network model, including a main network and an auxiliary network, is adopted. The model is optimized through Dropout layers and gradient pruning, combined with data augmentation techniques, and a reasonable loss function and training parameters are designed to improve feature extraction and generalization capabilities.
It significantly improved detection accuracy, reduced loss values, enhanced the model's generalization ability, and improved detection performance.
Smart Images

Figure CN119672681B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of distracted driving behavior detection technology, specifically relating to a distracted driving behavior detection method based on a cascaded convolutional neural network. Background Technology
[0002] Distracted driving is one of the main causes of traffic accidents. When drivers use mobile phones, talk to passengers, or adjust music while driving, their attention is diverted, thus increasing the risk of traffic accidents. Detecting abnormal distracted driving behavior can help improve road driving safety.
[0003] Traditional distracted driving detection methods primarily rely on sensor devices such as cameras and radar, monitoring driver eye movements, head posture, or vehicle operation. These methods are susceptible to environmental factors like changes in lighting and obstructions, and are also costly, complex to install and maintain. Image-based detection methods can effectively reduce equipment costs. Convolutional Neural Networks (CNNs) are deep learning models specifically designed for processing image data, addressing the shortcomings of early artificial intelligence in image processing. CNNs consist of multiple convolutional layers, pooling layers, and fully connected layers. They extract image features through convolutional operations and use pooling layers for dimensionality reduction, minimizing parameters and overfitting risks. Compared to traditional neural networks, CNNs can efficiently learn features from grid-structured data and are widely used in natural language processing, scene classification, and other fields.
[0004] In recent years, some scholars have used deep learning methods to learn driver behavior characteristics from image data through models such as CNNs, achieving automatic detection of distracted driving behavior. However, the performance of these models is limited because a single network structure cannot fully extract complex features from images and neglects to optimize the loss value. For example, Zhu Hao used two models, MMobNet and MEMNet, for multi-task joint analysis. In his research, the model achieved an accuracy of 88.16%, which was about 0.64% higher than the corresponding single-task model MMobNet, but the final accuracy was still not very high. Zhao Ji, based on a lightweight network, introduced an attention mechanism and multiple coupling strategies, and obtained the accuracy of different coupling strategies. Among them, the L2 concatenation strategy performed the best, with an average accuracy of 93.93%. His proposed lightweight model performed excellently, with fewer parameters, faster processing speed, and lower computational cost compared to traditional models, but there is still room for improvement in accuracy. He Liwen trained four models, MobileNetV2, GhostNet, Improved-MobileNetV2, and Improved-GhostNet, respectively, and obtained training accuracies of 84.8%, 85.9%, 89.2%, and 88.6%. By adopting the idea of cascading, the two models with relatively ideal accuracy, Improved-MobileNetV2 and Improved-GhostNet, were linearly fused, and the accuracy reached 98.90%, and the loss value also increased to 1.4721. This method significantly improved the accuracy, but neglected the optimization of the loss value.
[0005] The existing detection methods have the following three problems:
[0006] (1) Inappropriate selection of model training parameters: Among similar distracted driving detection methods based on deep learning algorithms, there are two situations: low accuracy and stable loss value or high accuracy and high loss value, which lead to poor detection results.
[0007] (2) Image feature extraction is inaccurate, the structure is not robust, and the detection accuracy is not high: Existing distracted driving detection methods often fail to accurately capture subtle changes in driver behavior when extracting image features, resulting in poor detection results.
[0008] (3) Model overfitting and insufficient generalization ability: In real life, due to the diversity of driving environment and driver behavior, when processing data, the model is prone to overfitting to the majority class samples, while the detection effect on the minority class samples is poor, the model is unstable and the generalization ability is insufficient. Summary of the Invention
[0009] To address the aforementioned shortcomings in existing technologies, this invention provides a distracted driving behavior detection method based on cascaded convolutional neural networks, which solves the problems of inappropriate model training parameter selection, inaccurate image feature extraction, and model overfitting in existing detection methods.
[0010] To achieve the aforementioned objectives, the technical solution adopted by this invention is as follows: a method for detecting distracted driving behavior based on a cascaded convolutional neural network, comprising the following steps:
[0011] S1. Establish a cascaded convolutional neural network model, including interconnected main and auxiliary networks;
[0012] S2. Optimize and train the cascaded convolutional neural network model to obtain a trained cascaded convolutional neural network model.
[0013] S3. Input the image to be detected into the trained cascaded convolutional neural network model. The trained cascaded convolutional neural network model classifies the image to be detected to obtain the distracted driving behavior detection result.
[0014] Further: In S1, the main network includes an input layer, a first convolutional layer, a first pooling layer, a second convolutional layer, a second pooling layer, a third convolutional layer, a third pooling layer, a fourth convolutional layer, a fourth pooling layer, and an output layer connected in sequence;
[0015] The first convolutional layer has 32 3x3 convolutional kernels, the second convolutional layer has 64 3x3 convolutional kernels, the third convolutional layer has 128 3x3 convolutional kernels, and the fourth convolutional layer has 256 3x3 convolutional kernels.
[0016] The pooling window size for the first through fourth pooling layers is 2x2.
[0017] Further: In S1, the auxiliary network includes a first to a fourth fully connected layer connected in sequence, and the first fully connected layer is also connected to the flattened output layer;
[0018] The first fully connected layer has 32 neurons, the second fully connected layer has 64 neurons, the third fully connected layer has 128 neurons, and the fourth fully connected layer has 256 neurons.
[0019] The beneficial effects of the above-mentioned further scheme are: compared with the existing single cascaded convolutional neural network, the main network adds a 3x3 convolutional layer with 256 convolutional kernels and a pooling layer, which allows the model to learn more abstract and complex features.
[0020] Further: In S2, the method for optimizing the cascaded convolutional neural network model includes:
[0021] The Dropout layer is added to the cascaded convolutional neural network model. The complexity of the cascaded convolutional neural network model is adjusted by the Dropout layer according to a preset probability parameter, where the preset probability parameter is 0.25.
[0022] Gradient clipping is added to the cascaded convolutional neural network model. The gradient magnitude of the cascaded convolutional neural network model is limited by setting a gradient threshold, where the gradient threshold is 0.05, limiting the gradient to the interval [-0.05, 0.05].
[0023] The beneficial effects of the above-mentioned further scheme are as follows: the auxiliary network is composed of four fully connected layers stacked together. Through these fully connected layers, the features extracted by the main network are further transformed and enhanced, thereby extracting richer and more abstract feature information to assist the upper-level main network in making more accurate predictions, thereby achieving the goal of improving accuracy.
[0024] Further: In S2, the dataset used for training the cascaded convolutional neural network model is a preprocessed driver state detection dataset. The method for obtaining the preprocessed driver state detection dataset is as follows:
[0025] A1. Obtain the original dataset, specifically Distracted Driver Detection. The images in the original dataset are divided into 10 categories: safe driving, texting with the right hand, making a phone call with the right hand, texting with the left hand, making a phone call with the left hand, radio tuning, drinking a beverage, reaching into the back seat, tidying up one's appearance, and talking to a passenger.
[0026] A2. Augment the original dataset and use the augmented dataset as the preprocessed driver state detection dataset. The specific augmentation method is as follows:
[0027] Perform rotation, translation, cropping, scaling, or horizontal flipping operations on the images in the original dataset.
[0028] Further: In S2, the method for training the cascaded convolutional neural network model is specifically as follows:
[0029] B1. Set the batch size and epochs for training the cascaded convolutional neural network model. Set the batch size to 40 and the epochs to 6.
[0030] B2. Set the loss function for the cascaded convolutional neural network model;
[0031] B3. Train the cascaded convolutional neural network model according to the set batch size, epochs and loss function.
[0032] Furthermore: In B2, the loss function The specific expression is:
[0033]
[0034] In the formula, t i For the first i One-hot encoding of the true label of each sample y i For the cascaded convolutional neural network model, the first i The predicted output for each sample, N This refers to the batch size.
[0035] Further: In step S3, the method for classifying the image to be detected using the trained cascaded convolutional neural network model includes the following steps:
[0036] S31. Input the image to be detected into the main network, and extract low-level features from the image to be detected through the main network to obtain the first feature map;
[0037] S32. Input the first feature map into the auxiliary network, and learn the high-level feature representation in the first feature map through the auxiliary network to obtain the classification result of the image to be detected.
[0038] The beneficial effects of this invention are as follows: This invention provides a distracted driving behavior detection method based on a cascaded convolutional neural network. Compared with the prior art, this invention has the following advantages:
[0039] (1) The model training parameters were optimized, which significantly improved the detection effect. In view of the problem of poor detection effect caused by improper selection of model training parameters in existing methods, this invention improves the accuracy of the model and reduces the loss value by carefully handling the pre-training operations, such as reasonably determining the batch size and epochs and selecting a suitable loss function for the model.
[0040] (2) Enhance image feature extraction capabilities and improve detection accuracy. Existing methods are often not precise enough and their structures are not robust enough in image feature extraction. This invention introduces the concept of cascading and designs a cascaded convolutional neural network model that combines a main network and an auxiliary network, which can extract feature information from images more deeply. The main network is responsible for extracting low-level features, while the auxiliary network further transforms and enhances the features extracted by the main network, thereby extracting richer and more abstract feature information.
[0041] (3) Effectively reduces model overfitting and improves generalization ability. Existing methods are prone to overfitting when dealing with complex and ever-changing driving environments and driver behaviors, resulting in poor detection performance of minority class samples and insufficient generalization ability. This invention effectively increases the diversity of training data and reduces model overfitting by adding optimization techniques such as Dropout layers, gradient clipping, and data augmentation. Attached Figure Description
[0042] Figure 1 This is a flowchart of a distracted driving behavior detection method based on a cascaded convolutional neural network according to the present invention.
[0043] Figure 2 The data recorded during the training process of Example 1. Detailed Implementation
[0044] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0045] Example 1:
[0046] like Figure 1 As shown, in one embodiment of the present invention, a method for detecting distracted driving behavior based on a cascaded convolutional neural network includes the following steps:
[0047] S1. Establish a cascaded convolutional neural network model, including interconnected main and auxiliary networks;
[0048] S2. Optimize and train the cascaded convolutional neural network model to obtain a trained cascaded convolutional neural network model.
[0049] S3. Input the image to be detected into the trained cascaded convolutional neural network model. The trained cascaded convolutional neural network model classifies the image to be detected to obtain the distracted driving behavior detection result.
[0050] In this embodiment, the present invention designs a cascaded convolutional neural network model (Cascade_Cnn) composed of a main network and an auxiliary network. The main network is responsible for extracting low-level features, such as edges and textures, from the original image. Compared with existing basic CNN models, it adds a 3x3 convolutional layer with 256 kernels and a pooling layer, allowing the model to learn more abstract and complex features. The auxiliary network is designed as a fully connected neural network, consisting of only four fully connected layers stacked together. Through these fully connected layers, the auxiliary network can learn higher-level feature representations in the data, that is, further transform and enhance the features extracted by the main network, thereby extracting richer and more abstract feature information to assist the main network in making more accurate predictions, thus improving accuracy.
[0051] In S1, the main network includes an input layer, a first convolutional layer, a first pooling layer, a second convolutional layer, a second pooling layer, a third convolutional layer, a third pooling layer, a fourth convolutional layer, a fourth pooling layer, and an output layer connected in sequence.
[0052] The first convolutional layer has 32 3x3 convolutional kernels, the second convolutional layer has 64 3x3 convolutional kernels, the third convolutional layer has 128 3x3 convolutional kernels, and the fourth convolutional layer has 256 3x3 convolutional kernels.
[0053] The pooling window size for the first through fourth pooling layers is 2x2.
[0054] As shown in Table 1, in this embodiment, the main network adds a 3x3 convolutional layer with 256 convolutional kernels and a pooling layer to the existing basic CNN model structure. Adding an extra convolutional layer allows the model to learn more abstract and complex features.
[0055] Table 1. Detailed Structure of the Main Network
[0056]
[0057] In S1, the auxiliary network includes a first to a fourth fully connected layer connected in sequence, and the first fully connected layer is also connected to the flattened output layer.
[0058] The first fully connected layer has 32 neurons, the second fully connected layer has 64 neurons, the third fully connected layer has 128 neurons, and the fourth fully connected layer has 256 neurons.
[0059] To improve the accuracy of model predictions, this invention constructs an auxiliary network. As shown in Table 2, the auxiliary network is a fully connected neural network consisting of only four fully connected layers stacked together. Through these fully connected layers, the auxiliary network can learn higher-level feature representations from the data, that is, further transform and enhance the features extracted by the main network, thereby extracting richer and more abstract feature information to assist the main network in making more accurate predictions, thus achieving the goal of improving accuracy.
[0060] Table 2. Specific Structure of the Auxiliary Network
[0061]
[0062] In S2, the method for optimizing the cascaded convolutional neural network model includes:
[0063] The Dropout layer is added to the cascaded convolutional neural network model. The complexity of the cascaded convolutional neural network model is adjusted by the Dropout layer according to a preset probability parameter, where the preset probability parameter is 0.25.
[0064] Because deep learning models contain numerous hidden layers and consist of multiple layers of non-linear operations, while enhancing the model's learning ability, this also increases the model's complexity and may lead to overfitting. Dropout, a regularization technique, reduces the risk of overfitting and improves the model's generalization ability. In this embodiment, a Dropout layer is added to randomly discard a portion of the neurons' outputs, thereby reducing the network's complexity. After multiple experiments in a test environment, the preset probability parameter dropout_rate (the probability of each neuron being retained) was finally set to 0.25.
[0065] Gradient clipping is added to the cascaded convolutional neural network model. The gradient magnitude of the cascaded convolutional neural network model is limited by setting a gradient threshold, where the gradient threshold is 0.05, limiting the gradient to the interval [-0.05, 0.05].
[0066] In this embodiment, gradient clipping is a technique that truncates the gradient during backpropagation. By limiting the magnitude of the gradient, it avoids the problem of increased training loss due to gradient explosion and other reasons. To improve the stability and convergence of the model and alleviate some indirect causes of increased loss, this invention uses gradient clipping. Specifically, a threshold is set to limit the magnitude of the gradient, preventing the model's loss from exceeding a pre-defined range during training. Regarding the threshold setting, if the threshold is set too low, gradient information will be severely lost, and the model optimization process will become very slow; if a large gradient threshold is retained, too much gradient information will be retained, causing excessive unnecessary noise. Both situations may adversely affect the model training process. After multiple experiments in the test environment, the gradient threshold clip_value was finally set to 0.05, limiting the gradient to the interval [-0.05, 0.05].
[0067] In step S2, the dataset used for training the cascaded convolutional neural network model is a preprocessed driver state detection dataset. The method for obtaining the preprocessed driver state detection dataset is as follows:
[0068] A1. Obtain the original dataset, specifically Distracted Driver Detection. The images in the original dataset are divided into 10 categories: safe driving, texting with the right hand, making a phone call with the right hand, texting with the left hand, making a phone call with the left hand, radio tuning, drinking a beverage, reaching into the back seat, tidying up one's appearance, and talking to a passenger.
[0069] In this embodiment, the present invention uses the Distracted Driver Detection dataset as the original dataset, which contains 22,424 training images and 79,726 test images, with an image size of 640×480. The training set used for model training consists of 22,424 motion images collected from 26 drivers during driving, and these images are divided into 10 categories.
[0070] A2. Augment the original dataset and use the augmented dataset as the preprocessed driver state detection dataset. The specific augmentation method is as follows:
[0071] Perform rotation, translation, cropping, scaling, or horizontal flipping operations on the images in the original dataset.
[0072] The original image data was reduced to a small number of pixels, leading to more misclassifications and increased loss values during model classification. To address this issue, this embodiment augments the image data by rotating, translating, cropping, scaling, and horizontally flipping it. This generates more diverse and richer training samples, allowing the model to access more similar data. When faced with unfamiliar but similar data, the model can better adapt, significantly improving its generalization ability. Therefore, this invention expands the original dataset using this method to enhance data representation by inputting more similar but different data into the model, exploring whether other more easily identifiable features can be extracted.
[0073] In one scenario, the original data image is flipped vertically and horizontally to expand it into new data. This new data is then used to train the model, ensuring that the model can successfully classify the new data into the preset category, rather than into other irrelevant categories.
[0074] In S2, the specific method for training the cascaded convolutional neural network model is as follows:
[0075] B1. Set the batch size and epochs for training the cascaded convolutional neural network model. Set the batch size to 40 and the epochs to 6.
[0076] B2. Set the loss function for the cascaded convolutional neural network model;
[0077] In this embodiment, the batch size and epochs must be determined before model training, and a loss function suitable for the neural network structure must be selected. Batch size refers to the number of input samples in each training batch, and epochs is the number of batches used to train the model. To ensure high reliability of the training data, the number of image samples in each batch (batch size) can be set relatively large during training. However, if the batch size is set too large, the epochs value must be appropriately reduced; otherwise, it will severely impact training time. Ultimately, after multiple tests and considering the GPU memory limitations of the training environment, this invention sets the batch size to 40 and the epochs to 6.
[0078] In B2, the loss function The specific expression is:
[0079]
[0080] In the formula, t i For the first iThe one-hot encoding of the true label of each sample is a vector of the same length as the number of categories. Only one element in the vector is 1, which corresponds to the true category of the sample, and the rest of the elements are 0. y i For the cascaded convolutional neural network model, the first i The predicted output of a sample, that is, the model's predicted output of the sample currently being processed, is a probability distribution vector. The length of the vector is equal to the number of categories, and each element represents the probability that the model predicts that the sample belongs to the corresponding category. The sum of the elements is equal to 1. N The batch size is the number of samples processed simultaneously in a single training iteration. During training, the data is divided into multiple mini-batches for processing, with each batch containing N samples.
[0081] In this embodiment, the loss function is one of the key metrics in the deep learning model testing process, used to measure the difference between the model's predicted values and the true values. The dataset selected in this invention contains images of 10 categories. Therefore, categorical cross-entropy is chosen as the model's loss function.
[0082] B3. Train the cascaded convolutional neural network model according to the set batch size, epochs and loss function.
[0083] In step S3, the method for classifying the image to be detected using a trained cascaded convolutional neural network model includes the following steps:
[0084] S31. Input the image to be detected into the main network, and extract low-level features from the image to be detected through the main network to obtain the first feature map;
[0085] S32. Input the first feature map into the auxiliary network, and learn the high-level feature representation in the first feature map through the auxiliary network to obtain the classification result of the image to be detected.
[0086] As shown in Table 3, in this implementation, to verify the model's performance, a basic CNN model (Common_Cnn) was constructed for comparison with experimental results. Common_Cnn is designed as a basic convolutional neural network model (Common_Cnn) containing three convolutional layers, each using a 3x3 convolutional kernel, and pooling layers employing a 2x2 max-pooling window and the ReLU activation function. In the output layer, the multidimensional data is first flattened into a one-dimensional vector using a flattening layer, then passed to a fully connected layer with 512 neurons, and finally output.
[0087] Table 3. Structure of Common_Cnn
[0088]
[0089] The cascaded convolutional neural network model and the basic CNN model are trained, and the data recorded during the training process is as follows: Figure 2 As shown, the last training batch was located, and the training accuracy was approximately 96.1%, the validation accuracy was approximately 97.8%, the training loss was approximately 0.2~0.4, and the validation loss was approximately 0.13~0.2.
[0090] As shown in Table 4, the cascaded convolutional neural network model is almost identical to the single convolutional neural network in terms of training accuracy and validation accuracy, but the loss value is increased by 0.1.
[0091] Table 4 Training data for Cascade_Cnn
[0092]
[0093] Example 2:
[0094] This embodiment is based on the experimental case provided in Embodiment 1, and is used to verify the effect of the present invention.
[0095] As shown in Table 5, the cascaded convolutional neural network model provided by this invention improves the accuracy on the training set by approximately 2-3 percentage points, while maintaining an accuracy of around 97% on the validation set. More surprisingly, the loss is reduced to 0.03. Compared to Common_Cnn, the loss is reduced by approximately 70%; compared to the unoptimized Cascade_Cnn, the loss is reduced by approximately 85%-88%.
[0096] Table 5 Comparison of Models
[0097]
[0098] In the journal "Distracted Driving Behavior Recognition Based on Convolutional Neural Networks," Luo Guantai et al. utilized the concept of transfer learning, building a multi-label network model based on the ResNet34 model and the number of attributes, resulting in an improved ResNet34_FC model. The experimental data is presented in Table 4 of Chapter 2.2 of the journal. The accuracy of the ResNet34 model was 90%, and the accuracy of the ResNet34_FC model was 93.5%. Although this method improved the model accuracy by 3.5 percentage points, it was still about 5 percentage points lower than the cascaded convolutional neural network model of this invention.
[0099] The journal article "Driver Distracted Driving Behavior Detection Based on Cascaded Convolutional Neural Networks" is most similar to the approach of this paper. Chen Jun et al. designed a cascaded convolutional neural network. The first-level network consists of a pre-screening convolutional network for distracted driving behavior. Then, using the idea of transfer learning, a finely tuned VGG model is used as the second-level network. The experimental data is shown in Table 3 of Chapter 3.4 of the journal. The accuracy of this cascaded convolutional neural network is 93.3%, which is about 5 percentage points lower than the cascaded convolutional neural network model of this invention.
[0100] Similar experiments can be found in the paper "Research on Distracted Driving Behavior Recognition Method Based on Deep Learning". The author, Lin Qi, started with the ResNet-50 network, optimized and improved the network, selected the ResNet-50 network as the backbone network, and introduced the SE attention mechanism module and four RFB receptive field modules into the network. Finally, a multi-scale fusion mechanism was added to this basis, thus obtaining the Ours-ResNet50 network model designed by Lin Qi. In Chapter 3.5.5, it is recorded that the prediction accuracy of this model reached 97.22%, which is similar to the accuracy of the Cascade_Cnn model in this paper. However, the authors of this paper also put a lot of effort into the hardware, combining the trained model with "Raspberry Pi + remote server" to create a complete detection system. While ensuring high accuracy, it also achieved fast, high frame rate real-time detection, which basically meets the standards for daily use.
[0101] Table 6 shows a comparison between the cascaded convolutional neural network model provided by this invention and existing technologies.
[0102] Table 6 Comparison of similar literature
[0103]
[0104] The beneficial effects of this invention are as follows: This invention provides a distracted driving behavior detection method based on a cascaded convolutional neural network. Compared with the prior art, this invention has the following advantages:
[0105] (1) The model training parameters were optimized, which significantly improved the detection effect. In view of the problem of poor detection effect caused by improper selection of model training parameters in existing methods, this invention improves the accuracy of the model and reduces the loss value by carefully handling the pre-training operations, such as reasonably determining the batch size and epochs and selecting a suitable loss function for the model.
[0106] (2) Enhance image feature extraction capabilities and improve detection accuracy. Existing methods are often not precise enough and their structures are not robust enough in image feature extraction. This invention introduces the concept of cascading and designs a cascaded convolutional neural network model that combines a main network and an auxiliary network, which can extract feature information from images more deeply. The main network is responsible for extracting low-level features, while the auxiliary network further transforms and enhances the features extracted by the main network, thereby extracting richer and more abstract feature information.
[0107] (3) Effectively reduces model overfitting and improves generalization ability. Existing methods are prone to overfitting when dealing with complex and ever-changing driving environments and driver behaviors, resulting in poor detection performance of minority class samples and insufficient generalization ability. This invention effectively increases the diversity of training data and reduces model overfitting by adding optimization techniques such as Dropout layers, gradient clipping, and data augmentation.
[0108] In the description of this invention, it should be understood that the terms "center," "thickness," "upper," "lower," "horizontal," "top," "bottom," "inner," "outer," and "radial," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying the relative importance or the number of technical features implicitly specified. Therefore, a feature defined by "first," "second," and "third" may explicitly or implicitly include one or more of that feature.
Claims
1. A method for detecting distracted driving behavior based on cascaded convolutional neural networks, characterized in that, Includes the following steps: S1. Establish a cascaded convolutional neural network model, including interconnected main and auxiliary networks; S2. Optimize and train the cascaded convolutional neural network model to obtain a trained cascaded convolutional neural network model. S3. Input the image to be detected into the trained cascaded convolutional neural network model, and classify the image to be detected through the trained cascaded convolutional neural network model to obtain the distracted driving behavior detection result. In S1, the main network includes an input layer, a first convolutional layer, a first pooling layer, a second convolutional layer, a second pooling layer, a third convolutional layer, a third pooling layer, a fourth convolutional layer, a fourth pooling layer, and an output layer connected in sequence. The first convolutional layer has 32 3x3 convolutional kernels, the second convolutional layer has 64 3x3 convolutional kernels, the third convolutional layer has 128 3x3 convolutional kernels, and the fourth convolutional layer has 256 3x3 convolutional kernels. The pooling window size for the first to fourth pooling layers is 2x2; In S1, the auxiliary network includes a first to a fourth fully connected layer connected in sequence, and the first fully connected layer is also connected to the flattened output layer. The first fully connected layer has 32 neurons, the second fully connected layer has 64 neurons, the third fully connected layer has 128 neurons, and the fourth fully connected layer has 256 neurons. In S2, the method for optimizing the cascaded convolutional neural network model includes: The Dropout layer is added to the cascaded convolutional neural network model. The complexity of the cascaded convolutional neural network model is adjusted by the Dropout layer according to a preset probability parameter, where the preset probability parameter is 0.
25. Gradient clipping is added to the cascaded convolutional neural network model. The gradient magnitude of the cascaded convolutional neural network model is limited by setting a gradient threshold, where the gradient threshold is 0.05, limiting the gradient to the interval [-0.05, 0.05].
2. The distracted driving behavior detection method based on cascaded convolutional neural networks according to claim 1, characterized in that, In step S2, the dataset used for training the cascaded convolutional neural network model is a preprocessed driver state detection dataset. The method for obtaining the preprocessed driver state detection dataset is as follows: A1. Obtain the original dataset, specifically Distracted Driver Detection. The images in the original dataset are divided into 10 categories: safe driving, texting with the right hand, making a phone call with the right hand, texting with the left hand, making a phone call with the left hand, radio tuning, drinking a beverage, reaching into the back seat, tidying up one's appearance, and talking to a passenger. A2. Augment the original dataset and use the augmented dataset as the preprocessed driver state detection dataset. The specific augmentation method is as follows: Perform rotation, translation, cropping, scaling, or horizontal flipping operations on the images in the original dataset.
3. The distracted driving behavior detection method based on cascaded convolutional neural networks according to claim 1, characterized in that, In S2, the specific method for training the cascaded convolutional neural network model is as follows: B1. Set the batch size and epochs for training the cascaded convolutional neural network model. Set the batch size to 40 and the epochs to 6. B2. Set the loss function for the cascaded convolutional neural network model; B3. Train the cascaded convolutional neural network model according to the set batch size, epochs and loss function.
4. The distracted driving behavior detection method based on cascaded convolutional neural networks according to claim 3, characterized in that, In B2, the loss function The specific expression is: In the formula, t i For the first i One-hot encoding of the true label of each sample y i For the cascaded convolutional neural network model, the first i The predicted output for each sample, N This refers to the batch size.
5. The distracted driving behavior detection method based on cascaded convolutional neural networks according to claim 1, characterized in that, In step S3, the method for classifying the image to be detected using a trained cascaded convolutional neural network model includes the following steps: S31. Input the image to be detected into the main network, and extract low-level features from the image to be detected through the main network to obtain the first feature map; S32. Input the first feature map into the auxiliary network, and learn the high-level feature representation in the first feature map through the auxiliary network to obtain the classification result of the image to be detected.
Citation Information
Patent Citations
Bus driver violation detection system based on neural network
CN109376634A