Electroencephalogram-based emotion recognition circuit and system, and chip
By combining wavelet transform and LSTM network in the EEG signal recognition circuit, the problem of high hardware cost in the existing technology is solved, a balance of high accuracy and low hardware consumption is achieved, and it is suitable for hardware implementation of brain-computer emotion recognition.
Patent Information
- Application Number
- PCT/CN2023/141257
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-22
- Filing Date
- 2023-12-22
- Publication Date
- 2024-08-29
AI Technical Summary
While existing emotion recognition neural networks based on EEG signals improve accuracy, they also lead to increased hardware overhead and hardware costs.
A circuit for identifying emotions based on EEG signals is designed, using a feature extraction unit and a neural network processing unit, including discrete wavelet transform, LSTM module, data processing module and classification module. The energy of the wavelet coefficients is combined with the LSTM network to reduce the hardware cost. consume and improve accuracy.
It reduces hardware consumption and improves emotion recognition accuracy, significantly reduces hardware costs, optimizes activation functions and square root calculations, and facilitates hardware circuit deployment.
Smart Images

Figure CN2023141257_29082024_PF_FP_ABST
Abstract
Description
Circuits, systems, and chips for emotion recognition based on EEG signals Technical Field
[0001] The present invention relates to the technical field of electroencephalogram (EEG) signal processing, and more particularly to a circuit, system, and chip for recognizing emotions based on EEG signals. Background Art
[0002] To achieve higher accuracy, existing EEG-based emotion recognition neural networks sometimes have relatively simple architectures but require complex feature extraction methods; others use relatively simple features but require larger networks. Deploying these networks on hardware circuits in either case introduces significant hardware overhead, increasing costs. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a circuit, system and chip for identifying emotions based on EEG signals.
[0004] The technical solution adopted by the present invention to solve the technical problem is: constructing a circuit for identifying emotions based on EEG signals, comprising: a feature extraction unit and a neural network processing unit connected to the feature extraction unit;
[0005] The neural network processing unit includes: a first LSTM module, a first data processing module, a second LSTM module, a second data processing module, a classification module and an output module connected to the feature extraction unit in sequence;
[0006] The feature extraction unit performs discrete wavelet transform on the original EEG signal and outputs feature data;
[0007] The first LSTM module processes the feature data based on the LSTM algorithm and outputs primary processed data;
[0008] The first data processing module performs batch normalization and integration processing on the primary processed data and outputs secondary processed data;
[0009] The second LSTM module processes the secondary processed data based on the LSTM algorithm and outputs tertiary processed data;
[0010] The classification module performs classification processing on the three-level processed data and outputs the classified data;
[0011] The output module processes the classified data and outputs the classification result.
[0012] In the circuit for recognizing emotions based on EEG signals of the present invention, the feature extraction unit is a discrete wavelet feature extraction unit;
[0013] The discrete wavelet feature extraction unit performs discrete wavelet transform on the original EEG signal to obtain a fuzzy component and a detail component, and uses the detail component as the feature data;
[0014] The fuzzy component and the detail component are the fuzzy component and the detail component corresponding to the original EEG signal.
[0015] In the circuit for recognizing emotions based on EEG signals of the present invention, the first LSTM module and the second LSTM module include: a Tanh activation function submodule;
[0016] The Tanh activation function submodule includes: a shift circuit, a selection circuit and an addition circuit connected in sequence;
[0017] The shift circuit receives the characteristic data and performs shift processing on the characteristic data;
[0018] The selection circuit selects the data after the shifting process of the shift circuit and outputs the corresponding selected data;
[0019] The adding circuit performs an addition operation on the selected data.
[0020] In the circuit for recognizing emotions based on EEG signals of the present invention, the selection circuit includes: a first multiplexer, a second multiplexer, a third multiplexer, an inverter, an AND gate, and a NOR gate;
[0021] A first input terminal of the first multiplexer is connected to a first output terminal of the shift circuit, a second input terminal of the first multiplexer is connected to a second output terminal of the shift circuit, a third input terminal of the first multiplexer is connected to an output terminal of the AND gate, a first input terminal of the AND gate is connected to the second output terminal of the shift circuit via the inverter, a second input terminal of the AND gate is connected to input data, an address line of the first multiplexer is connected to the input data, and an output terminal of the first multiplexer is connected to the adding circuit;
[0022] The first input terminal of the second multiplexer is connected to the third output terminal of the shift circuit, the second input terminal of the second multiplexer is connected to the fourth output terminal of the shift circuit, the third input terminal of the second multiplexer is connected to the fifth output terminal of the shift circuit, the fourth input terminal of the second multiplexer is connected to the sixth output terminal of the shift circuit, the address line of the second multiplexer is connected to the input data, and the output terminal of the second multiplexer is connected to the adding circuit;
[0023] The fourth input terminal of the third multiplexer is connected to the output terminal of the NOR gate, the second input terminal of the NOR gate is connected to the input data, the first input terminal of the NOR gate is connected to the parameter data, the address line of the third multiplexer is connected to the input data, and the output terminal of the second multiplexer is connected to the adding circuit.
[0024] In the circuit for recognizing emotions based on EEG signals of the present invention, the adding circuit includes: a compressor and an adder;
[0025] The first input end of the compressor is connected to the output end of the first multiplexer, the second input end of the compressor is connected to the output end of the second multiplexer, the third input end of the compressor is connected to the output end of the third multiplexer, the first output end of the compressor is respectively connected to the first input end of the adder and the output end of the Tanh activation function sub-module, the second output end of the compressor is connected to the second input end of the adder, and the output end of the adder is connected to the output end of the Tanh activation function sub-module.
[0026] In the circuit for recognizing emotions based on EEG signals described in the present invention, the compressor is a 3 / 1 compressor.
[0027] In the circuit for recognizing emotions based on EEG signals of the present invention, the first data processing module and the second data processing module include: a square root calculation submodule;
[0028] The square root calculation submodule uses a piecewise linear function algorithm combined with Taylor expansion to perform calculations.
[0029] In the circuit for recognizing emotions based on EEG signals of the present invention, the square root calculation submodule includes: a Taylor calculation unit;
[0030] The Taylor calculation unit includes: a leading zero detection module, a compensation module, a first shift module, a second shift module, a third shift module, a subtraction operation module and an addition operation module;
[0031] The leading zero detection module, the compensation module, the first shift module, the third shift module and the addition module are connected in sequence, and the input end of the leading zero detection module is connected to the input signal, the first input end of the subtraction module is connected to the input signal, the second input end of the subtraction module is connected to the leading zero detection module, the output end of the subtraction module is connected to the first input end of the second shift module, the second input end of the second shift module is connected to the first shift module, and the output end of the second shift module is connected to the addition module.
[0032] The present invention also provides a system for recognizing emotions based on EEG signals, comprising: the circuit for recognizing emotions based on EEG signals described above.
[0033] The present invention also provides a chip, comprising: the above-mentioned circuit for recognizing emotions based on EEG signals.
[0034] The circuit, system, and chip for recognizing emotions based on EEG signals of the present invention have the following beneficial effects: comprising: a feature extraction unit and a neural network processing unit; the neural network processing unit comprising: a first LSTM module, a first data processing module, a second LSTM module, a second data processing module, a classification module, and an output module; the feature extraction unit performs discrete wavelet transform processing on the original EEG signal and outputs feature data; the first LSTM module outputs primary processed data based on the feature data; the first data processing module outputs secondary processed data based on the primary processed data; the second LSTM module processes the secondary processed data and outputs tertiary processed data; the classification module classifies the tertiary processed data and outputs classified data; and the output module processes the classified data and outputs a classification result. The present invention uses the energy of wavelet coefficients as a feature and cooperates with an LSTM network for emotion recognition, which can both reduce hardware consumption and improve accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0036] FIG1 is a block diagram of a circuit for recognizing emotions based on EEG signals according to an embodiment of the present invention;
[0037] FIG2 is a schematic diagram of a circuit structure for extracting fuzzy component and detail component information provided by an embodiment of the present invention;
[0038] FIG3 is a schematic diagram of the circuit structure of the Tanh activation function provided in an embodiment of the present invention;
[0039] FIG4 is a schematic diagram of the circuit structure of a 3 / 1 compressor provided in an embodiment of the present invention;
[0040] FIG5 is a schematic diagram of a circuit structure of a Taylor calculation according to an embodiment of the present invention;
[0041] FIG6 is a cascade diagram of leading zero detection provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0043] This invention uses the energy of wavelet coefficients as feature data, combined with an LSTM network, to perform emotion recognition. Compared to existing methods, not only is the accuracy significantly improved, but the overall design also makes the operations involved as easy to implement as possible in hardware circuits, greatly reducing hardware consumption and significantly reducing hardware costs. Furthermore, the invention separately optimizes the activation function and square root calculation, which are difficult to implement in neural networks. By implementing a low-power Tanh function and a digital circuit for square root operation, the invention creates a brain-computer emotion recognition neural network and its hardware implementation that is easy to deploy in hardware circuits.
[0044] Specifically, in a preferred embodiment, as shown in FIG1 , the circuit for recognizing emotions based on EEG signals includes: a feature extraction unit 10 and a neural network processing unit 20 connected to the feature extraction unit 10 .
[0045] In the embodiment of the present invention, the feature extraction unit 10 performs discrete wavelet transform on the original EEG signal and outputs feature data.
[0046] Optionally, in an embodiment of the present invention, the feature extraction unit 10 is a discrete wavelet feature extraction unit. The discrete wavelet feature extraction unit performs a discrete wavelet transform on the original EEG signal to obtain a fuzzy component and a detail component, and uses the detail component as feature data. The fuzzy component and detail component are the fuzzy component and detail component corresponding to the original EEG signal.
[0047] Specifically, for any function , its discrete wavelet transform form is as follows:
[0048] (1).
[0049] (1) In the formula, is the base wavelet or mother wavelet. a is the expansion factor (also called scale factor); b is the translation factor. Discretizing the scale factor a and the translation factor b, we have:
[0050] (2).
[0051] From the above, we can see that It is decomposed according to different frequency channels. The basic idea of this discretization is to choose an appropriate magnification factor. , studying a function or signal process at a specific location, and then rebalancing to another location to continue studying. If the magnification is too large, it is likely that the scale is too small, so you can move the distance in small steps; vice versa. Therefore, in this embodiment of the present invention, the sampling step size is small for small-scale high-frequency components, and the sampling step size is large for large-scale low-frequency components.
[0052] In the embodiment of the present invention, after the original EEG signal is subjected to discrete wavelet transform, the corresponding fuzzy component and detail component are obtained, and then the energy of the wavelet coefficients is selected as the feature data and input into the neural network processing unit 20. Specifically, by selecting the energy of the wavelet coefficients as the feature data, the present invention can avoid the use of the wavelet reconstruction algorithm and significantly reduce the amount of calculation. On the other hand, the energy of the wavelet coefficients can provide signal strength information, and its computational complexity is low, which is convenient for deployment in hardware circuits.
[0053] Furthermore, in order to facilitate engineering implementation, in the embodiment of the present invention, the wavelet function Daubechies4 (db4) with a finite support set is selected to extract the signal intensity information from the fuzzy component and the detail component according to the following formula, namely:
[0054] (3).
[0055] (4).
[0056] (3) In the formula represents the detail component; (4) where represents the fuzzy component; k is the data label.
[0057] The hardware circuit architecture of the discrete wavelet feature extraction unit of the embodiment of the present invention is shown in FIG2. Specifically, as shown in FIG2, the discrete wavelet feature extraction unit of the present invention adopts a cascade method, and each level includes two branches, one branch is a high-pass filter branch, and the other is a low-pass filter branch. The high-pass filter branch includes: a high-pass filter (g in the figure) and a downsampling circuit ( The low-pass filter branch includes: a low-pass filter (shown as h in the figure) and a downsampling circuit (shown as ). Among them, D1, D2, D3, and D4 in Figure 2 are detail components, and A4 is the blur component.
[0058] In an embodiment of the present invention, the neural network processing unit 20 includes: a first LSTM module 21, a first data processing module 22, a second LSTM module 23, a second data processing module 24, a classification module 25 and an output module 26, which are sequentially connected to the feature extraction unit 10.
[0059] The first LSTM module 21 processes the feature data using the LSTM algorithm and outputs primary processed data. The first data processing module 22 performs batch normalization and integration on the primary processed data and outputs secondary processed data. The second LSTM module 23 processes the secondary processed data using the LSTM algorithm and outputs tertiary processed data. The classification module 25 classifies the tertiary processed data and outputs classified data. The output module 26 processes the classified data and outputs the classification result.
[0060] In the embodiment of the present invention, the first LSTM module 21 and the second LSTM module 23 can use the same hardware circuit architecture, but can differ in terms of values and weights, which are subject to actual calculations. Similarly, the first data processing module 22 and the second data processing module 24 can also use the same hardware circuit architecture, but can differ in terms of values and weights, which are subject to actual calculations.
[0061] In the embodiment of the present invention, the first LSTM module 21 and the second LSTM module 23 both use the LSTM (Long Short-Term Memory) network algorithm for calculation. Furthermore, in order to reduce power consumption and make the calculation easier to implement in hardware circuits, the present invention improves the Tanh activation function in the LSTM network.
[0062] In the embodiment of the present invention, the first LSTM module 21 and the second LSTM module 23 both include: a Tanh activation function submodule.
[0063] Specifically, during the validation phase of the PWL (PieceWise-Linear) algorithm model, in addition to considering the mean absolute error (MAE), a concern in other such designs, the dimensions of multiplication and addition complexity were added from a hardware design perspective. The main goal was to accurately evaluate the calculation process of each binary bit, thereby obtaining an algorithm model that meets the requirements.
[0064] First, set the range of the function's independent variable to [m, n), where m and n are natural numbers. In a preferred embodiment, the range can be (-2, 2). The range is divided into s equal segments. Then, the parameter of the i-th segment function in the PWL can be determined according to the following formula: and :
[0065] (5).
[0066] The definitions of Absolute error (AE) and MAE are as follows:
[0067] (6).
[0068] (7).
[0069] Here, x is the function's independent variable, f(x) and g(x) are the calibrated and approximated function values, respectively. When implementing the algorithm using digital circuits, a multiplexer (MUX) is used to select the segment to which the independent variable belongs. Considering the characteristics of binary systems, when further segmenting the function curve, only integer powers of 2 are used as the number of segments. This makes the MUX's address line width easier to control and ensures consistency in the segmentation between the hardware circuit and the software algorithm.
[0070] In the embodiment of the present invention, the proposed PWL algorithm expression is as follows:
[0071] (8).
[0072] (7) In the formula, x is the input independent variable.
[0073] The input data of the network uses the signal strength information of the EEG signals of the four electrodes FP1, FP2, F3, and C4 in the 10-20 system electrode rotation method according to formulas (2) and (3).
[0074] Optionally, in an embodiment of the present invention, the specific circuit architecture of the Tand activation function submodule can be referred to FIG3 .
[0075] Specifically, as shown in Figure 3, the Tanh activation function submodule includes: a shift circuit 211, a selection circuit 212 and an addition circuit 213 connected in sequence; the shift circuit 211 accesses the feature data and performs shift processing on the feature data; the selection circuit 212 selects the data after the shift processing by the shift circuit 211, and outputs the corresponding selected data; the addition circuit 213 performs addition operation on the selected data.
[0076] The selection circuit 212 includes a first multiplexer (MUX1), a second multiplexer (MUX2), a third multiplexer (MUX3), an inverter, an AND gate, and a NOR gate.
[0077] The first input terminal of the first multiplexer is connected to the first output terminal of the shift circuit 211, the second input terminal of the first multiplexer is connected to the second output terminal of the shift circuit 211, the third input terminal of the first multiplexer is connected to the output terminal of the AND gate, the first input terminal of the AND gate is connected to the second output terminal of the shift circuit 211 through an inverter, the second input terminal of the AND gate is connected to the input data, the address line of the first multiplexer is connected to the input data, and the output terminal of the first multiplexer is connected to the adding circuit 213; the first input terminal of the second multiplexer is connected to the third output terminal of the shift circuit 211, the second input terminal of the second multiplexer is connected to the output terminal of the AND gate. The fourth output terminal of the shift circuit 211 is connected to the third input terminal of the second multiplexer and the fifth output terminal of the shift circuit 211. The fourth input terminal of the second multiplexer is connected to the sixth output terminal of the shift circuit 211. The address line of the second multiplexer is connected to the input data, and the output terminal of the second multiplexer is connected to the adding circuit 213. The fourth input terminal of the third multiplexer is connected to the output terminal of the NOR gate, the second input terminal of the NOR gate is connected to the input data, the first input terminal of the NOR gate is connected to the parameter data, the address line of the third multiplexer is connected to the input data, and the output terminal of the second multiplexer is connected to the adding circuit 213.
[0078] Optionally, in an embodiment of the present invention, the adding circuit 213 includes: a compressor 2131 and an adder 2132 .
[0079] The first input end of the compressor 2131 is connected to the output end of the first multiplexer, the second input end of the compressor 2131 is connected to the output end of the second multiplexer, the third input end of the compressor 2131 is connected to the output end of the third multiplexer, the first output end of the compressor 2131 is respectively connected to the first input end of the adder 2132 and the output end of the Tanh activation function sub-module, the second output end of the compressor 2131 is connected to the second input end of the adder 2132, and the output end of the adder 2132 is connected to the output end of the Tanh activation function sub-module.
[0080] To improve circuit performance, in this embodiment of the present invention, compressor 2131 utilizes a 3 / 1 compressor 2131. As shown in Figure 4, (a) is used to perform a bitwise sum of the low-significant bits, (b) is used to perform a carry operation on the most significant bit of the low-significant bits, and (c) is used to perform an operation on the most significant bits. By using 3 / 1 compressor 2131, only the carry information of the most significant bit of the low-significant bits is retained during calculation, and only an OR gate is used to obtain the bitwise sum of all low-significant bits. This significantly reduces circuit area and propagation time, lowering power consumption and improving efficiency.
[0081] Optionally, in an embodiment of the present invention, the first data processing module 22 and the second data processing module 24 are both implemented using a batch normalization algorithm (i.e., Batchnormalization, BN algorithm). The use of batch normalization can make the distribution of input data in each layer relatively stable, thereby accelerating the learning speed of the model.
[0082] Optionally, in the embodiment of the present invention, the first data processing module 22 and the second data processing module 24 both include a square root calculation submodule, wherein the square root calculation submodule uses a piecewise linear function algorithm combined with Taylor expansion for calculation.
[0083] Specifically, when designing square root operations, the present invention combines the PWL algorithm with the Taylor expansion. By incorporating the Taylor formula, the problem of increased hardware resource consumption, which can occur when the PWL algorithm uses small independent variable values and errors exceed the expected range, can be avoided. In other words, by leveraging the Taylor formula, the present invention can both improve accuracy and reduce hardware resource consumption.
[0084] Specifically, in a preferred embodiment, the square root calculation submodule includes: a Taylor calculation unit.
[0085] As shown in FIG5 , the Taylor calculation unit includes: a leading zero detection module, a compensation module, a first shift module, a second shift module, a third shift module, a subtraction operation module, and an addition operation module.
[0086] The leading zero detection module, the compensation module, the first shift module, the third shift module and the addition module are connected in sequence, and the input end of the leading zero detection module is connected to the input signal, the first input end of the subtraction module is connected to the input signal, the second input end of the subtraction module is connected to the leading zero detection module, the output end of the subtraction module is connected to the first input end of the second shift module, the second input end of the second shift module is connected to the first shift module, and the output end of the second shift module is connected to the addition module.
[0087] Among them, the leading zero detection module is used to detect the most significant 1 in the binary number; the compensation module performs compensation processing on the data to improve the stability of the data; the first shift module, the second shift module and the third shift module shift the data according to the corresponding shift requirements, the subtraction operation module performs subtraction operation; and the addition operation module performs addition operation.
[0088] Furthermore, in order to improve the detection speed of leading zero detection, in an embodiment of the present invention, the leading zero detection module adopts a segmented detection method, as specifically shown in Figure 6. As shown in Figure 6, LOD represents the leading zero detection module. For a 28-bit binary number, the lower 16 bits are grouped together and the upper 12 bits are grouped together. When performing leading zero detection, the lower 16 bits and the upper 12 bits are detected separately.
[0089] In this embodiment of the present invention, the output module 26 can use a Sigmoid function. The classification module 25 performs multi-label classification. Since multi-label classification is performed, the final activation function is a Sigmoid function. For the final multi-label classification of 8 categories, the accuracy can reach 72%, which is clearly effective in improving accuracy.
[0090] The present invention also provides a system for recognizing emotions based on EEG signals, comprising: a circuit for recognizing emotions based on EEG signals disclosed in an embodiment of the present invention.
[0091] The present invention also provides a chip, which includes: the circuit for recognizing emotions based on EEG signals disclosed in an embodiment of the present invention.
[0092] The circuit for recognizing emotions based on EEG signals of the present invention can be applied to data calculations such as FPGA operations and deep learning operations. In addition, the circuit for recognizing emotions based on EEG signals of the present invention can also be applied to fields related to emotional disorders, virtual reality games, and other fields.
[0093] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0094] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0095] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0096] The above embodiments are intended only to illustrate the technical concepts and features of the present invention. Their purpose is to enable those skilled in the art to understand the present invention and implement it accordingly. They are not intended to limit the scope of protection of the present invention. All equivalent variations and modifications within the scope of the claims of the present invention are intended to be covered by the claims of the present invention.
Claims
1. A circuit for identifying emotions based on EEG signals, characterized in that: include: A feature extraction unit and a neural network processing unit connected to the feature extraction unit; The neural network processing unit includes: a first LSTM module, a first data processing module, a second LSTM module, a second data processing module, a classification module and an output module which are sequentially connected to the feature extraction unit; The feature extraction unit performs discrete wavelet transform processing on the original EEG signal and outputs feature data; The first LSTM module processes the feature data based on the LSTM algorithm and outputs primary processed data; The first data processing module performs batch normalization and integration processing on the primary processed data, and then outputs secondary processed data; The second LSTM module processes the secondary processed data based on the LSTM algorithm and outputs tertiary processed data; The classification module performs classification processing on the three-level processed data and outputs the classified data; The output module processes the classified data and outputs the classification result.
2. The circuit for recognizing emotions based on EEG signals according to claim 1, characterized in that: The feature extraction unit is a discrete wavelet feature extraction unit; The discrete wavelet feature extraction unit performs discrete wavelet transform on the original EEG signal to obtain a fuzzy component and a detail component, and uses the detail component as the feature data; The fuzzy component and the detail component are the fuzzy component and the detail component corresponding to the original EEG signal.
3. The circuit for recognizing emotions based on EEG signals according to claim 1, characterized in that: The first LSTM module and the second LSTM module include: a Tanh activation function submodule; The Tanh activation function submodule includes: a shift circuit, a selection circuit and an addition circuit connected in sequence; The shift circuit accesses the characteristic data and performs shift processing on the characteristic data; The selection circuit selects the data after the shifting process of the shift circuit and outputs the corresponding selected data; The adding circuit performs an addition operation on the selected data.
4. The circuit for recognizing emotions based on EEG signals according to claim 3, characterized in that: The selection circuit includes: a first multiplexer, a second multiplexer, a third multiplexer, an inverter, an AND gate, and a NOR gate; The first input end of the first multiplexer is connected to the first output end of the shift circuit, the second input end of the first multiplexer is connected to the second output end of the shift circuit, the third input end of the first multiplexer is connected to the output end of the AND gate, the first input end of the AND gate is connected to the second output end of the shift circuit through the inverter, the second input end of the AND gate is connected to input data, the address line of the first multiplexer is connected to the input data, and the output end of the first multiplexer is connected to the adding circuit; The first input terminal of the second multiplexer is connected to the third output terminal of the shift circuit, the second input terminal of the second multiplexer is connected to the fourth output terminal of the shift circuit, the third input terminal of the second multiplexer is connected to the fifth output terminal of the shift circuit, the fourth input terminal of the second multiplexer is connected to the sixth output terminal of the shift circuit, the address line of the second multiplexer is connected to the input data, and the output terminal of the second multiplexer is connected to the adding circuit; The fourth input terminal of the third multiplexer is connected to the output terminal of the NOR gate, the second input terminal of the NOR gate is connected to the input data, the first input terminal of the NOR gate is connected to the parameter data, the address line of the third multiplexer is connected to the input data, and the output terminal of the second multiplexer is connected to the adding circuit.
5. The circuit for recognizing emotions based on EEG signals according to claim 4, characterized in that: The adding circuit comprises: a compressor and an adder; The first input end of the compressor is connected to the output end of the first multiplexer, the second input end of the compressor is connected to the output end of the second multiplexer, the third input end of the compressor is connected to the output end of the third multiplexer, the first output end of the compressor is respectively connected to the first input end of the adder and the output end of the Tanh activation function submodule, the second output end of the compressor is connected to the second input end of the adder, and the output end of the adder is connected to the output end of the Tanh activation function submodule.
6. The circuit for recognizing emotions based on EEG signals according to claim 5, characterized in that: The compressor is a 3 / 1 compressor.
7. The circuit for recognizing emotions based on EEG signals according to claim 1, characterized in that: The first data processing module and the second data processing module include: a square root calculation submodule; The square root calculation submodule uses a piecewise linear function algorithm combined with Taylor expansion to perform calculations.
8. The circuit for recognizing emotions based on EEG signals according to claim 7, characterized in that: The square root calculation submodule includes: a Taylor calculation unit; The Taylor calculation unit includes: a leading zero detection module, a compensation module, a first shift module, a second shift module, a third shift module, a subtraction operation module and an addition operation module; The leading zero detection module, the compensation module, the first shift module, the third shift module and the addition module are connected in sequence, and the input end of the leading zero detection module is connected to the input signal, the first input end of the subtraction module is connected to the input signal, the second input end of the subtraction module is connected to the leading zero detection module, the output end of the subtraction module is connected to the first input end of the second shift module, the second input end of the second shift module is connected to the first shift module, and the output end of the second shift module is connected to the addition module.
9. A system for identifying emotions based on EEG signals, characterized in that: include: A circuit for recognizing emotions based on EEG signals as described in any one of claims 1 to 8.
10. A chip, characterized in that: include: A circuit for recognizing emotions based on EEG signals as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Electroencephalogram signal emotion recognition method based on R-LSTM model
CN112364697A
Method for realizing multi-channel convolutional-recurrent neural network electroencephalogram emotion recognition model by using transfer learning
CN113627518A
Activation function acceleration processing unit for neural network online learning
CN113935480A
Emotion recognition method and system based on few-channel EEG signals
CN114699078A
Method for identifying two types of basic emotion intensity electroencephalogram signals based on deep learning
CN115474947A
