Brain wave depression diagnosis method and device based on localization processing

Through localized processing and mixed threshold calculation, the EEG depression detection method solves the problems of high delay, low accuracy and insufficient portability in the prior art, and realizes data security and high accuracy depression detection, which is suitable for outdoor and remote areas.

CN120345901APending Publication Date: 2025-07-22深圳浠谷科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510719330.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing EEG depression detection system has problems such as high signal processing delay, low accuracy, insufficient portability and insufficient privacy protection, making it difficult to achieve real-time and accurate diagnosis and treatment on embedded devices.

Method used

The localized processing scheme is adopted to obtain the original signal data, pre-process and extract the frequency and time domain features, use the trained emotion classification model to calculate the depression index, and use the mixed threshold calculation method to perform early warning, so that the data cannot be put into the cloud and improve the detection accuracy.

Benefits of technology

It realizes data security protection in areas with poor outdoor and network environments, improves detection accuracy under different individual differences, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120345901A_ABST
    Figure CN120345901A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a brain wave depression diagnosis method, device and equipment based on localization processing and a computer readable storage medium. The method comprises the following steps: acquiring original signal data; preprocessing the original signal data, and extracting frequency domain features and time domain features in the original signal data; inputting the frequency domain features and the time domain features into a trained emotion classification model to obtain an emotion category and a depression index; and if the depression index is greater than or equal to the calculated threshold value, outputting the belonging emotion category and early warning information corresponding to the belonging emotion category. In this way, the data is not clouded, the data security of the user is protected, and the method can be used in environments with poor network environments such as outdoors and remote areas. And meanwhile, a mixed threshold calculation method is provided, so that the detection accuracy under different individual differences (such as age, gender and pathological state) is greatly improved, and the user experience is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of data processing, and in particular to an electroencephalogram depression diagnosis method, apparatus, device, and computer-readable storage medium based on local processing. Background Art

[0002] The acquisition of EEG signals combined with deep learning and edge computing technologies has been widely applied to the field of depression recognition and detection. In the traditional laboratory-based scheme, high-precision EEG acquisition devices (such as Neuroscan SynAmps) and laboratory servers use traditional machine learning (SVM, random forest) and artificial feature engineering to detect the depressive state; in the cloud processing scheme, a portable electroencephalograph combined with a mobile phone or tablet terminal uses a deep learning model deployed in the cloud to achieve cloud-based electroencephalogram depression analysis; in the lightweight edge computing scheme, a low-power MCU (such as STM32) combined with a simple electroencephalogram module uses a lightweight model to achieve embedded electroencephalogram emotion recognition. These technologies assist in the detection and treatment of depression through EEG signal acquisition, deep learning, and edge computing, and have become one of the core supporting technologies of medical artificial intelligence.

[0003] Although the existing technologies have achieved basic depression detection functions, they still have significant deficiencies in aspects such as privacy protection, detection accuracy, and device portability. That is, the existing electroencephalogram depression detection system has technical deficiencies such as high signal processing delay, low accuracy, and insufficient cross-subject generalization ability of the model, resulting in the inability to achieve real-time and accurate diagnosis and treatment on embedded devices. In addition, the electroencephalograph is separated from the processing device, and manual data transmission is required, resulting in insufficient portability. At the same time, the existing solutions lack a privacy protection mechanism and are difficult to meet the requirements of medical data security. Summary of the Invention

[0004] According to the embodiments of the present application, an electroencephalogram depression diagnosis solution based on local processing is provided, which realizes data not being uploaded to the cloud, protects the data security of users, and can be used in environments with poor network conditions such as outdoors and remote areas. At the same time, the proposed hybrid threshold calculation method greatly improves the detection accuracy under different individual differences (such as age, gender, pathological state), further enhancing the user experience.

[0005] In the first aspect of the present application, an electroencephalogram depression diagnosis method based on local processing is provided. The method includes: Obtain original signal data; Preprocess the original signal data, and extract the frequency-domain features and time-domain features in the original signal data; Input the frequency-domain features and time-domain features into a trained emotion classification model to obtain the emotion category and depression index to which they belong; If the depression index is greater than or equal to the calculated threshold value, output the corresponding emotion category and the warning information corresponding to the emotion category.

[0006] Further, the preprocessing of the original signal data to extract the frequency domain features from the original signal data includes: Calculate the signal average amplitude, variance, and / or zero crossing rate of the original signal data respectively; Based on the signal average amplitude, variance, and / or zero crossing rate, obtain the frequency domain features in the original signal data.

[0007] Further, the preprocessing of the original signal data to extract the time domain features from the original signal data includes: Perform Fourier transform and / or total frequency band energy calculation on the original signal data to extract the time domain features from the original signal data.

[0008] Further, the inputting of the frequency domain features and time domain features into the trained emotion classification model to obtain the corresponding emotion category includes:

[0009] Wherein, is the k-th output value of the fully connected layer; K is the total number of emotion categories; P(y = k) is the probability that the input sample belongs to the k-th category.

[0010] Further, the inputting of the frequency domain features and time domain features into the trained emotion classification model to obtain the depression index includes:

[0011] Wherein, z is the linear output of the fully connected layer; σ(z) is the Sigmoid function.

[0012] Further, the threshold value can be calculated by the following method:

[0013] Wherein, is the static reference threshold value determined by the ROC curve; N is the number of points of the user's historical data; μ is the average value of the user's historical depression index; σ is the standard deviation of the user's historical depression index; K is the adjustment coefficient; n is the amount of user data.

[0014] Further, it also includes: If the depression index is less than the calculated threshold value, output the corresponding emotion category.

[0015] In a second aspect of the present application, there is provided an electroencephalogram depression diagnosis device based on localization processing. The device includes: An acquisition module, configured to acquire original signal data; A preprocessing module, configured to preprocess the original signal data and extract frequency-domain features and time-domain features from the original signal data; A processing module, configured to input the frequency-domain features and time-domain features into a trained emotion classification model to obtain the corresponding emotion category and depression index; An output module, configured to output the corresponding emotion category and warning information corresponding to the emotion category if the depression index is greater than or equal to the calculated threshold value.

[0016] In a third aspect of the present application, there is provided an electronic device. The electronic device includes: a memory and a processor. A computer program is stored on the memory, and when the processor executes the program, the method as described above is implemented.

[0017] In a fourth aspect of the present application, there is provided a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method according to the first aspect of the present application is implemented.

[0018] The electroencephalogram depression diagnosis method based on localization processing provided by the embodiments of the present application realizes data not being uploaded to the cloud, protects the user's data security, and can be used in environments with poor network conditions such as outdoors and remote areas. At the same time, the proposed hybrid threshold calculation method greatly improves the detection accuracy under different individual differences (such as age, gender, pathological state), further enhancing the user experience.

[0019] It should be understood that the content described in the summary of the invention section is not intended to limit the key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In conjunction with the accompanying drawings and with reference to the following detailed description, the above and other features, advantages, and aspects of the embodiments of the present application will become more apparent. In the drawings, the same or similar reference numerals denote the same or similar elements, where: Figure 1 This is a system architecture diagram related to the method provided by the embodiments of the present application.

[0021] Figure 2 This is a flowchart of a method for diagnosing depression based on electroencephalogram (EEG) signals through localization processing according to an embodiment of the present application; Figure 3 This is a logical flowchart according to an embodiment of the present application; Figure 4 This is a block diagram of a device for diagnosing depression based on electroencephalogram (EEG) signals through localization processing according to an embodiment of the present application; Figure 5 This is a schematic structural diagram of a terminal device or a server suitable for implementing the embodiments of the present application. Detailed implementation manners

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.

[0023] In addition, the term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the preceding and following associated objects.

[0024] Figure 1 This shows a schematic diagram of an exemplary operating environment in which the embodiments of the present disclosure can be implemented. The operating environment includes a device layer, an edge computing layer, and a front-end display layer.

[0025] The device layer includes an electroencephalogram (EEG) signal acquisition device and an edge device (AirBox); Among them, the electroencephalogram (EEG) signal acquisition device is used to generate a txt file corresponding to the acquired EEG signal; the acquired data can be transmitted to the edge device through Bluetooth or USB wired transmission; The edge computing layer is used to deploy algorithms to edge devices, process the collected EEG signals, and obtain the user's emotion and depression index according to the LSTM emotion classification model combined with an adaptive mechanism, including a signal acquisition module, a preprocessing module, an LSTM emotion analysis model, and a threshold decision module; Among them, the information acquisition module is used to acquire the txt file obtained by the electroencephalogram acquisition instrument; The preprocessing module is used to process the obtained txt file and filter out invalid data, including extracting time-domain and frequency-domain features, etc.; The LSTM emotion classification model is used to calculate the user's depression index D and the probability of the belonging emotion.

[0026] The front-end display layer is used to display the output results of the edge computing layer.

[0027] Figure 2 The flowchart of the electroencephalogram depression diagnosis method based on local processing according to an embodiment of the present disclosure is shown. The method includes: S210, obtaining the original signal data.

[0028] In some embodiments, it can be passed through as Figure 1 The shown electroencephalogram acquisition device collects EEG signals in txt format in real time.

[0029] S220, preprocessing the original signal data, and extracting the frequency-domain features and time-domain features in the original signal data.

[0030] Preprocess the original signal data, and calculate the signal average amplitude, variance, and / or zero-crossing rate of the original signal data respectively; based on the signal average amplitude, variance, and / or zero-crossing rate, obtain the frequency-domain features in the original signal data:

[0031] Among them, is the signal amplitude at the t-th time point; N is the total number of sampling points within the time window; μ is the average amplitude of the signal, used to reflect the DC component; By calculating the average amplitude of the signal within the time window, the DC component (reference level) of the signal can be reflected, providing a calculation reference for the subsequent variance and zero-crossing rate;

[0032] Among them, μ is the mean value of the signal; σ² is the variance of the signal, used to reflect the fluctuation intensity; By quantifying the fluctuation intensity of the signal amplitude to reflect the energy change of the signal, the brain waves of depressed patients will show higher variance (large mood swings);

[0033] where Ⅱ() is the indicator function, which is 1 when the condition in the parentheses holds and 0 otherwise; ZCR is the frequency at which the signal crosses zero (zero crossing rate), with the unit of Hz; By counting the number of times the signal crosses zero within a unit time to reflect the frequency characteristics of the signal. The higher the zero crossing rate, the more high-frequency components the signal has. At the same time, under the state of anxiety or stress, ZCR may increase.

[0034] In some embodiments, perform Fourier transform and / or total energy calculation of frequency bands on the original signal data to extract the time domain features in the original signal data:

[0035] where is the t-th sampling point of the time domain signal; is the complex representation of the frequency component (including amplitude and phase); k is the frequency index, and the corresponding actual frequency is: =

[0036] where is the sampling rate (such as 1000Hz); The Fourier transform converts a discrete time domain signal {x0, x1, …, xN−1} of length N into a frequency domain representation {X0, X1, …, XN−1}, where each Xk represents the complex amplitude (including amplitude and phase) of the component with frequency k / N in the signal, and decomposes the time domain signal into sine wave components of different frequencies.

[0037]

[0038] where, ∣ ∣ is the amplitude of the frequency and can be calculated by the following formula:

[0039] band is the target frequency band (such as Delta: 0.5 - 4Hz, Theta: 4 - 8Hz, Alpha: 8 - 12Hz); is the total energy of the frequency band, which is used to reflect the activity degree of this frequency band; By calculating the frequency band energy formula, the electroencephalogram activity in a specific frequency range is quantified, providing an interpretable and quantifiable physiological indicator for emotion classification and depression detection. For example, an increase in theta wave energy may be related to a low mood or a depressive state.

[0040] S230, input the frequency domain features and time domain features into the trained emotion classification model to obtain the emotion category and depression index to which they belong.

[0041] In some embodiments, the frequency domain features and time domain features obtained through step S220 are input into the trained emotion classification model to obtain long-term dependence features (such as emotion fluctuation patterns), and then the extracted features are mapped to emotion categories or depression probabilities, and the emotion probability distribution and depression index D are output. The emotion classification model can be divided into an input layer, an LSTM layer, and a fully connected layer.

[0042] Among them, the input layer is used to receive sequence data with a shape of (time step, feature dimension); The LSTM layer is used to extract time-dependent features and can be stacked in multiple layers; The fully connected layer is used to map the LSTM output to the emotion category probability and output logits.

[0043] In some embodiments, the probability of the emotion to which it belongs can be calculated in the following way:

[0044] Among them, is the k-th output value of the fully connected layer (without activation function); K is the total number of emotion categories, such as positive / neutral / negative; P(y = k) is the probability that the input sample belongs to the k-th category, and the sum of all category probabilities is 1.

[0045] Through the above method, the logits output by the fully connected layer can be converted into a probability distribution, and the one with the maximum probability is selected as the detection result.

[0046] In some embodiments, the depression index can be calculated in the following way:

[0047] Among them, z is the linear output of the fully connected layer, that is:

[0048] σ(z) is the Sigmoid function, which converts z into a probability value between 0 and 1.

[0049] S240, if the depression index is greater than or equal to the calculated threshold, output the emotion category to which it belongs and the warning information corresponding to the emotion category to which it belongs.

[0050] In some embodiments, threshold calculation is performed by mixing (combining static and dynamic) for different environments:

[0051] wherein, is the static benchmark threshold determined by the ROC curve; N is the number of points of the user's historical data; μ is the average value of the user's historical depression index; σ is the standard deviation of the user's historical depression index; K is the adjustment coefficient; n is the amount of user data, which can be selected according to the actual application scenario, preferably 7.

[0052] Furthermore, the can be obtained by generating an ROC curve and calculating the optimal threshold.

[0053] Specifically, the pre-collected and processed sample data is labeled (0 = healthy, 1 = depressed), and the trained LSTM model is used to output the depression index D (it is necessary to ensure that the ratio of healthy and depressed samples in the dataset is reasonable to avoid the influence of class bias on threshold selection); Within the range of the threshold, starting from the minimum value to the maximum value, increment by a step size of 1. For each threshold ɵ, if the depression index D ≥ ɵ, then it is predicted as depressed (positive), otherwise, it is predicted as healthy (negative). TP (true positive), FP (false positive), TN (true negative), and FN (false negative) are counted. And the TPR (true positive rate) and FPR (false positive rate) are calculated in the following way:

[0054]

[0055] The ROC curve is plotted through the calculated FPR and TPR; wherein, the FPR is used as the horizontal axis; the TPR is used as the vertical axis.

[0056] Furthermore, the threshold that maximizes J can be calculated in the following way, that is, the optimal threshold is used as the static threshold, corresponding to the point on the ROC curve closest to the upper left corner (0, 1), where the TPR is the highest and the FPR is the lowest: J = TPR - FPR In summary, taking n equal to 7 as an example. By adopting static and dynamic methods respectively in different environments, a warning mechanism for risk scenario adaptation is realized. When the user data is insufficient (i.e., n < 7), the core logic is to use the pre-collected and processed data to determine the optimal static threshold through the ROC curve, provide a reliable benchmark threshold, and avoid misjudgment due to insufficient data; when the user's historical data volume is sufficient (i.e., n ≥ 7), switch to the dynamic threshold, and the core logic is to optimize the judgment by combining the user's personalized data. If μ and σ are larger, the dynamic threshold is adjusted accordingly to reduce false alarms. It can flexibly combine static and dynamic thresholds to improve robustness and personalized judgment.

[0057] In some embodiments, the previously calculated depression index D is compared with the threshold T of the current environment. If it is less than the threshold (D < T), it is considered that there is no depression risk and no processing is performed; if it is greater than or equal to the threshold (D ≥ T), a warning is triggered. That is, if the depression index is greater than or equal to the calculated threshold, the corresponding emotion category and the warning information corresponding to the emotion category are output; if the depression index is less than the calculated threshold, the corresponding emotion category is output.

[0058] According to the embodiments of the present disclosure, the following technical effects are achieved: As Figure 3 shown, the present disclosure constructs an emotion classification model based on LSTM, introduces an adaptive mechanism, realizes data not being uploaded to the cloud, protects the user's data security, and can be used in environments with poor network conditions such as outdoors and remote areas. At the same time, the proposed hybrid threshold calculation method greatly improves the detection accuracy under different individual differences (such as age, gender, pathological state), and further improves the user experience.

[0059] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0060] The above is the introduction of the method embodiments. The following further illustrates the solution of the present application through device embodiments.

[0061] Figure 4 FIG. 400 shows a block diagram of an electroencephalogram depression diagnosis device based on local processing according to an embodiment of the present application. As Figure 4 shown, it includes: An acquisition module 410, configured to acquire original signal data; A preprocessing module 420 is configured to preprocess the original signal data and extract frequency-domain features and time-domain features from the original signal data; A processing module 430 is configured to input the frequency-domain features and time-domain features into a trained emotion classification model to obtain the emotion category and the depression index; An output module 440 is configured to output the emotion category and the warning information corresponding to the emotion category if the depression index is greater than or equal to a calculated threshold.

[0062] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the described modules can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0063] Figure 5 FIG. shows a schematic structural diagram of a terminal device or a server suitable for implementing the embodiments of the present application.

[0064] As Figure 5 shown, the terminal device or the server includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage section 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the terminal device or the server are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0065] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom can be installed into the storage section 508 as needed.

[0066] In particular, according to an embodiment of the present application, the above method flow steps can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above functions defined in the system of the present application are executed.

[0067] It should be noted that the computer-readable medium shown in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device. And in the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0068] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code, and the foregoing module, segment of a program, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0069] The units or modules involved in the embodiments described in the present application can be implemented in software or in hardware. The described units or modules can also be provided in a processor. Among them, the names of these units or modules do not constitute a limitation on the units or modules themselves in some cases.

[0070] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the foregoing embodiments; or may exist alone without being assembled into the electronic device. The foregoing computer-readable storage medium stores one or more programs, and when the foregoing programs are executed by one or more processors, they implement the methods described in the present application.

[0071] The above description is only a preferred embodiment of the present application and an explanation of the technical principles applied. Those skilled in the art should understand that the scope of the application involved in the present application is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the foregoing inventive concept. For example, technical solutions formed by mutually replacing the above features with (but not limited to) technical features having similar functions in the present application.

Claims

1. A method for diagnosing depression of brain waves based on localization processing, characterized in that, Including: Obtain the original signal data; Preprocess the original signal data to extract the frequency-domain features and time-domain features in the original signal data; Input the frequency-domain features and time-domain features into the trained emotion classification model to obtain the emotion category and the depression index; If the depression index is greater than or equal to the calculated threshold, output the emotion category and the warning information corresponding to the emotion category.

2. The method according to claim 1, wherein The preprocessing of the original signal data to extract the frequency-domain features in the original signal data includes: Calculate the signal average amplitude, variance, and / or zero-crossing rate of the original signal data respectively; Based on the signal average amplitude, variance, and / or zero-crossing rate, obtain the frequency-domain features in the original signal data.

3. The method according to claim 2, characterized in that The preprocessing of the original signal data to extract the time-domain features in the original signal data includes: Perform Fourier transform and / or total energy calculation of the frequency band on the original signal data to extract the time-domain features in the original signal data.

4. The method according to claim 3, wherein The input of the frequency-domain features and time-domain features into the trained emotion classification model to obtain the emotion category includes: Among them, is the k-th output value of the fully connected layer; K is the total number of emotion categories; P(y = k) is the probability that the input sample belongs to the k-th category.

5. The method according to claim 4, characterized in that, The input of the frequency-domain features and time-domain features into the trained emotion classification model to obtain the depression index includes: Where z is the linear output of the fully connected layer; σ(z) is the Sigmoid function.

6. The method according to claim 5, wherein The threshold can be calculated by the following method: Among them, is the static reference threshold determined by the ROC curve; N is the number of points of the user's historical data; μ is the average value of the user's historical depression index; σ is the standard deviation of the user's historical depression index; K is the adjustment coefficient; n is the amount of user data.

7. The method according to claim 6, characterized in that Also including: If the depression index is less than the calculated threshold, output the emotion category.

8. A brain wave depression diagnosis device based on localization processing, characterized in that, Including: An acquisition module for acquiring the original signal data; A preprocessing module for preprocessing the original signal data to extract the frequency-domain features and time-domain features in the original signal data; A processing module for inputting the frequency-domain features and time-domain features into the trained emotion classification model to obtain the emotion category and the depression index; An output module for outputting the emotion category and the warning information corresponding to the emotion category if the depression index is greater than or equal to the calculated threshold.

9. An electronic device, comprising a memory and a processor, wherein a computer program is stored on the memory, characterized in that, When the processor executes the computer program, it implements the method described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method described in any one of claims 1 to 7.