EEG driving road rage emotion detection method, device, equipment, medium and program product

By constructing a graph structure model based on the phase correlation of EEG signal channels and combining it with a graph attention module, the problem of difficulty in capturing early signs in traditional road rage detection methods is solved, and efficient and accurate detection of road rage emotions in drivers is achieved.

CN121667722APending Publication Date: 2026-03-17TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511797176.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Traditional road rage detection methods cannot effectively capture early signs of road rage in drivers, making it difficult for detection systems to provide effective warnings.

Method used

By collecting multi-channel EEG signals from drivers during simulated driving, a graph structure model is constructed. The model is trained using the phase correlation between EEG signal channels and optimized using a graph attention module to detect road rage.

Benefits of technology

It improves the accuracy and timeliness of road rage detection, enhances the sensitivity to latent characteristics of road rage, and ensures the reliability and accuracy of early detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121667722A_ABST
    Figure CN121667722A_ABST
Patent Text Reader

Abstract

The invention discloses an EEG driving road rage emotion detection method, device and equipment, a medium and a program product, and belongs to the technical field of emotion recognition. Multi-channel electroencephalogram signals of a driver in a normal emotion and a road rage emotion are collected, emotion tags are added to the signals to construct samples, each channel in the electroencephalogram signal samples is used as a graph structure node, the phase correlation degree between the channels in the electroencephalogram signal samples is used as an edge weight, a graph structure is constructed, and the electroencephalogram signals are obtained. And training a to-be-trained EEG driving road rage emotion detection model by using the graph structure to obtain a trained EEG driving road rage emotion detection model used for detecting whether a driver has a road rage emotion during driving on a road surface. The synchronization degree between different channels is quantified through the phase correlation degree, the sensitivity to road rage recessive features is improved, the generalization ability of an EEG driving road rage emotion detection model is enhanced, and the accuracy of road rage emotion detection is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of emotion recognition, and particularly relates to an EEG driving road rage emotion detection method, device, equipment, medium and program product. BACKGROUND

[0002] Driver road rage emotion is an extreme state of anger caused by road environment pressure or internal psychological factors, which is easy to lead to aggressive driving behaviors such as dangerous overtaking, malicious overtaking, etc., and significantly increases the risk of traffic accidents.

[0003] Traditional road rage detection methods mainly rely on vehicle operating parameter monitoring and driver external behavior analysis, such as judgment through speed fluctuation, braking distance, facial expression recognition or voice emotion analysis. However, since road rage emotion has a high degree of implicit characteristics, there is often no obvious external manifestation before the emotion explodes, which makes it difficult for the detection system to capture early signs and cannot achieve effective early warning. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide an EEG driving road rage emotion detection method, device, equipment, medium and program product, which can solve the problem that the traditional road rage detection method cannot achieve effective early warning.

[0005] In order to solve the above technical problems, the present application is implemented as follows: In a first aspect, the embodiments of the present application provide an EEG driving road rage emotion detection method, comprising: During the simulation driving, a first electroencephalogram signal of M channels generated by a driver with normal emotion in handling a target event is collected, and a second electroencephalogram signal of M channels generated by a driver with road rage emotion in handling the target event is collected; A normal emotion label is added to the first electroencephalogram signal of the M channels, and a road rage emotion label is added to the second electroencephalogram signal of the M channels, to obtain an electroencephalogram signal sample of the M channels; The M channels are taken as M nodes, and a phase correlation degree between different channels in the electroencephalogram signal sample of the M channels is taken as an edge weight, to construct a graph structure corresponding to the electroencephalogram signal sample of the M channels; wherein the greater the phase correlation degree between two channels, the greater the corresponding edge weight; Based on the graph structure corresponding to the electroencephalogram signal sample of the M channels, a training is performed on an EEG driving road rage emotion detection model to be trained, to learn the phase correlation degree between different channels in the electroencephalogram signal sample of the M channels, and obtain a trained EEG driving road rage emotion detection model, which is used to detect whether the driver has road rage emotion during driving on the road.

[0006] Furthermore, it also includes: For the m-th channel among the M channels, a discrete Hilbert transform is performed on the EEG signal sample of the m-th channel to obtain the transformation result corresponding to the EEG signal sample of the m-th channel; Using the transformation result corresponding to the EEG signal sample of the m-th channel as the imaginary part and the EEG signal sample of the m-th channel as the real part, an analysis signal corresponding to the EEG signal sample of the m-th channel is constructed. Extract the instantaneous amplitude and instantaneous phase of the analysis signal corresponding to the EEG signal sample of the m-th channel; Based on the difference between the instantaneous phase of the first channel and the instantaneous phase of the second channel in the M channels, the phase correlation between the first channel and the second channel is determined. The phase correlation between the first channel and the second channel characterizes the phase synchronization and functional connectivity between the first brain region corresponding to the first channel and the second brain region corresponding to the second channel in the functional brain network. A phase correlation matrix is ​​constructed using the phase correlation between every two channels in the M channels as one element; Based on the phase correlation matrix, a graph structure corresponding to the EEG signal samples of the M channels is constructed.

[0007] Furthermore, based on the phase correlation matrix, a graph structure corresponding to the EEG signal samples of the M channels is constructed, including: For the m-th channel among the M channels, other channels with a phase correlation higher than the phase correlation threshold are selected, and the nodes corresponding to the selected other channels are taken as the neighbor nodes of the m-th node corresponding to the m-th channel. For the m-th node, an edge is connected between the m-th node and each of its neighboring nodes, with the edge weight being the phase correlation between the m-th channel and the other channels corresponding to that neighboring node, in order to construct the graph structure corresponding to the EEG signal samples of the M channels.

[0008] Furthermore, it also includes: For the m-th channel among the M channels, a short-time Fourier transform is performed on the EEG signal sample of the channel to obtain the power spectral density of the channel, which is used as the original feature vector of the m-th node corresponding to the m-th channel. Based on the graph structure corresponding to the EEG signal samples from the M channels, the EEG-based road rage detection model for driving, which is based on a graph attention module, is trained, including: The graph structure corresponding to the EEG signal samples of the M channels is input into the EEG driving road rage emotion detection model to be trained. Based on the original feature vectors of the M nodes and the edge weights corresponding to the M nodes, the emotion prediction results corresponding to the EEG signal samples of the M channels are obtained. Based on the emotion prediction results corresponding to the EEG signal samples of the M channels and the emotion labels pre-added to the EEG signal samples of the M channels, the model parameters of the EEG driving road rage emotion detection model to be trained are updated to obtain the EEG driving road rage emotion detection model that has been preliminarily trained. If the classification accuracy of the pre-trained EEG road rage detection model is lower than the target accuracy, a graph attention module is added to the pre-trained EEG road rage detection model to obtain an EEG road rage detection model with a graph attention module to be trained. Based on the graph structure corresponding to the EEG signal samples of the M channels, the EEG driving road rage detection model with graph attention module is trained to obtain the trained EEG driving road rage detection model.

[0009] Further, the graph attention module includes T graph attention layers, where T is an integer greater than or equal to 2; based on the graph structure corresponding to the EEG signal samples from the M channels, the EEG road rage detection model with the graph attention module is trained, including: The first graph attention layer in the T attention layers is used to update the original feature vector of the m-th node for the first time by using the original feature vectors of each of the m-th node's neighboring nodes, thus obtaining the first updated feature vector of the m-th node. By using the t-th graph attention layer in the EEG driving road rage emotion detection model to be trained, and using the t-1-th updated feature vectors of each neighboring node of the m-th node, the t-th updated feature vector of the m-th node is updated for the t-th time, thus obtaining the t-th updated feature vector of the m-th node. Based on the feature vector of the Mth node after the tth update and the edge weights corresponding to the Mth nodes, the emotion prediction results corresponding to the EEG signal samples of the M channels are obtained. Based on the emotion prediction results corresponding to the EEG signal samples of the M channels and the emotion labels pre-added to the EEG signal samples of the M channels, the model parameter information of the EEG driving road rage emotion detection model with graph attention module to be trained is updated to obtain the trained EEG driving road rage emotion detection model.

[0010] Furthermore, the M channels are determined according to the following steps: During simulated driving, EEG signals from various channels were collected from drivers exhibiting road rage during the first time period prior to the occurrence of the target event. During the simulated driving, electroencephalogram (EEG) signals from various channels of the driver exhibiting road rage were collected during a second time period following the occurrence of the target event. Short-time Fourier transforms were performed on the EEG signals corresponding to the first time period and the EEG signals corresponding to the second time period to obtain the corresponding power spectral density. For each of the aforementioned channels, determine the change in the power spectral density of the EEG signal before and after the event. Multiple channels whose transformation values ​​are higher than the target transformation value are identified as the M channels.

[0011] Secondly, embodiments of this application provide an EEG road rage detection device, characterized in that it includes: The acquisition module is used to acquire, during simulated driving, the first EEG signal of M channels generated by a driver with normal emotions handling a target event, and the second EEG signal of M channels generated by a driver with road rage handling the target event. The sample generation module is used to add a normal emotion label to the first EEG signal of the M channels and a road rage emotion label to the second EEG signal of the M channels, so as to obtain EEG signal samples of the M channels. The graph structure construction module is used to construct a graph structure corresponding to the EEG signal samples of the M channels, with the M channels as M nodes and the phase correlation between different channels in the EEG signal samples of the M channels as edge weights; wherein, the greater the phase correlation between two channels, the greater the corresponding edge weight. The model training module is used to train the EEG road rage detection model to be trained based on the graph structure corresponding to the EEG signal samples of the M channels, so as to learn the phase correlation between different channels in the EEG signal samples of the M channels, and obtain the trained EEG road rage detection model. The trained EEG road rage detection model is used to detect whether the driver has road rage while driving on the road.

[0012] Thirdly, embodiments of this application provide an electronic device, including: processor; Memory for storing processor-executable instructions; The processor is configured to execute the instructions to implement any of the EEG road rage detection methods described above.

[0013] Fourthly, embodiments of this application provide a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by a terminal's processor, enables the terminal to execute any of the EEG driving road rage detection methods described above.

[0014] Fifthly, embodiments of this application provide a computer program product, the computer program product including a computer program, which, when executed by a processor, implements any of the EEG driving road rage detection methods described above.

[0015] In this embodiment, multi-channel EEG signals from drivers in both normal and road rage states are collected, and emotion labels are added to the signals to construct samples. Each channel in the EEG signal sample is used as a node in a graph structure, and the phase correlation between the channels in the EEG signal sample is used as the edge weight to construct the graph structure. This graph structure is then used to train the EEG-based road rage detection model, resulting in a trained EEG-based road rage detection model that can detect whether a driver is experiencing road rage while driving on the road. By quantifying the synchronization degree between different channels using phase correlation, the sensitivity to latent road rage features is improved, enhancing the generalization ability of the EEG-based road rage detection model and ensuring the accuracy of road rage detection. Attached Figure Description

[0016] Figure 1 A flowchart illustrating the steps of an EEG method for detecting road rage while driving, according to an embodiment of this application, is shown. Figure 2 A topological diagram of the power spectral density of an electroencephalogram (EEG) signal provided in an embodiment of this application is shown. Figure 3 A schematic diagram of a phase correlation matrix provided in an embodiment of this application is shown; Figure 4 This application provides a flowchart illustrating the steps involved in training an EEG-based road rage detection model for driving, according to an embodiment of the present application. Figure 5 The flowchart illustrates the steps of training an EEG driving road rage detection model with a graph attention module according to an embodiment of this application. Figure 6 An example flowchart of an EEG road rage detection method provided in an embodiment of this application is shown; Figure 7 This invention provides a schematic diagram of the structure of an EEG road rage detection device according to an embodiment of the present application. Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0019] The following description, in conjunction with the accompanying drawings, details the EEG driving road rage detection method, apparatus, equipment, medium, and program products provided in this application through specific embodiments and application scenarios.

[0020] Road rage is an extreme emotion triggered by external factors in the road environment or internal factors within the driver, reflecting a complex interplay of psychological, social, and situational factors. Road rage can make drivers more aggressive and impair their ability to perceive risk. Aggressive driving behaviors such as following too closely, reckless overtaking, and deliberately cutting off other vehicles can rapidly escalate conflicts between drivers, potentially leading to traffic accidents or physical altercations.

[0021] Given the severity and risks of road rage incidents, existing technologies employ early detection systems capable of identifying precursory signs of aggressive driving. Early intervention can prevent situations from escalating and provide driver assistance systems with an opportunity to mitigate risks. Currently, many manufacturers have installed driver monitoring systems in Level 3 autonomous vehicles to identify road rage based on vehicle and behavioral data, such as facial expressions, vehicle speed, audio recordings, and physiological signals. However, road rage is often a latent phenomenon, with no obvious signs before reaching a critical threshold. Relying on these external manifestation detection methods may not be able to capture subtle changes in road rage in a timely and accurate manner.

[0022] To address the accuracy and timeliness issues of existing technologies in early road rage detection, this application provides an EEG-based method, apparatus, device, medium, and program product for detecting road rage. This method considers the connectivity and hidden information revealed by synchronization between EEG channels, improving the accuracy and timeliness of road rage detection.

[0023] Figure 1 A flowchart illustrating the steps of an EEG method for detecting road rage during driving, according to an embodiment of this application, is shown. (Refer to...) Figure 1 This application provides an EEG method for detecting road rage while driving, including: S10. During simulated driving, collect the first EEG signals of M channels generated by a driver with normal emotions handling the target event, and collect the second EEG signals of M channels generated by a driver with road rage handling the target event.

[0024] Specifically, the target event refers to a pre-set external stimulus in the simulated driving environment that can trigger the driver's emotional response. This is achieved through methods such as a virtual pedestrian entering the lane, an emergency braking of the vehicle in front, or a sudden change in traffic lights. The purpose is to acquire EEG signal samples related to the driver's emotional state under controllable conditions. The first EEG signal refers to the EEG signals from M channels that indicate normal emotions when the driver processes the target event; the second EEG signal refers to the EEG signals from M channels that indicate road rage when the driver processes the target event. The M channels refer to the effective channels in the EEG signals, where both the first and second EEG signals characterize the electrical activity of neurons in the cerebral cortex.

[0025] For example, M is set to 9, and nine channels of EEG signals are collected through an electrode array placed on the scalp. When the target event is a virtual pedestrian entering the lane, the moment when the collision time between the vehicle and the pedestrian reaches 2 seconds is defined as the emergency moment. Using the emergency moment as a reference point, two seconds are extended forward and backward as the event response time. During the event response time, EEG signals from nine channels of drivers with normal emotions and drivers with road rage are collected to obtain the first EEG signal and the second EEG signal. The first EEG signal representing normal emotions and the second EEG signal representing road rage are used to train the EEG driving road rage detection model to ensure the accuracy of the trained EEG driving road rage detection model in recognizing road rage.

[0026] In some embodiments, the M channels are determined according to the following steps: During simulated driving, EEG signals from various channels were collected from drivers exhibiting road rage during the first time period prior to the occurrence of the target event.

[0027] During the simulated driving, EEG signals from various channels were collected from drivers exhibiting road rage during a second time period following the occurrence of the target event.

[0028] Short-time Fourier transforms were performed on the EEG signals corresponding to the first time period and the EEG signals corresponding to the second time period to obtain the corresponding power spectral density.

[0029] For each channel in each channel, determine the change in the power spectral density of the EEG signal before and after the event.

[0030] Multiple channels whose transformation values ​​are higher than the target transformation value are identified as M channels.

[0031] Specifically, the first and second time periods refer to specific time windows before and after the target event, used to capture the comparison of EEG activity before and after emotional changes. The duration of the first and second time periods can be adjusted according to the typical EEG response cycle induced by road rage, providing a time-aligned comparison benchmark to identify emotion-induced changes in EEG activity. Power spectral density refers to the energy distribution of the EEG signal in the frequency domain, reflecting the intensity of different frequency components, used to quantify the intensity of EEG activity in each frequency band. Transformation refers to the degree of change in power spectral density before and after the event, which can be an absolute difference, a relative rate of change, or a standardized difference, used to effectively distinguish emotion-induced changes in EEG activity. The target transformation is a threshold parameter, derived based on historical transformation statistics, used to exclude noise channels and retain channels related to emotion.

[0032] For example, when the first time period is 500ms and the second time period is 100ms, in a simulated driving experiment, short-time Fourier transforms are performed on the EEG signals of the first and second time periods to obtain the power spectral density of each channel in the frequency range of 0.5-40Hz. The relative rate of change of the power spectral density of each channel before and after the event is calculated, and channels with a rate of change exceeding a preset threshold are selected as M channels for subsequent construction of the functional brain network. By selecting EEG channels with significant response characteristics to road rage, the problem of the functional brain network containing a large number of noisy channels caused by using fixed channels or empirical selection is avoided. This enables the constructed functional brain network to accurately capture the brain region-specific activity changes induced by road rage, thereby improving the sensitivity and reliability of road rage detection.

[0033] Figure 2 A topological diagram of the power spectral density of an electroencephalogram (EEG) signal provided in an embodiment of this application is shown. (Refer to...) Figure 2Following the order from left to right and top to bottom, each circle in the figure represents a channel numbered F3, FZ, F4, C3, CZ, C4, P3, PC, and P4. The moment when the collision between the vehicle and pedestrian reaches 1 second is defined as the emergency moment. Using this emergency moment as a time reference point, topological diagrams of the EEG signal power spectral density under normal and road rage emotions are plotted at -500ms, 100ms, and 1000ms, respectively. It can be seen that the EEG signal power spectral density is significantly increased under road rage compared to normal emotions. Among the nine channels shown in the figure, channels P3 and P4 exhibit the most significant changes in EEG signal power spectral density; therefore, at least channels P3 and P4 are considered as M channels.

[0034] S20. Add a normal emotion label to the first EEG signal of M channels, and add a road rage emotion label to the second EEG signal of M channels, to obtain EEG signal samples of M channels.

[0035] Specifically, the normal emotion label corresponds to the first EEG signal representing normal emotion, and the road rage emotion label corresponds to the second EEG signal representing road rage. By adding the normal emotion label and the road rage emotion label, EEG signal samples of M channels are obtained, which are used to construct a graph structure representing the functional connectivity between the channels.

[0036] S30. Using M channels as M nodes and the phase correlation between different channels in the EEG signal samples of the M channels as edge weights, construct a graph structure corresponding to the EEG signal samples of the M channels; wherein, the greater the phase correlation between two channels, the greater the corresponding edge weight.

[0037] Specifically, each node represents a specific brain region, and the edges between nodes represent functional connections between different brain regions. Phase correlation is used to quantify the degree of synchronization between signals from different EEG channels, characterizing the functional connectivity between different brain regions in the functional brain network. This can be achieved through methods such as phase lock value calculation, cross-correlation coefficient calculation, wavelet coherence analysis, or phase lag index evaluation. Using M channels as M nodes and the phase correlation between different channels in the EEG signal sample as edge weights, a graph structure is constructed. This accurately encodes the spatial topological characteristics of the EEG signal, enabling the EEG-based road rage detection model to capture the coordination and interaction between different brain regions in the EEG signal, thereby ensuring the accuracy of road rage recognition.

[0038] In some embodiments, the process of constructing a graph structure includes: For the m-th channel out of M channels, perform a discrete Hilbert transform on the EEG signal sample of the m-th channel to obtain the transformation result corresponding to the EEG signal sample of the m-th channel.

[0039] Using the transformation result corresponding to the EEG signal sample of the m-th channel as the imaginary part and the EEG signal sample of the m-th channel as the real part, construct the analysis signal corresponding to the EEG signal sample of the m-th channel.

[0040] Extract the instantaneous amplitude and instantaneous phase of the analysis signal corresponding to the EEG signal sample of the m-th channel.

[0041] Based on the difference between the instantaneous phase of the first channel and the instantaneous phase of the second channel in M ​​channels, the phase correlation between the first channel and the second channel is determined. The phase correlation between the first channel and the second channel characterizes the degree of phase synchronization and functional connectivity between the first brain region corresponding to the first channel and the second brain region corresponding to the second channel in the functional brain network.

[0042] Construct a phase correlation matrix using the phase correlation between every two channels in the M channels as one element.

[0043] Based on the phase correlation matrix, a graph structure corresponding to the EEG signal samples of M channels is constructed.

[0044] Specifically, the Discrete Hilbert Transform (DHT) is a mathematical transformation method that converts real-valued signals into analytic signals. It can be implemented using a combination of Fast Fourier Transform (FFT) and frequency domain filtering to separate the instantaneous characteristics of non-stationary EEG signals, avoiding the loss of phase information in traditional frequency domain analysis. The graph structure refers to a topological representation with channels as nodes and phase correlation as edge weights, implemented using adjacency matrices or sparse graph data structures. This provides high-fidelity topological input to graph neural networks, ensuring that edge weights strictly correspond to phase correlation values. The analytical signal refers to a complex signal composed of the real part of the EEG signal sample from the m-th channel and the imaginary part of the Hilbert transform result of the m-th channel's EEG signal sample. It is implemented using complex domain analytic representation to ensure signal analyticity, making the instantaneous phase definition unique and continuous, and avoiding phase ambiguity in the EEG signal. Instantaneous amplitude and instantaneous phase refer to the time-varying features extracted from the analytical signal, implemented by calculating the magnitude and argument of the complex signal. This is used to obtain the dynamic changes in the EEG signal and reflect the coordination of neural activity. Phase correlation is used to characterize the coupling strength of different brain regions in emotion processing, avoiding connectivity misjudgments caused by relying solely on amplitude features. The phase correlation matrix is ​​a square matrix organized into phase correlations of all channel pairs, implemented using a two-dimensional array storage structure. It is used to systematically encode whole-brain functional connectivity patterns, facilitating subsequent graphical model processing.

[0045] For example, in a simulated driving experiment, for an EEG signal from one channel, first, a Discrete Hilbert Transform is performed according to the following formula to obtain the Discrete Hilbert Transform value of that channel:

[0046] in, This represents the discrete Hilbert transform result of the nth channel. Indicates the nth channel The sequence after a delay of k sampling periods.

[0047] After obtaining the Discrete Hilbert Transform (DHT) result for one channel, the transform result corresponding to the EEG signal sample of that channel is obtained. Based on the transform result corresponding to the EEG signal sample of that channel, and using the transform result as the imaginary part and the EEG signal sample as the real part, the analysis signal corresponding to the EEG signal sample of that channel is constructed. For example, the analysis signal corresponding to the EEG signal sample of that channel is obtained using the following formula:

[0048] in, This represents the analysis signal corresponding to the EEG signal sample in the nth channel. This represents the EEG signal sample from the nth channel. This represents the transformation result corresponding to the EEG signal sample of the nth channel. This is a virtual part unit.

[0049] The instantaneous phase of the analysis signal corresponding to the EEG signal sample of each channel is extracted using the following formula:

[0050] in, This represents the instantaneous phase of the analytical signal corresponding to the EEG signal sample of the nth channel.

[0051] The difference between the instantaneous phase of the first channel and the instantaneous phase of the second channel is calculated using the following formula:

[0052] Where t represents time, f represents frequency, i represents the i-th channel, and j represents the j-th channel. This represents the instantaneous phase of the i-th channel. This represents the instantaneous phase of the j-th channel. This represents the instantaneous phase difference between the i-th channel and the j-th channel.

[0053] After obtaining the instantaneous phase difference between every two channels, the phase correlation between the first and second channels is determined by calculating the difference between the instantaneous phases of every two channels. A phase correlation matrix is ​​constructed using the phase correlation between every two channels in the M channels as one element, and a graph structure corresponding to the EEG signal samples of the M channels is constructed based on the phase correlation matrix.

[0054] Figure 3 A schematic diagram of a phase correlation matrix provided in one embodiment of this application is shown. (Refer to...) Figure 3 In the diagram, the color of each matrix corresponds to the difference between the instantaneous phases of two channels. The brighter the color, the stronger the phase correlation. It can be seen that under normal emotional state, the colors of each matrix are brighter and the phase correlation is stronger. Under road rage, the colors of each matrix are darker and the phase correlation is weaker, indicating that the phase correlation is higher under normal emotional state than under road rage.

[0055] In some embodiments, based on the phase correlation matrix, a graph structure corresponding to the EEG signal samples of M channels is constructed, including: For the m-th channel out of M channels, filter out other channels whose phase correlation with the m-th channel is higher than the phase correlation threshold, and take the nodes corresponding to the other filtered channels as the neighbor nodes of the m-th node corresponding to the m-th channel.

[0056] For the m-th node, connect the m-th node with each of its neighboring nodes, and the weight of each edge is the phase correlation between the m-th channel and the other channels corresponding to that neighboring node, so as to construct a graph structure corresponding to the EEG signal samples of M channels.

[0057] Specifically, the phase correlation threshold is a critical value used to distinguish between effective functional connections and noise interference. It can be implemented using a fixed threshold, an adaptive threshold based on statistical distribution, or a dynamically adjusted threshold. This application does not impose specific limitations. By setting the phase correlation threshold, weak connections caused by signal noise or random fluctuations can be filtered out, ensuring that only channels with strong functional connections to road rage recognition are retained.

[0058] For example, when constructing the graph structure, a threshold dynamically determined based on the statistical distribution of phase correlation in historical data is used as the phase correlation threshold. For each channel, other channels with phase correlation higher than the phase correlation threshold are selected through traversal comparison, and the nodes corresponding to these channels are defined as the neighbor nodes of the current channel node. Subsequently, undirected connections are established between the current node and each of its neighbor nodes, and the calculated phase correlation value is directly used as the edge weight, ultimately forming the graph structure corresponding to the EEG signal sample.

[0059] This embodiment selects channels with a phase correlation threshold above a certain threshold as neighboring nodes for each channel, ensuring that only physiologically significant strong functional connections are retained, thus avoiding noise interference from a large number of weak connections in the fully connected graph. Subsequently, connections are established between nodes and the selected neighboring nodes, using phase correlation as the edge weight, maintaining the continuity of functional connection strength information. This allows the constructed graph structure to more accurately reflect the functional connectivity changes in specific brain regions under road rage. This achieves both graph sparsity and enhanced physiological relevance, providing high-quality input data for subsequent training of EEG-based road rage detection models.

[0060] S40. Based on the graph structure corresponding to the EEG signal samples of M channels, train the EEG road rage detection model to be trained to learn the phase correlation between different channels in the EEG signal samples of M channels, and obtain the trained EEG road rage detection model. The trained EEG road rage detection model is used to detect whether the driver has road rage while driving on the road.

[0061] Figure 4 This document illustrates a flowchart of the steps involved in training an EEG-based road rage detection model for driving, according to an embodiment of this application. The training process for the EEG-based road rage detection model includes the following steps: S40. Based on the graph structure corresponding to the EEG signal samples from M channels, train the EEG-based road rage detection model for driving, including: S41. Input the graph structure corresponding to the EEG signal samples of M channels into the EEG driving road rage emotion detection model to be trained. Based on the original feature vectors of M nodes and the edge weights corresponding to M nodes, obtain the emotion prediction results corresponding to the EEG signal samples of M channels.

[0062] S42. Based on the emotion prediction results corresponding to the EEG signal samples of M channels and the emotion labels pre-added to the EEG signal samples of M channels, update the model parameters of the EEG road rage emotion detection model to be trained, and obtain the pre-trained EEG road rage emotion detection model.

[0063] S43. If the classification accuracy of the pre-trained EEG road rage detection model is lower than the target accuracy, add a graph attention module to the pre-trained EEG road rage detection model to obtain an EEG road rage detection model with a graph attention module to be trained.

[0064] S44. Based on the graph structure corresponding to the EEG signal samples of M channels, train the EEG driving road rage detection model with graph attention module to obtain the trained EEG driving road rage detection model.

[0065] S45. If the classification accuracy of the pre-trained EEG road rage detection model is lower than the target accuracy, add a graph attention module to the pre-trained EEG road rage detection model to obtain an EEG road rage detection model with a graph attention module to be trained.

[0066] S46. Based on the graph structure corresponding to the EEG signal samples of M channels, train the EEG road rage detection model with graph attention module to obtain the trained EEG road rage detection model.

[0067] In this embodiment, for the m-th channel among the M channels, a short-time Fourier transform is performed on the EEG signal sample of the channel to obtain the power spectral density of the channel, which is used as the original feature vector of the m-th node corresponding to the m-th channel.

[0068] Specifically, the Short-Time Fourier Transform (SFT) is a signal processing technique that converts a time-domain signal into a time-frequency domain representation. It can be implemented using window functions such as the Hamming window, Hanning window, or Blackman window to extract frequency domain features of EEG signals within different time windows, particularly the power spectral density, thereby capturing frequency-specific changes in brain activity during road rage. Power spectral density (PSD) represents the power distribution of an EEG signal in the frequency domain. It can be calculated using periodogram methods, Welch methods, or autoregressive models to quantify the activity intensity of different brain regions in specific frequency bands, providing more discriminative feature representations for nodes in the graph structure. The initial feature vector refers to the initial feature representation of nodes in the graph structure, specifically implemented using power spectral density vectors, differential entropy, or other time-frequency domain features. This provides initial information for nodes in the graph neural network, used for subsequent feature updates and information aggregation.

[0069] For example, since the EEG signal of each channel can be divided into five main frequency bands according to the frequency range, and the EEG signal of each channel can be divided into multiple parts by a time-sliding window, the power spectral density of the channel can be obtained by using a sliding window and short-time Fourier transform as the initial information of the corresponding node.

[0070] Specifically, the graph attention module refers to a graph neural network component that dynamically calculates the importance weights between nodes through an attention mechanism. It can be implemented using multi-head attention, self-attention, or gated attention mechanisms. By adaptively weighting and aggregating neighboring node features, it solves the problem of uneven distribution of phase correlation importance caused by fixed edge weights in the base model. Model parameter update refers to the process of adjusting model parameters based on the difference between the emotion prediction result and the pre-added emotion labels. It can be implemented using the backpropagation algorithm combined with optimizers such as stochastic gradient descent, Adam, or RMSprop, to enable the model to learn more accurate emotion classification capabilities. Target accuracy refers to a preset model performance threshold, which can be set according to the specific application scenario. This application embodiment does not impose specific restrictions. Target accuracy serves as a condition for determining whether to add a graph attention module, ensuring that the classification performance of the final model meets the actual application requirements.

[0071] For example, during the training of the EEG-based road rage detection model, a short-time Fourier transform is first performed on the EEG signal samples of each of the M channels to obtain the power spectral density of that channel, which serves as the original feature vector for the corresponding node. This converts the time-domain EEG signal into a frequency-domain representation, capturing the frequency-specific changes in brain activity during road rage. Then, the graph structure corresponding to the EEG signal samples of the M channels is input into the EEG-based road rage detection model. Based on the original feature vectors of the M nodes and the edge weights corresponding to the M nodes, the emotion prediction result is obtained. Next, based on the prediction result and pre-added emotion labels, the parameters of the model are updated, resulting in a pre-trained model. If the classification accuracy of this model is lower than the target accuracy, it indicates that the basic model has failed to adequately model the complex dependencies between nodes. In this case, a graph attention module is added to the model, forming a model with a graph attention mechanism. Finally, based on the same graph structure, the model with the graph attention module is retrained. By dynamically calculating the attention coefficients between nodes, neighboring node features are adaptively weighted and aggregated, and the interaction between node features and edge weights is deeply explored, thereby improving the ability of the EEG driving road rage emotion detection model to extract emotion-related brain network features. Through the organic combination of frequency domain feature extraction and the graph attention module, the training process of the road rage emotion detection model is optimized.

[0072] Table 1 shows the ablation experiment results provided in one embodiment of this application. Referring to Table 1, GAT refers to the graph attention module, and FBN refers to the feature extraction module, used to dynamically calculate the edge weights between two channels. In the case where the EEG road rage detection model does not include the FBN feature extraction module, the edge weights between the two channels are fixed values ​​between 0 and 1. It can be seen that after adding the graph attention module (i.e., GAT) and the FBN feature extraction module, the accuracy of the EEG road rage detection model is 93.42%, the accuracy of the model without the graph attention module is 83.7%, the accuracy of the model without the FBN feature extraction module is 82.06%, and the accuracy of the model without either the graph attention module or the FBN feature extraction module is 66.6%. Furthermore, the EEG road rage detection model with the graph attention module (i.e., GAT) and the FBN feature extraction module outperforms other models in all performance metrics (F1 score, retrieval, accuracy, and AUC).

[0073] Table 1 Ablation Experiment Results

[0074] This application's embodiments capture subtle frequency domain feature changes in EEG signals under road rage by acquiring the power spectral density of EEG samples from each channel. By adding a graph attention module, dynamic weight allocation of phase correlation between channels is achieved, enabling the model to adaptively focus on brain region connections most discriminative for emotion classification. This not only improves the accuracy of road rage detection but also enhances the model's ability to extract emotion-related features from EEG signals, making the EEG-based road rage detection model more robust and adaptable in practical applications.

[0075] Figure 5 This document illustrates a flowchart of the steps involved in training an EEG-based road rage detection model with a graph attention module, according to an embodiment of this application. (Refer to...) Figure 5 The graph attention module includes T graph attention layers, where T is an integer greater than or equal to 2. S46. Based on the graph structure corresponding to the EEG signal samples from M channels, train the EEG road rage detection model with the graph attention module, including: S46.1. Using the first graph attention layer among the T attention layers, the original feature vector of the m-th node is updated for the first time by using the original feature vectors of each neighboring node of the m-th node, thus obtaining the first updated feature vector of the m-th node.

[0076] S46.2. Using the t-th graph attention layer in the EEG driving road rage emotion detection model to be trained, the t-th updated feature vector of the m-th node is updated by using the (t-1)-th updated feature vector of each neighboring node of the m-th node, and the t-th updated feature vector of the m-th node is obtained.

[0077] S46.3. Based on the feature vector of the Mth node after the tth update and the edge weights corresponding to the M nodes, the emotion prediction results corresponding to the EEG signal samples of the M channels are obtained.

[0078] S46.4. Based on the emotion prediction results corresponding to the EEG signal samples of M channels and the emotion labels pre-added to the EEG signal samples of M channels, update the model parameter information of the EEG driving road rage emotion detection model to be trained with graph attention module, and obtain the trained EEG driving road rage emotion detection model.

[0079] Specifically, the graph attention module comprises a cascaded architecture of multiple (two or more) graph attention layers. This architecture enhances the model's ability to model complex dependencies between nodes through hierarchical feature extraction, avoiding the limitations of single-layer structures in representing the dynamic characteristics of functional brain networks. The first graph attention layer is the initial processing unit within the graph attention module. It performs feature aggregation operations based on the original feature vectors of neighboring nodes, specifically through a combination of linear transformation and attention coefficient calculation. This preserves the original time-frequency domain features of the EEG signal, providing a reliable foundation for subsequent hierarchical learning. The t-th graph attention layer refers to all other graph attention layers besides the first one. It employs a mechanism of weighted summation of normalized attention weights and feature vectors, using iteratively updated feature vectors for multiple rounds of feature extraction. This allows the node feature representations to progressively capture the gradual dependencies from local phase synchronization to global functional connectivity, improving the model's sensitivity to the dynamic changes in the brain network under road rage.

[0080] For example, in this embodiment, the graph attention module includes at least two graph attention layers, enabling the model to extract node features in stages. First, the first graph attention layer uses the original feature vectors of neighboring nodes to initially update the current node features, ensuring that the feature update process retains the unprocessed power spectral density information. Subsequently, subsequent graph attention layers use the previously updated feature vectors for iterative optimization, gradually enhancing the node features at each layer based on higher-level contextual information. Finally, based on the multi-layered updated high-level feature vectors and edge weights, an emotion prediction result is generated, and the difference between the emotion prediction result and the pre-added emotion labels drives the model parameter update, resulting in a trained EEG driving road rage emotion detection model. The graph attention module, composed of multiple graph attention layers, captures the complex hierarchical dependencies between nodes in the functional brain network, effectively improving the EEG driving road rage emotion detection model's ability to learn phase correlation and ensuring the accuracy of road rage emotion detection.

[0081] For example, Figure 6 An example flowchart of an EEG method for detecting road rage during driving, according to an embodiment of this application, is shown. (Refer to...) Figure 6 In training the EEG-based road rage detection model, the first step is to construct a dataset including target events. This dataset is used to arouse emotions and simulate the EEG signal acquisition scenario during driving. In practice, an EEG cap equipped with an electrode array is worn on the driver's head to collect EEG signals. The target events are presented to the driver on a screen, and a simulator is used to allow the driver to simulate driving behavior. Thus, when viewing the target events, the driver may maintain a normal emotional state or experience road rage, generating corresponding driving behavior data.

[0082] Next, an event response time window was defined, and signals were collected for specific time periods. The moment when the collision between the vehicle and pedestrian reached 2 seconds was defined as the emergency moment. Based on the emergency moment, a total of 4 seconds was created by extending forward and backward by 2 seconds. Within this event response time window, EEG signals and driving behavior data of drivers in both normal and road rage states were collected.

[0083] Then, signal processing and sample labeling were performed. Through feature extraction, nine channels of EEG signals representing normal emotions and nine channels of EEG signals representing road rage (i.e., the first EEG signal and the second EEG signal) were obtained from the acquired EEG signals. The nine channels of EEG signals correspond to nine electrode channels on the EEG cap numbered F3, FZ, F4, C3, CZ, C4, P3, PC, and P4, respectively. Subsequently, by labeling the first EEG signal with a normal emotion label and the second EEG signal with a road rage label, M channels of EEG signal samples were obtained.

[0084] Next, for each pair of channels (i.e., each combination of two channels) in each EEG signal sample, the instantaneous phase of each channel is first calculated using Hilbert transform. Then, the phase lock value between the two channels is calculated using the difference between their instantaneous phases, thus quantifying the phase correlation between the two channels. Based on these phase lock values, an adjacency matrix representing the connectivity between channels can be constructed. This adjacency matrix is ​​combined with the original features of each channel to construct a corresponding graph structure data for the M-channel EEG signal samples. The constructed graph structure data is then used to train the EEG road rage detection model, resulting in the trained EEG road rage detection model.

[0085] When detecting road rage, the EEG driving road rage detection model, after training, outputs the emotion recognition result through the first graph attention convolutional layer, the first ReLU activation layer, the second graph attention convolutional layer, the second ReLU activation layer, and the fully connected layer, indicating whether the driver's current emotional state is normal or road rage.

[0086] The embodiments of this application have the following technical effects: This application embodiment collects multi-channel EEG signals from drivers under normal and road rage states, adds emotion labels to the signals to construct samples, and uses each channel in the EEG signal sample as a node in a graph structure, with the phase correlation between the channels as edge weights. This graph structure is then used to train an EEG-based road rage detection model, resulting in a trained model capable of detecting road rage in drivers on the road. By quantifying the synchronization between different channels using phase correlation, the sensitivity to latent road rage features is improved, enhancing the generalization ability of the EEG-based road rage detection model and ensuring the accuracy of road rage detection.

[0087] Figure 7 A schematic diagram of the structure of an EEG road rage detection device according to an embodiment of this application is shown. (Refer to...) Figure 7 This application provides an EEG road rage detection device, comprising: The acquisition module 100 is used to acquire, during simulated driving, the first EEG signal of M channels generated by a driver with normal emotions handling a target event, and the second EEG signal of M channels generated by a driver with road rage handling a target event. The sample generation module 200 is used to add normal emotion labels to the first EEG signals of M channels and road rage emotion labels to the second EEG signals of M channels, so as to obtain EEG signal samples of M channels. The graph structure construction module 300 is used to construct a graph structure corresponding to the EEG signal samples of the M channels, with M channels as M nodes and the phase correlation between different channels in the EEG signal samples of the M channels as edge weights; wherein, the greater the phase correlation between two channels, the greater the corresponding edge weight. The model training module 400 is used to train the EEG road rage detection model to be trained based on the graph structure corresponding to the EEG signal samples of M channels. It learns the phase correlation between different channels in the EEG signal samples of M channels to obtain the trained EEG road rage detection model. The trained EEG road rage detection model is used to detect whether the driver has road rage while driving on the road.

[0088] In some embodiments, the graph structure construction module 300 includes: The transformation unit is used to perform a discrete Hilbert transform on the EEG signal sample of the m-th channel out of M channels, so as to obtain the transformation result corresponding to the EEG signal sample of the m-th channel.

[0089] The first construction unit is used to construct the analysis signal corresponding to the EEG signal sample of the m-th channel, with the transformation result corresponding to the EEG signal sample of the m-th channel as the imaginary part and the EEG signal sample of the m-th channel as the real part.

[0090] The extraction unit is used to extract the instantaneous amplitude and instantaneous phase of the analysis signal corresponding to the EEG signal sample of the m-th channel.

[0091] The determination unit is used to determine the phase correlation between the first channel and the second channel based on the difference between the instantaneous phase of the first channel and the instantaneous phase of the second channel in the M channels. The phase correlation between the first channel and the second channel characterizes the phase synchronization and functional connectivity between the first brain region corresponding to the first channel and the second brain region corresponding to the second channel in the functional brain network.

[0092] The second building unit is used to construct a phase correlation matrix, with the phase correlation between every two channels in the M channels as one element.

[0093] The third building unit is used to construct the graph structure corresponding to the EEG signal samples of M channels based on the phase correlation matrix.

[0094] In some embodiments, the third building unit includes: The filtering subunit is used to filter out other channels whose phase correlation with the m-th channel is higher than the phase correlation threshold for the m-th channel among M channels, and to take the nodes corresponding to the other filtered channels as the neighbor nodes of the m-th node corresponding to the m-th channel.

[0095] Construct sub-units to connect each neighboring node of the m-th node with an edge, where the edge weight is the phase correlation between the m-th channel and the other channels corresponding to that neighboring node, in order to construct a graph structure corresponding to the EEG signal samples of M channels.

[0096] In some embodiments, it also includes: For the m-th channel out of M channels, perform a short-time Fourier transform on the EEG signal sample of that channel to obtain the power spectral density of that channel, which is then used as the original feature vector of the m-th node corresponding to the m-th channel.

[0097] Model training module 400, including: The input unit is used to input the graph structure corresponding to the EEG signal samples of M channels into the EEG driving road rage emotion detection model to be trained. Based on the original feature vectors of M nodes and the edge weights corresponding to M nodes, the emotion prediction results corresponding to the EEG signal samples of M channels are obtained.

[0098] The labeling unit is used to update the model parameters of the EEG road rage detection model to be trained based on the emotion prediction results corresponding to the EEG signal samples of M channels and the emotion labels pre-added to the EEG signal samples of M channels, so as to obtain the EEG road rage detection model after preliminary training.

[0099] The graph attention module unit is used to add a graph attention module to the initially trained EEG road rage detection model when the classification accuracy is lower than the target accuracy, thus obtaining an EEG road rage detection model to be trained with a graph attention module.

[0100] The training unit is used to train the EEG road rage detection model with a graph attention module based on the graph structure corresponding to the EEG signal samples of M channels, so as to obtain the trained EEG road rage detection model.

[0101] In some embodiments, the graph attention module includes T graph attention layers, where T is an integer greater than or equal to 2. The training unit includes: The first update subunit is used to update the original feature vector of the m-th node for the first time by using the original feature vectors of each of the m-th node's neighboring nodes through the first graph attention layer in the T attention layers, so as to obtain the first updated feature vector of the m-th node.

[0102] The second update subunit is used to update the (t-1)th feature vector of the m-th node by using the t-th graph attention layer in the EEG road rage emotion detection model to be trained, and the feature vectors of each neighbor node of the m-th node after the (t-1)th update. This results in the t-th updated feature vector of the m-th node.

[0103] The emotion prediction result subunit is used to obtain the emotion prediction result corresponding to the EEG signal sample of M channels based on the feature vector of the Mth node after the tth update and the edge weights corresponding to the M nodes.

[0104] The parameter update subunit is used to update the model parameter information of the EEG road rage detection model with graph attention module to be trained, based on the emotion prediction results corresponding to the EEG signal samples of M channels and the emotion labels pre-added to the EEG signal samples of M channels, so as to obtain the trained EEG road rage detection model.

[0105] In some embodiments, the acquisition module 100 includes: The first acquisition unit is used to acquire EEG signals from various channels of a driver exhibiting road rage during the first time period before the target event occurs, during simulated driving.

[0106] The second acquisition unit is used to acquire EEG signals from various channels of a driver exhibiting road rage during a second time period following the occurrence of the target event, during simulated driving.

[0107] The Fourier transform unit is used to perform short-time Fourier transforms on the EEG signals corresponding to the first time period and the EEG signals corresponding to the second time period to obtain the corresponding power spectral density.

[0108] The power spectral density transformation determination unit is used to determine the transformation amount of the power spectral density of the EEG signal before and after the event for each channel in each channel.

[0109] The channel determination unit is used to determine M channels from multiple channels whose transformation amount is higher than the target transformation amount.

[0110] Figure 8 A schematic diagram of the structure of an electronic device according to an embodiment of this application is shown. (Refer to...) Figure 8 This application also provides an electronic device, including: processor.

[0111] Memory is used to store processor-executable instructions.

[0112] The processor is configured to execute instructions to implement any of the EEG methods for detecting road rage in drivers.

[0113] In this embodiment, the computer device includes a processor, memory, and network interface connected via a system bus.

[0114] The computer device's processor provides computational and control capabilities. Its memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs in the non-volatile storage media. The computer device's database stores data samples. Its network interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements any EEG method for detecting road rage while driving.

[0115] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0116] This application also provides a computer-readable storage medium, which, when the instructions in the computer-readable storage medium are executed by the processor of a terminal, enables the terminal to execute any EEG driving road rage detection method.

[0117] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0118] Optionally, a readable storage medium can be coupled to the processor, enabling the processor to read information from and write information to the readable storage medium. Alternatively, the readable storage medium can be an integral part of the processor. The processor and the readable storage medium can reside in application-specific integrated circuits (ASICs). Of course, the processor and the readable storage medium can also exist as discrete components in the device.

[0119] This application also provides a computer program product, which includes a computer program that, when executed by a processor, implements any of the EEG road rage detection methods.

[0120] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0121] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0122] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0123] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0124] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0125] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

[0126] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0127] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0128] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. An EEG driving road rage emotion detection method, characterized in that, The method comprises: During the simulation driving, a first electroencephalogram signal of M channels generated by a driver with normal emotion in handling a target event is collected, and a second electroencephalogram signal of M channels generated by a driver with road rage emotion in handling the target event is collected; The first electroencephalogram signal of the M channels is added with a normal emotion label, and the second electroencephalogram signal of the M channels is added with a road rage emotion label, to obtain an electroencephalogram signal sample of the M channels; The M channels are taken as M nodes, and phase correlation degrees between different channels in the electroencephalogram signal sample of the M channels are taken as edge weights, to construct a graph structure corresponding to the electroencephalogram signal sample of the M channels; wherein the greater the phase correlation degree between two channels is, the greater the corresponding edge weight is; Based on the graph structure corresponding to the electroencephalogram signal sample of the M channels, an EEG driving road rage emotion detection model to be trained is trained, to learn the phase correlation degrees between different channels in the electroencephalogram signal sample of the M channels, and obtain a trained EEG driving road rage emotion detection model, which is used to detect whether a driver has road rage emotion during driving on the road.

2. The method of claim 1, wherein, The method further comprises: For an mth channel in the M channels, discrete Hilbert transform is performed on the electroencephalogram signal sample of the mth channel, to obtain a transform result corresponding to the electroencephalogram signal sample of the mth channel; An analysis signal corresponding to the electroencephalogram signal sample of the mth channel is constructed by taking the transform result corresponding to the electroencephalogram signal sample of the mth channel as an imaginary part and taking the electroencephalogram signal sample of the mth channel as a real part; Instantaneous amplitudes and instantaneous phases of the analysis signal corresponding to the electroencephalogram signal sample of the mth channel are extracted; Based on a difference value between an instantaneous phase of a first channel and an instantaneous phase of a second channel in the M channels, a phase correlation degree between the first channel and the second channel is determined, and the phase correlation degree between the first channel and the second channel represents a degree of phase synchronization and functional connectivity between a first brain region corresponding to the first channel and a second brain region corresponding to the second channel in a functional brain network; A phase correlation degree matrix is constructed by taking the phase correlation degree between each two channels in the M channels as an element; Based on the phase correlation degree matrix, a graph structure corresponding to the electroencephalogram signal sample of the M channels is constructed.

3. The method of claim 2, wherein, Based on the phase correlation degree matrix, the graph structure corresponding to the electroencephalogram signal sample of the M channels is constructed, comprising: For an mth channel in the M channels, other channels having a phase correlation degree higher than a phase correlation degree threshold with the mth channel are screened out, and nodes corresponding to the screened out other channels are taken as neighbor nodes of an mth node corresponding to the mth channel; For the mth node, edges are connected between the mth node and each neighbor node of the mth node, and an edge weight is the phase correlation degree between the mth channel and the other channel corresponding to the neighbor node, to construct the graph structure corresponding to the electroencephalogram signal sample of the M channels.

4. The method of claim 1, wherein, The method further comprises: For the mth channel of the M channels, the electroencephalogram signal sample of the channel is subjected to short-time Fourier transform to obtain a power spectral density of the channel as an original feature vector of an mth node corresponding to the mth channel; The EEG driving road rage emotion detection model to be trained based on the graph attention module is trained based on the graph structure corresponding to the electroencephalogram signal samples of the M channels, including: The graph structure corresponding to the electroencephalogram signal samples of the M channels is input into the EEG driving road rage emotion detection model to be trained based on the graph attention module, and based on the original feature vectors of the M nodes and the edge weights corresponding to the M nodes, an emotion prediction result corresponding to the electroencephalogram signal samples of the M channels is obtained; Based on the emotion prediction result corresponding to the electroencephalogram signal samples of the M channels and the emotion labels previously added to the electroencephalogram signal samples of the M channels, the model parameter update of the EEG driving road rage emotion detection model to be trained based on the graph attention module is performed to obtain a preliminarily trained EEG driving road rage emotion detection model; In the case that the classification accuracy of the preliminarily trained EEG driving road rage emotion detection model is lower than the target accuracy, a graph attention module is added to the preliminarily trained EEG driving road rage emotion detection model to obtain an EEG driving road rage emotion detection model to be trained with a graph attention module; The EEG driving road rage emotion detection model to be trained based on the graph attention module is trained based on the graph structure corresponding to the electroencephalogram signal samples of the M channels, including:

5. The method of claim 4, wherein, The graph attention module includes T graph attention layers, and T is an integer greater than or equal to 2; the EEG driving road rage emotion detection model to be trained with a graph attention module is trained based on the graph structure corresponding to the electroencephalogram signal samples of the M channels, including: Through a first graph attention layer in the T attention layers, the original feature vectors of each adjacent node of the mth node are used to update the original feature vector of the mth node for the first time to obtain a first updated feature vector of the mth node; Through a tth graph attention layer in the EEG driving road rage emotion detection model to be trained, the (t-1)th updated feature vectors of each adjacent node of the mth node are used to update the (t-1)th feature vector of the mth node for the tth time to obtain a tth updated feature vector of the mth node; Based on the tth updated feature vector of the Mth node and the edge weights corresponding to the M nodes, an emotion prediction result corresponding to the electroencephalogram signal samples of the M channels is obtained; Based on the emotion prediction result corresponding to the electroencephalogram signal samples of the M channels and the emotion labels previously added to the electroencephalogram signal samples of the M channels, the model parameter information of the EEG driving road rage emotion detection model to be trained with a graph attention module is updated to obtain a trained EEG driving road rage emotion detection model.

6. The method according to any one of claims 1 to 5, characterized in that, The M channels are determined according to the following steps: During the simulation driving, the electroencephalogram signals of each channel of the driver with road rage emotion in a first time period before the occurrence of the target event are collected; During the simulation driving, the electroencephalogram signals of each channel of the driver with road rage emotion in a second time period after the occurrence of the target event are collected; The electroencephalogram signals corresponding to the first time period and the electroencephalogram signals corresponding to the second time period are respectively subjected to short-time Fourier transform to obtain corresponding power spectrum densities; For each of the channels, a transformation amount of the power spectrum densities of the electroencephalogram signals before and after the occurrence of the event is determined; The channels with a transformation amount higher than a target transformation amount are determined as the M channels.

7. An EEG driving road rage emotion detection device characterized by, Comprise: The acquisition module is used for collecting M-channel first electroencephalogram signals generated by a driver with normal emotion in handling a target event during simulation driving, and collecting M-channel second electroencephalogram signals generated by a driver with road rage emotion in handling the target event; The sample generation module is used for adding a normal emotion label to the M-channel first electroencephalogram signals, adding a road rage emotion label to the M-channel second electroencephalogram signals, and obtaining M-channel electroencephalogram signal samples; The graph structure construction module is used for constructing a graph structure corresponding to the M-channel electroencephalogram signal samples, taking the M channels as M nodes and taking phase correlation degrees between different channels in the M-channel electroencephalogram signal samples as edge weights; wherein the greater the phase correlation degree between two channels is, the greater the corresponding edge weight is; The model training module is used for training a to-be-trained EEG driving road rage emotion detection model based on the graph structure corresponding to the M-channel electroencephalogram signal samples, to learn phase correlation degrees between different channels in the M-channel electroencephalogram signal samples, and obtain a trained EEG driving road rage emotion detection model, which is used for detecting whether a driver has road rage emotion during driving on the road.

8. An electronic device, comprising: Comprise: A processor; A memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the EEG driving road rage emotion detection method of any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the terminal, the terminal can execute the EEG driving road rage emotion detection method of any one of claims 1 to 6.

10. A computer program product, characterised in that, The computer program product comprises a computer program, which is executed by the processor to implement the EEG driving road rage emotion detection method of any one of claims 1 to 6.