Distraction driving behavior classification method based on improved LSTM optimization super-dimensional calculation
By improving the LSTM optimization method and combining with the Aurora Optimizer, the real-time and hardware dependency problems of distracted driving behavior recognition in the prior art are solved, and efficient and accurate driving behavior classification is achieved.
Patent Information
- Application Number
- CN202510421408.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-06-17
AI Technical Summary
The prior art has problems such as insufficient real-time performance in the identification of distracted driving behavior, the impact of wearable devices on driving behavior, and the inability to handle occlusion in eye movement data. At the same time, the training parameters of neural network models are large, the calculation costs are huge, the training time is long, and the hardware requirements are high.
The distracted driving behavior classification method based on improved LSTM optimization super-dimensional calculation is adopted, and the images are encoded and feature clustered through the super-dimensional calculation model to form super-dimensional vectors, and the improved LSTM neural network is combined with the aurora optimizer for training and classification.
It improves detection accuracy and efficiency, shortens detection time, reduces training time and dependence on high-performance hardware, and significantly improves classification accuracy and recognition speed.
Smart Images

Figure CN120164043A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image classification, and particularly relates to a distracted driving behavior classification method based on improved LSTM for optimizing hyperdimensional computing. Background Art
[0002] As one of the most common means of transportation, automobiles have been deeply integrated into people's daily production and life.
[0003] Hyperdimensional Computing (HDC) is an emerging computing paradigm. It is based on the mathematical principles of hyperdimensional vector spaces and uses hyperdimensional (usually thousands of dimensions or more) vectors for data representation and processing. This method attempts to simulate the way the brain processes information and realizes the processing of complex problems through vector operations in a high-dimensional space, especially in the fields of pattern recognition, machine learning, and cognitive computing.
[0004] The core idea of hyperdimensional computing is to use extremely high-dimensional vectors to represent information. For example, traditional computing methods may use low-dimensional vectors (such as 2D or 3D), while hyperdimensional computing uses vectors with thousands of dimensions or more. Each vector element is usually randomly generated and has a value of ±1 or 0.
[0005] Currently, most of the methods for identifying distracted driving behaviors use deep learning methods. For example, based on the vehicle's speed, acceleration, and the angular velocity of the wheel rotation to judge the driving state, based on wearable devices to judge the driver's various physical data to determine whether the driver is distracted, and based on eye movement devices to analyze the driver's eye movements to determine whether there are distracted behaviors. Most commonly, methods of deep learning matching and computer vision are used.
[0006] Judging the driving state based on the vehicle's speed, acceleration, and the angular velocity of the wheel rotation, the real-time performance of this method cannot be guaranteed. Identifying based on wearable devices that collect the driver's physiological parameters, the wearable devices in this method may affect the driver's driving behavior. Identifying based on eye movement data, this method cannot block the driver's eyes, for example, the driver cannot wear sunglasses. These methods can all detect the driver's dangerous behaviors to a certain extent. However, they all use neural networks to detect the target. But as the difficulty of the processing task continues to increase, the training scale of the neural network model becomes more and more huge. Currently, the number of training parameters of these neural networks is generally more than one million. The huge amount of computation brings a long training time and higher requirements for hardware. The calculation of a large number of unindexed parameter tuning and floating-point data is difficult to perform on Internet of Things, embedded, and other devices. Summary of the Invention
[0007] Objective of the Invention: Aiming at the deficiencies of the existing technologies, the present invention proposes a method for classifying dangerous driving behaviors based on improved LSTM-optimized hyperdimensional computing, which greatly improves the efficiency within an acceptable range of detection accuracy, shortens the detection time, ensures driving safety to a greater extent, and most importantly, reduces a large amount of training time and dependence on high-performance hardware.
[0008] Technical Solution: The present invention discloses a method for classifying distracted driving behaviors based on improved LSTM-optimized hyperdimensional computing, which includes the following steps:
[0009] Step 1: Collect images of a driver performing different types of dangerous driving behaviors while driving, preprocess them to form a data set, and divide the data set into a training set and a test set;
[0010] Step 2: Construct a hyperdimensional computing model, encode different categories of images respectively, adjust them into hyperdimensional vectors through convolution and pooling encoding, perform feature clustering on the extracted information features, complete image feature binarization, classify the same categories, and form category hyperdimensional vectors;
[0011] Step 3: Perform training and testing of hyperdimensional computing on the data samples of the divided training set and test set, retrain the trained and tested samples with the AdaptHD model, calculate the similarity between the hyperdimensional vectors of the training samples and the category hyperdimensional vectors, remove the misclassified samples, and add them to the correct samples;
[0012] Step 4: Construct an improved LSTM neural network, which replaces the ADAM optimizer in the LSTM model with the aurora optimizer. The input of the improved LSTM neural network is the similarity between the hyperdimensional vectors of the training samples input during the AdaptHD retraining process and each category hyperdimensional vector, and the output is the probability values of different types of dangerous driving behaviors;
[0013] Step 5: Perform image classification according to the output probability values of different types of dangerous driving behaviors.
[0014] Further, the dangerous driving behaviors in Step 1 include images of making phone calls, sending text messages, drinking water, smoking, taking hands off the steering wheel, and communicating with passengers. Randomly flip and crop the images to expand the number of the data set, classify and sort them, and divide the data set. The ratio of the training set to the test set is 7:3.
[0015] Further, the specific encoding of different categories of images in Step 2 is as follows:
[0016] First, preprocess the images. Resize all images to 640*640*3 using the nearest neighbor interpolation method or convolution operation. Then, subject the adjusted sample images to four rounds of convolution and max pooling to extract and compress the information stored in the pictures. Finally, output a one-line super-dimensional vector, and perform feature clustering on the super-dimensional vector to complete the binarization of the image features and complete the encoding of the image.
[0017] Further, the specific process of obtaining the class super-dimensional vectors in step 2 is as follows:
[0018] Normalize the encoded feature vectors to obtain N b *N b super-dimensional vectors, called training super-dimensional vectors, denoted as z i , where i = 1, 2...N a *N b , that is, N a class super-dimensional vectors, and each class super-dimensional vector contains N b super-dimensional vectors;
[0019] Add the training super-dimensional vectors belonging to the same class through the addition operation in super-dimensional calculation to form a set, denoted as k = 1, 2,..., N a , and after normalization, obtain M a super-dimensional vectors, called class super-dimensional vectors, denoted as T m , where m = 1, 2,..., N b , and then store the class super-dimensional vectors together with their labels in the storage space.
[0020] Further, the AdaptHD model in step 3 is retrained based on iterative AdaptHD. By changing the value of α according to the average training error rate after multiple iterations, when the average error rate is larger, the value of α is larger, and vice versa. The AdaptHD model recalculates the similarity between all training samples and the class super-dimensional vectors, removes the misclassified training samples from the wrong class, and reinserts them into the correct class, as follows:
[0021]
[0022] where α is an adaptively changing weight. If a certain training sample in class is misclassified into , remove this super-dimensional vector from and add it to .
[0023] Further, when calculating the similarity between the training sample hyperdimensional vector and the class hyperdimensional vector, the normalized Hamming distance is selected to measure the similarity, or the cosine distance is used to calculate the similarity between the two vectors.
[0024] Further, when the improved LSTM neural network in step 3 calculates the loss value, the improved aurora optimizer is used to calculate the gradient of the model, specifically as follows:
[0025] In the aurora optimizer, the iterative process starts from an initial population generated based on pseudo-random numbers. The entire population is represented in the form of a matrix with N rows and D columns, where N represents the size of the candidate solutions included in the population, and D represents the scalable dimension of the solution space:
[0026]
[0027] Among them, UB and LB represent the boundaries of the solution space, R represents a random number sequence taking values in [0, 1]. In the aurora optimizer, search agents in the solution space are used to simulate the movement of a group of high-energy charged particles flying towards the polar center around the earth along the magnetic receptor;
[0028] The aurora ellipse wandering process is described as:
[0029] Ao = Levy(d) × (X avg (j) - X(i, j)) + LB + r1 × (UB - LB) / 2
[0030] Among them, Levy(d) is the Levy flight strategy, is the centroid position of the high-energy particle group, X(i, j) is the current position of the high-energy particle, and X avg (j) - X(i, j) represents the trend of particle movement. Ao is the complex change of the aurora ellipse simulated by the dispersion distribution of LF, driving the high-energy particles to move between the poles and the equator;
[0031] The aurora optimizer combines two methods: the gyration motion and the aurora elliptical walkway:
[0032] X new (i, j) = X(i, j) + r2 × (W1 × v(t) + W2 × Ao)
[0033] Among them, X new (i, j) is the position of the high-energy particle after the update is completed. r2 is the interference caused by the uncontrollable environmental factors where the particle is located, taking a value in [0, 1]; C is an integral constant. The charge q carried by the charged particle, the mass m, and the intensity of the earth's magnetic field B remain unchanged. C, q, and B are taken as 1, and m is 100; Two adaptive weights W1 and W2 are introduced and change with each iteration of the algorithm:
[0034]
[0035] Among them, the control equations of W1 and W2 are X new (i, j) is the weight of the rotational motion and the aurora ellipse walk. The weight of v(t) will increase with W1, and the weights of Ao and W2 will gradually decrease;
[0036] The particle collision strategy enables the aurora optimizer to leave the local optimum, that is:
[0037] X new (i, j) = X(i, j) + sin(r3 × π) × (X(i, j) - X(a, j)), r4 < K and r5 < 0.05
[0038]
[0039] Among them, X(i, j) represents any particle in the particle cluster. The collisions between particles become more frequent as the algorithm progresses, which is controlled by the collision probability K. r3, r4, and r5 are random values, taking values in [0, 1]. Finally, after the particle collision strategy, the particle swarm X new The position is updated, and the fitness of the new X is calculated. When the requirements are met, the loop is exited. If the requirements are not met, the velocity of each particle is updated again and the loop continues.
[0040] Furthermore, in the aurora optimizer, r1, r2, r3, r4, and r5 are all random numbers. The Chebyshev chaotic map and the piecewise chaotic map are used to randomly obtain random numbers:
[0041] Chebyshev: r(n + 1) = cos(λ · cos -1 r(n))
[0042]
[0043] Among them, r1, r3, and r5 use the Chebyshev chaotic map to obtain random numbers, and r2 and r4 use the piecewise chaotic map to obtain random numbers. In the Chebyshev chaotic map method, the chaotic map factor λ = 8. In the piecewise chaotic map, the chaotic map factor d = 0.4. And when initially obtaining r1(1), r2(1), r3(1), r4(1), and r5(1), random acquisition is used.
[0044] Beneficial effects:
[0045] The present invention solves the binding problem in most connectionist models, such as the most typical neural networks, that is, there is no longer a need for a formal model between the correlation of every two values. Instead, hyperdimensional vectors with thousands of dimensions are used to represent different types of data. Most of these data are stored in binary and integer forms. This greatly reduces the amount of data calculation, simplifies the model training time, reduces the dependence on hardware, and no longer requires high-performance hardware devices for long-term training of the model. The improved LSTM significantly increases the classification accuracy. Compared with the conventional neural network model, the combination of hyperdimensional computing and the improved LSTM greatly speeds up the recognition speed and increases the classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is the hyperdimensional computing model framework of the present invention;
[0047] Figure 2 is the flowchart of the training and recognition model of the present invention;
[0048] Figure 3 is the encoding model diagram of the present invention;
[0049] Figure 4 is the hyperdimensional computing + LSTM network structure diagram of the present invention;
[0050] Figure 5 is the network structure diagram of the aurora optimizer of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0051] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and cannot be used to limit the protection scope of the present invention.
[0052] The present invention discloses a distracted driving behavior classification method based on improved LSTM to optimize hyperdimensional computing, which specifically includes the following processes:
[0053] 001 Collect pictures of the driver performing different types of dangerous driving while driving. Collect from different angles, such as taking pictures from the side of the co-driver's seat and taking pictures of the driver's front. And use RGB format pictures during the day and near-infrared format pictures at night. Dangerous driving behaviors include making phone calls, sending text messages, drinking water, smoking, taking hands off the steering wheel, communicating with passengers, and then randomly flip and crop these pictures to expand the number of the dataset. Classify and categorize these photos, and divide the dataset. The ratio of the training set to the test set is 7:3.
[0054] 002 Build a hyperdimensional computing model. First, different categories of images are encoded respectively, then after processing, they are put into the category hyperdimensional vectors, and finally, the pictures in the validation set are used for similarity check to identify the pictures.
[0055] During the encoding process, as shown by Figure 3 , through four times of convolution and max pooling methods, the information stored in the picture is extracted and compressed, and finally a one-line super-dimensional vector is output. Then, feature clustering is performed on the feature vector to complete the binarization of the image features. The encoding of the image is completed.
[0056] The encoded feature vectors are standardized to obtain N a *N b super-dimensional vectors, called training super-dimensional vectors, denoted as z i (i = 1, 2... N a *N b ). That is, N a category super-dimensional vectors, and each category super-dimensional vector contains N b super-dimensional vectors.
[0057] The training super-dimensional vectors belonging to the same category are added through the addition operation in the super-dimensional calculation to form a set, denoted as After standardization, M a super-dimensional vectors are obtained, called category super-dimensional vectors, denoted as T m (m = 1, 2,..., N b ). Then, this category super-dimensional vector and its label are stored together in the storage space called the associative memory.
[0058] 003 When the memory information continues to increase, being affected by other incorrect features will lead to errors in the super-dimensional calculation. Therefore, it is necessary to add the AdaptHD retraining model. The specific process operations are as follows:
[0059]
[0060] This method is based on iterative AdaptHD. By the average training error rate after multiple iterations, the value of α is changed. When the average error rate is larger, the value of α is larger; conversely, it is smaller. This method is based on iterative AdaptHD. By the average training error rate after multiple iterations, the value of α is changed. When the average error rate is larger, the value of α is larger; conversely, it is smaller. The AdaptHD retraining is equivalent to the process of calculating the classification accuracy rate in other algorithms. All the training samples are recalculated for similarity with the category super-dimensional vectors. The misclassified training samples are removed from the incorrect category and re-added to the correct category to strengthen the model's correct recognition of the sample and remove the incorrect recognition.
[0061] 004 After the retraining is completed, an LSTM neural network is added, as shown by Figure 4As shown, LSTM is a special type of Recurrent Neural Network (RNN). By introducing the cell state C(t) throughout the network, it achieves the effect of long-term memory. And by using three gating mechanisms, namely the forget gate, the input gate, and the output gate, to control the information flow, it solves the long-term dependency problem in the RNN model. The cell state is updated at each time step and contains information about the long-term dependencies in the sequence. The forget gate generates a value between 0 and 1 through a Sigmoid activation function, and this value is multiplied by the cell state for filtering. The input gate consists of two parts: a Sigmoid layer determines which values will be updated, and a Tanh layer generates new candidate values, which are multiplied by the Sigmoid output to determine how to update the cell state. The output gate determines which information of the cell state will be passed to the next moment through a Sigmoid layer, and at the same time, this information passes through a Tanh function to generate a normalized output.
[0062] When calculating the loss value, originally LSTM used the Adam optimizer. In this invention, LSTM is improved to use the improved Aurora optimizer to calculate the gradients of the model. The following introduces the improved Aurora optimizer.
[0063] The Aurora optimizer is an algorithm based on the aurora phenomenon or aurora. The aurora is a unique natural wonder that occurs when high-energy particles in the solar wind converge at the Earth's poles and are affected by the Earth's magnetic field and atmosphere. The Aurora optimizer is a unique particle motion model proposed by analyzing the motion of high-energy particles and deeply studying the basic principles of physics. This model combines gyration motion and aurora elliptical walking. The former is beneficial for local exploration, and the latter is beneficial for global exploration. Through the collaborative combination of these two strategies, the Aurora optimizer achieves a balance between local exploration and global exploration.
[0064] In the Aurora optimizer, the iterative process starts from an initial population generated based on pseudo-random numbers. The entire population is represented in the form of a matrix with N rows and D columns, where N represents the size of the candidate solutions included in the population, and D represents the scalable dimension of the solution space.
[0065]
[0066] Among them, UB and LB represent the boundaries of the solution space, and R represents a sequence of random numbers taking values in [0, 1]. In the Aurora optimizer, search agents in the solution space are used to simulate the movement of a group of high-energy charged particles flying towards the polar center around the Earth's magnetic sensor.
[0067] Rotational motion is a method for finding the optimal solution in the aurora optimizer. In rotational motion, charged particles approaching the Earth interact with the Earth's magnetic field and undergo a rotational motion along the magnetic field lines. In a magnetic field, a charged particle is subjected to a centripetal force, causing it to perform a rotational motion along the magnetic field lines. This phenomenon can be described by the Lorentz force and Newton's second law. By combining these two forces, a first-order ordinary differential equation can be obtained: After considering the damping effect of the atmosphere on charged particles, we can incorporate this damping phenomenon into the equation for the change of particle velocity with time, introducing a damping factor α, that is The equation of the solution where C is the integration constant. In this equation, the charge q carried by the charged particle, the mass m, and the intensity B of the Earth's magnetic field remain unchanged. For simplicity, in this strategy, C, q, and B are taken as 1, and m is 100. The damping factor α is a random value taken from [1, 1.5].
[0068] The aurora elliptical walk is a method that helps to effectively search the solution space. The complex undulations of the aurora elliptical walk will have a significant impact on the global search. It is precisely this unpredictable chaos that meets the requirements of the aurora optimizer for a rapid global search of the solution space. This process can be described as:
[0069] Ao = Levy(d) × (X evg (j) - X(i,j)) + LB + r1 × (UB - LB) / 2
[0070] Levy(d) is the Levy flight strategy, is the centroid position of the high-energy particle swarm, X(i,j) is the current position of the high-energy particle, and X avg (j) - X(i,j) represents the trend of particle movement. Ao is the complex change of the aurora ellipse simulated by the dispersion distribution of LF, driving the high-energy particles to move between the poles and the equator.
[0071] The aurora optimizer combines the two methods of rotational motion and the aurora elliptical walk:
[0072] X new (i,j) = X(i,j) + r2 × (W1 × v(t) + W2 × Ao)
[0073] where, X new (i,j) is the position of the high-energy particle after the update is completed. r2 is the interference caused by uncontrollable environmental factors where the particle is located, taking a value from [0, 1]. To maximize the efficiency of local exploitation and global exploitation in this process, two adaptive weights W1 and W2 are introduced, which change with each iteration of the algorithm.
[0074]
[0075] Among them, W1 and W2 control the equations of X new (i,j) are the weights of the rotational motion and the aurora ellipse wandering in the weight, and the weight of v(t) will increase with W1, while the weights of Ao and W2 will gradually decrease. As the algorithm iterates, global search and local exploitation rely on the continuously changing weights to achieve balance and explore the optimal solution.
[0076] The particle collision strategy enables the aurora optimizer to escape from the local optimum. When high-energy particles fly from the sun towards the earth, slight collisions may occur. However, when these particles enter the atmosphere and converge within the aurora ellipse, collisions occur more frequently, resulting in the continuous change of the shape of the aurora. That is:
[0077] X new (i,j) = X(i,j) + sin(r3×π)×(X(i,j) - X(a,j)), r4 < K and r5 < 0.05
[0078]
[0079] Among them, X(i,j) represents any particle in the particle cluster. The collisions between particles become more frequent as the algorithm progresses and are thus controlled by the collision probability K. r3, r4, and r5 are random values, taking values in [0, 1].
[0080] Finally, after the particle collision strategy, the position of the particle swarm X new is updated, and the fitness of the new X is calculated. When the requirements are met, the loop is exited. If the requirements are not met, the velocity of each particle is updated again and the loop continues.
[0081] In the aurora optimizer, r1, r2, r3, r4, and r5 are all random numbers. Therefore, the present invention adopts the chebyshev chaotic mapping and the piecewise chaotic mapping to randomly obtain random numbers, which can better enhance the global search ability and improve the convergence speed.
[0082] x n+1 (chebyshev) = cos(λ·cos -1 x n ), λ = 8
[0083]
[0084] 005 After the model is built, training can begin. The dataset is randomly divided into a training set and a test set in a 7:3 ratio. The training set is randomly divided into small batches and fed into the built model for training. After training, the test set can be used to test the accuracy of the model. If the accuracy is within an acceptable range, the model is successfully trained. Once the model is successfully trained, it can be used to test new images. First, the new images are encoded and normalized to obtain the hyperdimensional vectors of the new images. Then, the similarity between the hyperdimensional vector and the class hyperdimensional vectors is calculated. Similarity is an important indicator for detecting images, and there are two calculation methods in different situations as follows:
[0085] Method 1: Use the normalized Hamming distance to measure similarity. This method is applicable to measuring the similarity of hyperdimensional vectors encoded using binary data types.
[0086] This formula is used to calculate the number of dimensions that are different between two hypermicro vectors A and B. n represents the number of dimensions.
[0087] H(A,B) = Ham / n
[0088] This formula is used to calculate the normalized Hamming distance. Therefore, in hyperdimensional calculations, it is defined that when the normalized Hamming distance between two hyperdimensional vectors is 0.5, the two hyperdimensional vectors are mutually pseudo-orthogonal. The closer the normalized Hamming distance is to 0, the better the similarity between the two hyperdimensional vectors. Conversely, the closer the normalized Hamming distance is to 1, the better the orthogonality. The normalized Hamming distance is equal to 0 or 1 only when all the elements in the two hyperdimensional vectors correspond exactly the same or are all different.
[0089] Method 2: Use the cosine distance to calculate the similarity between two vectors. This method is applicable to hyperdimensional vectors of non-binary data.
[0090]
[0091] Similar to the definition of vectors in mathematics, the closer the cosine distance between hyperdimensional vectors is to 0, the higher their orthogonality. The closer it is to 1, the higher their similarity. When all the elements correspond differently, the cosine distance is -1.
[0092] After calculating the similarity with all classes, it is input into the trained and optimized LSTM model. Through the obtained probability distributions of the six outputs, the one with the highest probability is the recognized distracted driving behavior.
[0093] Table 1 shows the experimental data of this embodiment. The hardware platform configuration information used in this experiment is as follows: The operating system is Windows 11, equipped with NVIDIA GeForce RTX 4080 Super with 16GB, the Python version is 3.11, the PyTorch version is 2.1.0, and the CUDA version is updated to 12.1. In terms of experimental parameters, the maximum input batch size is 32, the experiment is iterated 100 rounds, and the early stopping mechanism is turned off. The collected distracted driving behavior pictures are divided into a training set and a test set according to a ratio of 7:3. This experimental data is the model weight that performs best in the test set during 100 rounds of iteration. TOP1 represents that the most likely category predicted by the model is consistent with the true label, and TOP3 represents that the true label is included in the top three categories with the highest probabilities. FPS represents the amount of data that the model can process per second.
[0094] Table 1 Experimental data of the classification driving behavior classification method of different models
[0095] model Top1 Top3 FPS Resnet 78% 86% 735.2 Alexnet 82% 93% 592.7 the model of the present invention 86% 95% 1549.1
[0096] It can be seen from the experimental data that the model proposed by the present invention has stronger recognition performance than the Alexnet and Resnet models in both TOP1 and TOP3, and in terms of classification efficiency, it also far exceeds that of traditional neural network models.
[0097] The above embodiments are only for explaining the technical concept and characteristics of the present invention, and their purpose is to enable those who are familiar with this technology to understand the content of the present invention and implement it accordingly, and it cannot be used to limit the protection scope of the present invention. All equivalent transformations or modifications made according to the spirit and essence of the present invention should be covered within the protection scope of the present invention.
Claims
1. A distracted driving behavior classification method based on improved LSTM optimized hyperdimensional computing, characterized in that: The steps include: Step 1: Collect images of drivers performing different types of dangerous driving behaviors while driving, and form a data set after preprocessing, and divide the data set into a training set and a test set; Step 2: Build a hyperdimensional computing model, encode images of different categories separately, adjust them into hyperdimensional vectors through convolution and pooling coding, perform feature clustering on the extracted information features, complete image feature binarization, classify the same categories, and form category hyperdimensional vectors; Step 3: Perform hyperdimensional calculation training and testing on the data samples of the divided training set and test set, retrain the AdaptHD model on the trained and tested samples, calculate the similarity between the training sample hyperdimensional vector and the category hyperdimensional vector, remove the misclassified samples and add them to the correct samples; Step 4: construct an improved LSTM neural network, wherein the improved LSTM neural network uses the Northern Lights optimizer to replace the ADAM optimizer in the LSTM model, the improved LSTM neural network input is the similarity between the training sample hyperdimensional vector input during the AdaptHD retraining process and the hyperdimensional vector of each category, and the output is the probability value of different types of dangerous driving behaviors; Step 5: Classify the images according to the output probability values of different types of dangerous driving behaviors.
2. The distracted driving behavior classification method based on improved LSTM optimized hyperdimensional computing according to claim 1 is characterized in that: The dangerous driving behaviors in step 1 include images of making phone calls, sending text messages, drinking water, smoking, taking hands off the steering wheel, and communicating with passengers. The images are randomly flipped and cropped to expand the number of data sets, classified, and divided into data sets with a ratio of 7:3 between the training set and the test set.
3. The distracted driving behavior classification method based on improved LSTM optimized hyperdimensional computing according to claim 1, characterized in that: In step 2, encoding of images of different categories is performed as follows: First, the image is preprocessed. The size of all images is adjusted to 640*640*3 through nearest neighbor interpolation or convolution operation. The adjusted sample image is subjected to four convolutions and maximum pooling to extract and compress the information stored in the image. Finally, a hyperdimensional vector of one row is output, and then the hyperdimensional vector is feature clustered to complete the binarization of image features and complete the encoding of the image.
4. The distracted driving behavior classification method based on improved LSTM optimized hyperdimensional computing according to claim 3 is characterized in that: The specific steps of obtaining the category super-dimensional vector in step 2 are as follows: The encoded feature vector is normalized to obtain N a *N b A hyperdimensional vector, called a training hyperdimensional vector, denoted by z i , i=1,2…N a *N b , that is, N a Category hyperdimensional vectors, each category hyperdimensional vector contains N b hyperdimensional vector; The training hyperdimensional vectors belonging to the same category are combined into a set through the addition operation in hyperdimensional computing, which is recorded as After normalization, we get M a super-dimensional vector, called the category super-dimensional vector, denoted by T m , m=1,2,…N b , and then store the category hyperdimensional vector together with its label in the storage space.
5. The distracted driving behavior classification method based on improved LSTM optimized hyperdimensional computing according to claim 1, characterized in that: The AdaptHD model retraining in step 3 is based on iterative AdaptHD. The value of α is changed by the average training error rate after multiple iterations. When the average error rate is larger, the value of α is larger, and vice versa. The AdaptHD model recalculates the similarity between all training samples and the category hyperdimensional vector, removes the misclassified training samples from the wrong category, and re-adds them to the correct category, as follows: Among them, α is the weight of adaptive change. If it belongs to the category A training sample in Misclassified in in Remove the hyperdimensional vector from , and add it to middle.
6. The distracted driving behavior classification method based on improved LSTM optimized hyperdimensional computing according to claim 1, characterized in that: Calculate the similarity between the training sample hyperdimensional vector and the category hyperdimensional vector and choose to use the normalized Hamming distance to measure the similarity or use the cosine distance to calculate the similarity between the two vectors.
7. The distracted driving behavior classification method based on improved LSTM optimized hyperdimensional computing according to claim 1, characterized in that: When calculating the loss value, the improved LSTM neural network in step 3 uses the improved Aurora optimizer to calculate the gradient of the model, as follows: In the Aurora optimizer, the iteration process will start with an initial population generated based on pseudo-random numbers. The entire population is represented in the form of a matrix with size N rows and D columns, where N represents the size of the candidate solutions contained in the population and D represents the scalable dimension of the solution space: Among them, UB and LB represent the boundaries of the solution space, R represents a random number sequence with values in [0, 1]. In the Aurora Optimizer, a search agent in the solution space is used to simulate the movement of a group of high-energy charged particles flying toward the center of the Earth's pole around the magnetic receptors; The auroral ellipse movement process is described as: Ao=Levy(d)×(X avg (j)-X(i,j))+LB+r1×(UB-LB) / 2 Among them, Levy(d) is the Levy flight strategy, is the center of mass of the high-energy particle group, X(i,j) is the current position of the high-energy particle, and X avg (j)-X(i,j) represents the trend of particle movement, Ao is the complex change of the auroral ellipse simulated by the scattered distribution of LF, which drives the high-energy particles to move between the poles and the equator; The Aurora Optimizer combines the two methods of slewing motion and the Aurora oval walk: X new (i,j)=X(i,j)+r2×(W1×v(t)+W2×Ao) Among them, X new (i, j) is the position of the high-energy particle after the update is completed, r2 is the interference caused by the uncontrollable environmental factors of the particle, and takes the value of [0, 1]; C is the integration constant. The charge q, mass m and the strength of the Earth's magnetic field B carried by the charged particle remain unchanged. C, q and B are 1, and m is 100. Two adaptive weights W1 and W2 are introduced, which change with each iteration of the algorithm: Among them, W1 and W2 control equation X new The weights of the rotational motion and the auroral ellipse in (i, j), the weight of v(t) will increase with W1, and the weights of Ao and W2 will gradually decrease; The particle collision strategy enables the Aurora optimizer to leave the local optimum, namely: X new (i,j)=X(i,j)+sin(r3×π)×(X(i,j)-X(a,j)),r4<K and r5<0.05 Among them, X(i,j) represents any particle in the particle cluster. The collision between particles becomes more frequent as the algorithm proceeds, which is controlled by the collision probability K. r3, r4 and r5 are random values, taking values in [0, 1]. Finally, the particle cluster X is updated after the particle collision strategy. new The position of X is calculated, and the fitness of the new X is jumped out of the loop when the requirements are met. If the requirements are not met, the speed of each particle is updated again and the loop continues.
8. The distracted driving behavior classification method based on improved LSTM optimized hyperdimensional computing according to claim 7, characterized in that: In the Aurora optimizer, r1, r2, r3, r4 and r5 are all random numbers, and the Chebyshev chaotic map and piecewise chaotic map are used to randomly obtain random numbers: chebyshev:r(n+1)=cos(λ·cos -1 r(n)) Among them, R1, R3 and R5 use Chebyshev chaotic mapping to obtain random numbers, R2 and R4 use piecewise chaotic mapping to obtain random numbers, in the Chebyshev chaotic mapping method, the chaotic mapping factor λ=8, in the piecewise chaotic mapping, the chaotic mapping factor d=0.4, and when R1(1), R2(1), R3(1), R4(1) and R5(1) are first obtained, random acquisition is adopted.