Depression recognition model, light-weight method, edge deployment method, depression recognition system and method
By building a multi-branch fusion model of EfficientNet and GRU branches on edge devices and combining it with a lightweight and heterogeneous computing platform, the problems of insufficient accuracy and waste of computing resources in depression diagnosis in existing technologies are solved, and efficient and real-time depression identification is achieved.
Patent Information
- Application Number
- CN202510937324.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-07-08
AI Technical Summary
Existing methods for diagnosing depression rely on doctors' experience and scale assessments, which are highly subjective and lack accuracy. Deep learning models have high computational complexity and a large number of parameters when processing EEG signals, making it difficult to achieve real-time inference on resource-constrained edge devices. Furthermore, existing model deployment schemes cannot fully utilize the hardware advantages of heterogeneous computing platforms, resulting in low inference efficiency.
It adopts a multi-branch fusion structure of EfficientNet and GRU branches, combined with a multi-scale feature extraction module and a feature fusion and classification module. Lightweight processing is performed through channel pruning, hierarchical pruning, Ghost module replacement and AdaQuant quantization. It is heterogeneously deployed on the Zynq UltraScale+ MPSoC ZCU102 platform and works in collaboration with FPGA accelerator and multi-core processor.
It achieves efficient feature extraction and depression recognition on edge devices, improves recognition accuracy and computational efficiency, meets real-time and energy efficiency requirements, reduces model size and computational resource consumption, and is compatible with resource-constrained devices.
Smart Images

Figure CN120853884B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical artificial intelligence, in particular to a depression recognition model, a lightening method, an edge deployment method, a depression recognition system and method. BACKGROUND
[0002] Depression is a mental illness marked by persistent and severe emotional low, which can impair the health of patients and cause problems in sleep, body function and cognitive ability. According to the severity, depression can be divided into three levels of light, medium and heavy, which has a profound impact on individuals, families and society.
[0003] Depression is difficult to cure and easy to relapse. Therefore, early detection and intervention are crucial for the relief of depression symptoms and the control of the disease. Currently, the diagnosis of depression mainly relies on the experience of doctors, patient self-reports and scale assessment (such as BDI, PHQ9, etc.), but the accuracy of these methods is affected by the patient's cooperation and the doctor's professional level, and there is subjectivity. Introducing objective physiological indicators to identify depression is a key way to improve diagnostic accuracy.
[0004] Currently, various technologies can be used to diagnose depression and other mental illnesses, mainly divided into invasive (such as electrocorticography ECOG, local field potentials LFPs) and non-invasive (computed tomography CT, magnetic resonance imaging MRI, electroencephalogram EEG) two categories. EEG can reflect changes in brain function more objectively and efficiently than scales due to its millisecond-level high time resolution. EEG is not only non-invasive and safe, but also more portable, easier to operate and lower in cost than CT, MRI and other non-invasive methods. The frontal three leads Fp1, Fpz and Fp2 in the 10-20 system electrode placement method can record the electroencephalogram activity of the frontal lobe, including α 、 β 、 θ , etc. One of the electroencephalogram characteristics of depression patients is the asymmetry of α wave. Therefore, analyzing the electroencephalogram signals collected by these three electrodes and extracting relevant features can analyze and research depression. Raw electroencephalogram signals can more truly reflect brain activity and simplify the depression recognition process, but feature extraction is difficult, resulting in poor classification effect of traditional machine learning models.
[0005] Deep learning neural networks can automatically extract key features from raw signals through end-to-end learning without human intervention and reduce human error. However, existing deep learning models often have high computational complexity and large model parameter quantity when processing electroencephalogram signals, making it difficult to implement real-time inference on resource-constrained edge devices. At the same time, existing model deployment schemes often fail to fully utilize the hardware advantages of heterogeneous computing platforms, resulting in low inference efficiency and failing to meet the real-time and energy efficiency requirements in actual applications. SUMMARY
[0006] Therefore, the present application provides a depression recognition model, a lightweight method, an edge deployment method, a depression recognition system and method, which has the advantages of efficient feature extraction through a multi-branch fusion structure, while considering model accuracy and computational efficiency.
[0007] In a first aspect, the present application provides a depression recognition model, comprising: an EfficientNet branch, a GRU branch, and a feature fusion and classification module connected in sequence.
[0008] The EfficientNet branch comprises an initial convolutional layer, a multi-scale feature extraction module, and a feature output layer connected in sequence; the multi-scale feature extraction module comprises a plurality of residual units connected in sequence; each residual unit comprises a first convolutional layer, a depthwise separable convolutional layer, an SE module, a second convolutional layer, and a Dropout layer.
[0009] The GRU branch comprises a feature reshaping layer, a GRU layer, an average pooling layer, a Dropout layer, and a feature fusion and classification module connected in sequence; the GRU layer comprises a plurality of parallel GRU units; the feature fusion and classification module comprises a fully connected layer and a classification layer connected in sequence.
[0010] In a second aspect, the present application further provides a lightweight method for a depression recognition model, comprising:
[0011] Channel pruning and hierarchical pruning are performed on each residual unit in the multi-scale feature extraction module.
[0012] The first fully connected layer in the SE module is replaced by a Ghost module.
[0013] 32-bit floating-point parameters are quantized to 16-bit fixed-point numbers through AdaQuant quantization.
[0014] In a third aspect, the present application further provides an edge deployment method for deploying a lightweight model obtained by the lightweight method for a depression recognition model, comprising: the deployment platform is Zynq UltraScale+ MPSoC ZCU102, which integrates a PL end and a PS end.
[0015] The PS side includes a quad-core ARM Cortex-A53 processor and a dual-core Cortex-R5 processor;
[0016] The PL terminal integrates a ZU9EG FPGA chip; the FPGA chip integrates a DPU accelerator in the form of an IP core;
[0017] The EfficientNet branch is accelerated by the DPU on the PL side, and the GRU branch is executed by the Cortex-A53 on the PS side via ONNXRuntime.
[0018] EEG data is transmitted between the PS and PL terminals via the AXI bus.
[0019] Fourthly, the present invention also provides a depression identification system, comprising:
[0020] The three-channel EEG acquisition device is used to acquire raw EEG signals of subjects in real time when they are at rest with their eyes closed, and transmit them to the deployed Zynq UltraScale+MPSoC ZCU102 platform via UART.
[0021] The Zynq UltraScale+MPSoC ZCU102 platform is connected to a three-channel EEG acquisition device to acquire raw EEG signals; and, based on the raw EEG signals, a lightweight model is used to identify depression in the subject, and the depression identification result of the subject is obtained.
[0022] The host computer is connected to the Zynq UltraScale+MPSoC ZCU102 platform to acquire and display the depression recognition results.
[0023] In one optional implementation, the PS side of the Zynq UltraScale+ MPSoC ZCU102 platform is provided with a main thread, a data receiving thread, a preprocessing thread, an EfficientNet inference thread, and a GRU inference thread.
[0024] The data receiving thread is used to receive the raw EEG signals from the three-channel EEG acquisition device.
[0025] A preprocessing thread is used to preprocess the raw EEG signals; the preprocessing includes slicing and normalization operations.
[0026] The Efficient inference thread is used to call the DPU accelerator on the PL side to perform forward inference of the EfficientNet branch on the preprocessed EEG signal, obtain the high-order features of the EEG signal, and transmit the high-order features of the EEG signal to the PS side through the AXI bus.
[0027] The GRU inference thread is used to complete the final identification of depression in the subject using the ONNX Runtime.
[0028] Fifthly, the present invention also provides a method for identifying depression, applied to a depression identification system, comprising:
[0029] Real-time acquisition of raw electroencephalogram (EEG) signals from subjects in a resting state with their eyes closed;
[0030] The raw EEG signals are preprocessed; the preprocessing includes slicing and normalization operations.
[0031] The preprocessed EEG signals were input into a lightweight model to identify depression, and the corresponding depression identification results were obtained.
[0032] The depression identification results are displayed.
[0033] This invention effectively improves the feature extraction capability of EEG signals by constructing a fusion model that includes EfficientNet and GRU branches, and combining a multi-scale feature extraction module with a parallel processing structure. At the same time, through lightweight processing and heterogeneous platform deployment, the model can run efficiently on edge devices. It has the advantages of achieving efficient feature extraction through a multi-branch fusion structure, while taking into account both model accuracy and computational efficiency. Attached Figure Description
[0034] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0035] Figure 1 This is a framework diagram of a depression recognition model according to an embodiment of the present invention;
[0036] Figure 2 This is a framework diagram of a depression recognition system according to an embodiment of the present invention;
[0037] Figure 3 This is a framework diagram of a multi-threaded design according to an embodiment of the present invention;
[0038] Figure 4 This is a flowchart illustrating a depression identification method according to an embodiment of the present invention. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0040] In existing technologies, the diagnosis of depression mainly relies on doctors' experience and scale assessments, which suffers from high subjectivity and insufficient accuracy. In objective diagnostic methods based on electroencephalogram (EEG) signals, traditional machine learning requires manual feature extraction, a complex process with limited classification performance. Existing deep learning models mostly employ a single network structure, making it difficult to simultaneously capture the spatial distribution features and temporal dependencies of EEG signals, thus limiting recognition accuracy. When deployed on edge devices, complex models suffer from high computational resource consumption and poor real-time performance.
[0041] To address the aforementioned issues, considering the dual spatiotemporal characteristics of EEG signals, it is necessary to simultaneously analyze spatial distribution patterns and temporal evolution. Traditional convolutional neural networks excel at spatial feature extraction but struggle to model long-term temporal dependencies; recurrent neural networks can handle temporal information but have weak spatial feature capture capabilities. Combining the advantages of both networks to construct a dual-branch structure becomes a feasible approach. However, simply concatenating these networks leads to a surge in parameters, necessitating the design of a reasonable feature interaction mechanism. Furthermore, the model must adapt to the computational limitations of edge devices, requiring optimization of computational efficiency while maintaining accuracy.
[0042] Therefore, this invention proposes a depression recognition model, such as... Figure 1 As shown, the architecture includes a cascaded EfficientNet branch, a GRU branch, and a feature fusion and classification module. The EfficientNet branch contains an initial convolutional layer, a multi-scale feature extraction module, and a feature output layer. The multi-scale feature extraction module consists of multiple residual units connected in series. Each residual unit contains a first convolutional layer, a depthwise separable convolutional layer, an SE module, a second convolutional layer, and a Dropout layer. The GRU branch contains a feature reshaping layer, a GRU layer, an average pooling layer, and a Dropout layer. The GRU layer consists of multiple parallel GRU units. The feature fusion and classification module contains a fully connected layer and a classification layer.
[0043] The EfficientNet branch refers to a convolutional neural network structure optimized based on a composite scaling strategy. By adjusting the depth, width, and resolution parameters, it balances computational complexity and accuracy to extract spatial distribution features of EEG signals. Depthwise separable convolutional layers decompose standard convolution into a combination of depthwise convolution and pointwise convolution, specifically implemented using 3×3 convolutional kernels, reducing the number of parameters while maintaining feature extraction capabilities. The SE module refers to a channel attention mechanism, specifically using global average pooling to generate channel weights and enhance depression-related feature channels. The GRU branch refers to a temporal processing network composed of gated recurrent units, specifically employing a bidirectional GRU structure. Update and reset gates control information flow, capturing rhythmic variation features of EEG signals. The feature reshaping layer converts two-dimensional feature maps into time-step sequences, specifically achieved by adjusting tensor dimensions to adapt the convolutional network output to the recurrent network input format. Parallel GRU units refer to multiple independently operating GRU structures, with different time window lengths set to extract local and global temporal features separately.
[0044] Specifically, after the EEG signal is input into the EfficientNet branch, the initial convolutional layer (Conv2d) performs low-level feature mapping to generate a feature map containing basic rhythmic information. The multi-scale feature extraction module extracts spatial features under different receptive fields layer by layer through residual unit stacking: the first convolutional layer (Conv 1×1) expands the feature channels, the depthwise separable convolutional layer (Dwise 3×3) extracts multi-scale information in the spatial dimension, the SE module filters important feature channels, the second convolutional layer (Conv 1×1) compresses the channel dimension, and the Dropout layer prevents overfitting. The feature output layer (Conv2d) converts the spatial features into fixed-dimensional vectors. In the GRU branch, the feature reshaping layer reassembles the spatial features into sequential data according to time steps, multiple parallel GRU cells process data streams at different time scales, the average pooling layer aggregates temporal features, and the Dropout layer enhances generalization ability. The feature fusion and classification module concatenates the output vectors of the two branches, realizes feature interaction through a fully connected layer, and finally outputs the recognition result by the classification layer.
[0045] Compared to existing technologies, traditional methods often employ single convolutional or recurrent networks to process EEG signals, failing to consider spatiotemporal features. Some fusion models use simple serial structures, resulting in insufficient feature interaction and computational redundancy. This invention utilizes dual-branch parallel processing to control the number of parameters while maintaining model depth. The design of the SE module and parallel GRU enhances feature selection capabilities. Compared to single network structures, this approach improves the representation ability of spatiotemporal features with the same computational resources.
[0046] Through the above technical solution, this invention achieves end-to-end automatic extraction of depressive features, avoiding information loss caused by manual feature engineering. The dual-branch structure works collaboratively to effectively capture the spatiotemporal correlation characteristics of EEG signals, improving classification accuracy. The modular design makes the model scalable, adaptable to different hardware platforms by adjusting the number of residual units and GRU unit parameters.
[0047] Furthermore, in terms of model training, shallow CNNs have weak feature extraction capabilities and are susceptible to noise interference; deep CNNs are prone to degradation. EfficientNet achieves a good balance between efficiency and performance, but its complex structure is not conducive to edge deployment. In addition, EEG signals are temporal data, and a single CNN struggles to capture their temporal dependencies, resulting in limited performance. Among recurrent neural networks, GRU has a simpler structure, lower computational cost, and comparable performance compared to LSTM. Therefore, this invention combines GRU with CNN to generate an EfficientNet+GRU fusion model, which can simultaneously learn the temporal and spatial features of EEG signals. In the depression recognition task, this fusion model achieves an accuracy of 88.42% with a model size of 18.73 MB.
[0048] To adapt to the limited computing resources of edge devices, this invention also provides a lightweight method for a depression recognition model, comprising:
[0049] Step 1: Perform channel pruning and hierarchical pruning on each residual unit in the multi-scale feature extraction module.
[0050] Specifically, since the amount of input image data in the original EfficientNet architecture is 50.18 times that of EEG data, the excessive number of channels in some residual units can lead to overfitting, resource waste, and a decrease in inference speed. Therefore, this invention requires two types of model pruning operations—channel pruning and hierarchical pruning—on the fusion model while maintaining the original channel ratio.
[0051] Step 2: Replace the first fully connected layer in the SE module with the Ghost module.
[0052] Specifically, the two fully connected layers in the SE module (which are represented by 1x1 convolutions) have a high computational cost. To reduce costs, the first fully connected layer is replaced with the Ghost module.
[0053] Step 3: Quantize the 32-bit floating-point parameter into a 16-bit fixed-point number using AdaQuant quantization.
[0054] Specifically, the default 32-bit floating-point weight parameters used during PC model training were quantized to 16-bit fixed-point numbers. AdaQuant quantization was used to minimize quantization error, improving performance metrics while avoiding excessive perturbation. Finally, after three lightweighting methods—model pruning, attention mechanism compression, and weight quantization—a lightweight model was obtained, reducing the model file size to 31.45% of the original.
[0055] Channel pruning refers to the removal of redundant feature channels based on channel importance assessment results. Specifically, it can be implemented using an L1 norm-based channel importance ranking method, setting a threshold to filter out channels with lower contributions and pruning them, thereby reducing the channel dimension of the feature map. Layer pruning refers to removing redundant stacked residual unit layers in the network. Specifically, it can be implemented using a gradient magnitude-based layer importance assessment method, analyzing the gradient distribution of weights in each layer during backpropagation to identify and remove layers with minimal impact on the model output. The Ghost module is a lightweight convolutional module that generates partial feature maps using linear transformations. Specifically, it can be implemented using a combination of grouped convolutions and pointwise convolutions, reducing computational complexity by minimizing matrix multiplication operations in fully connected layers. AdaQuant quantization is a parameter quantization method based on an adaptive calibration strategy, specifically implemented using dynamic range adjustment and quantization error compensation mechanisms. It dynamically adjusts the quantization interval by analyzing weight distribution characteristics, mapping 32-bit floating-point numbers to 16-bit fixed-point numbers.
[0056] Specifically, in the model structure optimization stage, channel pruning and layer pruning are simultaneously implemented on the residual units. The importance of each channel is evaluated using the L1 norm, and redundant channels are pruned. Redundant layers are identified and pruned using gradient magnitude analysis, reducing the network depth and width while preserving core feature extraction capabilities. In the attention mechanism optimization stage, the fully connected layers in the SE module are replaced with Ghost modules. Grouped convolutions are used to generate partial feature maps, reducing computational resource consumption by decreasing the number of matrix multiplications. In the parameter compression stage, the AdaQuant quantization method is used to analyze the weight distribution characteristics, dynamically adjust the quantization step size, and compensate for errors, converting high-precision floating-point parameters to low-precision specific point values, thus reducing memory usage.
[0057] Compared to existing technologies, traditional model compression methods only employ single-dimensional channel pruning or static quantization strategies, failing to achieve multi-dimensional structural optimization while maintaining model accuracy. Existing attention mechanism modules have computationally intensive fully connected layers, making them difficult to adapt to the computing power of edge devices. Conventional quantization methods use fixed quantization intervals, which are prone to accuracy loss due to uneven weight distribution. This invention achieves structural simplification through joint channel and layer pruning, optimizes the attention computation path using the Ghost module, and combines an adaptive quantization strategy to balance accuracy and efficiency, forming a multi-dimensional lightweight technology system.
[0058] Through the above technical solution, the present invention effectively reduces the consumption of computing resources during model inference, reduces the number of network parameters and memory space occupied, enables the fusion model to adapt to the limited computing power and storage resources of edge devices, and maintains the feature extraction capability and classification accuracy required for the depression recognition task.
[0059] This invention also provides an edge deployment method for a lightweight model, comprising: a deployment platform of Zynq UltraScale+MPSoC ZCU102, integrating a PL end and a PS end; the PS end includes a quad-core ARM Cortex-A53 processor and a dual-core Cortex-R5 processor; the PL end integrates a ZU9EG FPGA chip; the FPGA chip integrates a DPU accelerator in the form of an IP core; the EfficientNet branch is accelerated by the DPU on the PL end, and the GRU branch is executed by the Cortex-A53 on the PS end through ONNXRuntime; EEG data is transmitted between the PS end and the PL end via an AXI bus.
[0060] Among them, Zynq UltraScale+ MPSoC ZCU102 refers to a heterogeneous computing platform, which includes a hardware architecture of programmable logic units and processing systems. Specifically, it can be implemented using Zynq UltraScale+ series chips produced by Xilinx. Its PL and PS sides work together to provide a hardware foundation for heterogeneous model deployment.
[0061] The PL side refers to the programmable logic unit, which can be implemented using a ZU9EG FPGA chip. The logic circuit is configured through a hardware description language to integrate the DPU accelerator for executing parallel computing-intensive tasks.
[0062] Among them, the DPU accelerator is a programmable engine that accelerates deep neural networks. It is integrated into the FPGA in the form of an IP core. Specifically, it can be implemented using the DPU IP core provided by Xilinx, which accelerates the forward inference process of convolutional neural networks through hardware-level parallel computing.
[0063] The PS (Power Supply) refers to the processing system, which can be implemented using a multi-core processor cluster consisting of a quad-core ARM Cortex-A53 and a dual-core Cortex-R5, supporting multi-threaded task scheduling and lightweight timing model computation. The Cortex-A53 processor supports the Open Neural Network Exchange Runtime (ONNX Runtime).
[0064] AXI bus refers to the Advanced Extensible Interface Protocol, which can be implemented using the AXI4-Stream protocol. It enables EEG signal interaction between the PL and PS terminals through a high-speed data transmission channel.
[0065] Specifically, this deployment method accelerates the model through a heterogeneous computing architecture. The PL (Programmable Logic Controller) of the Zynq platform deploys an FPGA chip with an integrated DPU (Digital Processing Unit) accelerator IP core to perform convolution operations in the EfficientNet branch, leveraging hardware parallelism to accelerate feature extraction. The PS (Power Separator) side uses a multi-core ARM processor running the ONNX Runtime framework, calling the Cortex-A53 core to perform temporal computations in the GRU branch, achieving efficient inference for the recurrent neural network through software optimization. Preprocessed EEG data is transmitted from the PS to the PL via the AXI bus. The higher-order features, after DPU acceleration, are then returned to the PS via the same bus, completing feature fusion and classification of the two branches.
[0066] Compared to existing technologies, traditional edge deployment solutions typically use a single processor to execute the complete model, resulting in low utilization of computing resources. For example, when relying solely on the CPU to sequentially execute hybrid models, the convolutional network portion cannot leverage its hardware acceleration advantages; while deploying the timing model to an FPGA results in excessively high hardware reconfiguration costs and insufficient flexibility. This invention, through the division of labor and collaboration between the PL and PS ends, maps computationally intensive modules and lightweight timing processing to the FPGA and multi-core ARM processor respectively, thereby reducing hardware resource consumption while improving overall inference efficiency.
[0067] Through the above technical solution, this invention solves the problem of low deployment efficiency of hybrid models under the condition of limited edge device resources, and realizes the rational allocation of computing resources in the process of EEG signal processing. By working together with the hardware acceleration unit and the general-purpose processor, the model inference latency is significantly shortened while ensuring recognition accuracy, and the overall power consumption of the system is reduced, meeting the requirements of real-time depression recognition scenarios for processing speed and energy efficiency.
[0068] This invention also provides a depression recognition system, such as Figure 2 As shown, it includes: a three-channel EEG acquisition device, a Zynq UltraScale+MPSoC ZCU102 platform, and a host computer.
[0069] The three-channel EEG acquisition device is used to acquire raw EEG signals of subjects in real time when they are at rest with their eyes closed, and transmit them to the Zynq UltraScale+MPSoC ZCU102 platform (ZCU102 platform for short) via UART.
[0070] The Zynq UltraScale+MPSoC ZCU102 platform is connected to a three-channel EEG acquisition device to acquire raw EEG signals; and, based on the raw EEG signals, a lightweight model is used to identify depression in the subject, and the depression identification result of the subject is obtained.
[0071] The preferred three-channel EEG acquisition device is a universal three-channel EEG acquisition device, which refers to a portable acquisition device equipped with three forehead electrodes (Fp1, Fp2, and Fp2). Specifically, it can utilize a low-power Bluetooth module and patch-type dry electrodes to achieve signal acquisition, reducing the complexity of the device by decreasing the number of electrodes. The Zynq UltraScale+MPSoC ZCU102 platform refers to a heterogeneous computing platform integrating programmable logic units and a processing system. Specifically, it can perform convolution operations through the DPU accelerator on the PL side and optimize hardware resource allocation by utilizing the runtime sequence model of the PS side processor. The host computer refers to a computing terminal with a graphical interface, which can be an embedded industrial control computer or a mobile terminal device, receiving and visualizing the recognition results via the TCP / IP protocol.
[0072] Specifically, the three-channel EEG acquisition device continuously acquires raw EEG signals in a resting state with eyes closed, and transmits the data to the ZCU102 platform via a UART interface. The PS (Power Supply) end of the ZCU102 platform uses a multi-threaded architecture to simultaneously process data reception, signal preprocessing, and model inference tasks. The preprocessing thread performs time slicing and normalization on the raw signals to eliminate signal fluctuations caused by individual differences. The processed data is then routed via an AXI bus to the DPU accelerator at the PL (Power Supply) end to perform EfficientNet branch inference. After extracting spatial features, the data is returned to the PS end for feature fusion with the temporal analysis results of the GRU branch. Finally, the classification layer outputs the recognition result. The host computer receives the recognition result in real time and generates a visual report, forming a complete diagnostic loop.
[0073] Compared to existing technologies, traditional depression recognition systems often use cloud servers to process EEG data, which poses risks of transmission delays and privacy breaches. Current edge device deployment solutions typically deploy the entire model on a single processor, failing to effectively balance the computational load. This invention utilizes a heterogeneous computing architecture to split the model into an FPGA acceleration section and a CPU execution section, combined with a three-channel portable acquisition device, achieving end-to-end real-time processing while maintaining recognition accuracy. Compared to traditional systems using eight or more EEG caps, this invention effectively captures prefrontal cortex data while reducing the number of electrodes by 62.5%. α Wave asymmetry characteristics.
[0074] Through the above technical solutions, this invention achieves real-time acquisition and processing of EEG signals at the edge, avoiding network latency caused by data transmission to the cloud, and reducing the recognition response time to milliseconds. The three-electrode configuration and localized processing mode reduce device power consumption, enabling the system to operate continuously for over eight hours. Optimized allocation of hardware resources improves model inference efficiency, achieving the ability to process thirty EEG segments per second on the ZCU102 platform, meeting the needs of real-time clinical monitoring. The overall system size is kept within the standard range for portable medical devices, making it suitable for depression screening in resource-constrained settings such as community clinics.
[0075] In one alternative implementation, such as Figure 2 He Ru Figure 3 As shown, the PS side of the Zynq UltraScale+ MPSoC ZCU102 platform has a main thread, a data receiving thread, a preprocessing thread, an EfficientNet inference thread, and a GRU inference thread.
[0076] The data receiving thread is used to receive the raw EEG signals from the three-channel EEG acquisition device.
[0077] The preprocessing thread is used to preprocess the raw EEG signals; preprocessing includes slicing and normalization operations.
[0078] For example, in the preprocessing thread, a universal three-channel EEG acquisition device can be used to collect 90 seconds of resting-state EEG data from the subject with eyes closed. This device has a sampling frequency of 250Hz, and its built-in circuitry effectively reduces noise and eliminates 50Hz power frequency interference, ensuring signal quality. Considering the potential for unstable signals introduced at the beginning of the acquisition, the first 6 seconds of each 90-second EEG data segment are removed, and the remaining 84 seconds of data are divided into 4-second segments and normalized.
[0079] The Efficient inference thread is used to call the DPU accelerator on the PL side to perform forward inference of the EfficientNet branch on the preprocessed EEG signal, obtain the high-order features of the EEG signal, and transmit the high-order features of the EEG signal to the PS side through the AXI bus.
[0080] The GRU inference thread is used to complete the final depression identification of the subject using the ONNX Runtime;
[0081] The main thread coordinates the operation of other threads and enables interaction between the user and the host computer.
[0082] The main thread refers to the core scheduler running on the ARM processor at the PS end, which can be implemented using a multi-threaded management framework to coordinate task allocation and resource synchronization among sub-threads. The data receiving thread is an independently running signal acquisition module, which can be implemented using a UART interrupt service routine to ensure that real-time EEG signal reception is not interrupted by other tasks. The preprocessing thread is a data format conversion module, which can be implemented using a sliding window slicing algorithm combined with Z-score normalization to convert raw signals into the tensor format required for model input. The EfficientNet inference thread is the hardware acceleration call interface, which can be implemented using the DPU driver API to trigger the FPGA accelerator to execute convolutional neural network calculations. The AXI bus is a high-speed data transmission channel within the heterogeneous computing platform, which can be implemented using the AXI4-Stream protocol to achieve low-latency data interaction between the PL and PS ends.
[0083] Specifically, the main thread coordinates the execution order of each sub-thread through a priority scheduling mechanism. The data receiving thread continuously listens to the UART port to acquire EEG data streams. The preprocessing thread performs time window slicing on the raw signals to generate continuous sample segments and performs normalization to eliminate individual differences. The EfficientNet inference thread transfers the preprocessed data to the PL end via DMA, triggering the DPU accelerator to complete convolutional feature extraction. Subsequently, the high-order features are sent back to the PS end's shared memory (DDR memory) via the AXI bus. The GRU inference thread reads feature data from the shared memory, calls the ONNX Runtime engine to perform temporal modeling, and finally outputs the classification results. Each thread implements data pipeline processing through a circular buffer, enabling data acquisition, preprocessing, and model inference to form a parallel execution chain.
[0084] Compared to existing technologies, traditional edge computing platforms typically employ a single-threaded sequential processing mode, resulting in processing gaps between data acquisition and model inference, failing to meet real-time requirements. Existing technologies also suffer from serial latency in the preprocessing and model inference stages and do not fully utilize heterogeneous computing resources. This invention achieves task-level parallelism through a multi-threaded architecture, utilizes hardware accelerators to distribute the computational load, and optimizes cross-domain data transmission via the AXI bus, thus solving the problems of low resource utilization and high end-to-end latency in traditional methods.
[0085] Through the above technical solutions, this invention achieves pipelined parallel processing of EEG signal acquisition, preprocessing, and model inference, effectively shortening end-to-end processing latency. Through the collaborative optimization of hardware accelerators and software frameworks, the utilization rate of computing resources is significantly improved while ensuring recognition accuracy. The collaborative working mode of the heterogeneous computing architecture allows for a reasonable allocation of computationally intensive tasks and logic control tasks, meeting the stringent requirements of edge devices for real-time performance and energy efficiency.
[0086] To verify the technical effectiveness of the present invention, the depression recognition system was placed in a simulated real-world application scenario to test its true performance and potential value.
[0087] The experimental design fully considered both scientific rigor and practical feasibility, inviting 7 depressed participants and 8 normal participants. Each participant had to undergo up to 21 experimental procedures. This was not arbitrary, but rather based on considerations of the duration of EEG signal collection and the simplification of the overall experimental steps. While ensuring data reliability, necessary rest intervals were set to maintain the consistency of the participants' states.
[0088] At the individual level, due to individual differences, emotional fluctuations, or changes in physiological state, the identification results of depression by this invention may exhibit some volatility. However, considering the large and representative dataset collected throughout the experiment—a total of 315 experiments—the results are quite convincing. This invention can predict and judge an individual's depressive state in an extremely short time, averaging 3.30 seconds. This means that this invention has the ability to process and analyze EEG signals in real time, instantly capturing and responding to possible emotional changes in an individual. More importantly, the overall accuracy rate reaches an outstanding level of 85.40%.
[0089] In summary, this invention achieves high-precision identification of depressive states, providing strong support for clinical diagnosis. Secondly, the real-time nature of the EEG signals acquired by this invention enables the system to dynamically monitor individual states, creating conditions for timely intervention. Thirdly, this invention avoids the information loss or bias that may result from the complex preprocessing steps in existing methods. Finally, this invention protects user privacy to a certain extent, reducing the psychological burden that traditional questionnaires or interviews may bring. In conclusion, this invention verifies the enormous potential of a real-time depression identification system, providing an innovative and highly practical technical solution for the timely diagnosis and early warning of mental illnesses such as depression.
[0090] This invention also provides a method for identifying depression, such as... Figure 4As shown, the process includes: real-time acquisition of raw EEG signals from subjects in a resting state with their eyes closed; preprocessing of the raw EEG signals; inputting the preprocessed EEG signals into a lightweight model for depression identification; obtaining the corresponding depression identification results; and displaying the depression identification results.
[0091] Among them, the closed-eye resting state refers to the method of collecting EEG signals when the subject is in a relaxed state without visual stimulation. Specifically, it can be achieved by combining ambient light control with voice guidance, and the signal quality can be improved by eliminating eye movement artifacts.
[0092] Slicing refers to dividing continuous EEG signals into multiple temporal segments of fixed duration. Specifically, it can be achieved using a sliding window mechanism, which adapts the model input dimension by dividing data units of equal length.
[0093] Normalization refers to mapping the amplitude of EEG signals to a uniform numerical range. Specifically, it can be achieved by using the maximum and minimum value scaling method, which improves the model's generalization ability by eliminating individual physiological differences.
[0094] The lightweight model refers to a neural network model that has undergone channel pruning, Ghost module replacement, and weight quantization. Specifically, it can be implemented by dynamically adjusting the pruning rate and compensating for quantization errors, thereby reducing the consumption of computing resources by compressing the network size.
[0095] Specifically, the closed-eye resting-state acquisition method ensures the authenticity of the three-lead EEG signal in the frontal lobe by suppressing electromyographic interference caused by blinking and eye movements. The acquired raw signal is segmented into temporal segments containing fixed sampling points using a sliding window to eliminate the influence of signal length differences on model inference. Normalization transforms the signals of each channel linearly to the [-1,1] interval to eliminate classification bias caused by individual differences in EEG amplitude. The preprocessed data is input into a lightweight model. The EfficientNet branch extracts spatial features through depthwise separable convolutions, while the GRU branch captures temporal dependencies through a gating mechanism. After feature fusion, the classification layer outputs the recognition result. The recognition result is displayed in real time through a graphical interface, forming a closed-loop process from signal acquisition to result feedback.
[0096] Compared to existing technologies, traditional EEG-based depression identification methods rely on multi-lead devices to collect signals from mixed open and closed states, which is susceptible to electrooculography artifacts and involves bulky equipment. Existing model deployment schemes often employ cloud-based transmission and processing, posing risks of privacy breaches and incurring high latency. This invention reduces signal noise by utilizing the closed-eye resting state and achieves portable data acquisition using a three-lead device; it employs a localized hybrid deployment strategy, completing signal processing and model inference at the edge, avoiding data transmission and reducing processing latency.
[0097] Through the above technical solution, the present invention achieves stable acquisition of low-interference EEG signals, eliminates the influence of individual physiological differences on the model through preprocessing, and completes real-time inference at the edge using a lightweight model, thus ensuring recognition accuracy while meeting the requirements of processing speed and privacy protection in practical application scenarios.
[0098] In summary, this invention first relates to a depression recognition fusion model. This model abandons the cumbersome process of complex signal preprocessing followed by feature extraction in existing technologies, and adopts a fusion architecture combining EfficientNet and GRU from deep CNNs. The EfficientNet part excels at capturing the complex features of EEG signals in the spatial dimension, while the GRU part can effectively parse the temporal dependencies contained in EEG signals. The two work together, enabling the model to directly learn and extract key features highly correlated with depressive states from the raw EEG signals end-to-end. This not only simplifies the recognition process and ensures the integrity of EEG information, but also improves the accuracy of recognition. However, considering that the computational cost of such a fusion model is still too high for resource-constrained edge devices, this invention performs a series of lightweight processing on the fusion model. This includes model pruning, which involves channel and layer pruning to reduce redundant channels and layers without significantly affecting model performance, thereby reducing the number of parameters and computational burden. Simultaneously, for the computationally intensive attention mechanism, the original fully connected layer is replaced with the more computationally efficient Ghost module. Finally, weight quantization technology is used to quantize the 32-bit floating-point weights originally used during PC training into 16-bit fixed-point numbers. The AdaQuant quantization strategy minimizes quantization error, ensuring model accuracy while significantly reducing model size, enabling successful deployment on edge devices with limited computing power. Furthermore, this invention deploys the lightweight fusion model on the high-performance edge computing platform ZCU102. ZCU102 integrates powerful processing capabilities, including both a PS (Power Supply) and PL (Power Processor) layer. The deployment strategy employs a hybrid approach: the deep learning processing unit (DPU) built into the ZCU102 PL terminal is used to specifically accelerate the computationally intensive EfficientNet portion, fully leveraging the advantages of FPGA parallel processing; while the relatively less computationally demanding GRU portion is deployed on the Cortex-A53 processor on the PS terminal and runs efficiently using the ONNX Runtime framework. This clearly defined hybrid deployment strategy aims to maximize the speed of the entire network inference while balancing the efficiency required for processing EEG time-series data and the accuracy of recognition. Finally, this invention constructs a complete real-time depression recognition system. Based on a lightweight fusion model and the ZCU102 platform, this system utilizes a multi-threaded architecture designed for the ZCU102 PS terminal, combined with a universal three-channel EEG acquisition device, to achieve real-time acquisition, processing, and recognition of raw EEG signals. It exhibits significant advantages in portability, low power consumption, high accuracy, and low latency, providing a highly promising technical path for the timely diagnosis and early intervention of depression.
[0099] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A depression identification system, characterized in that, include: The three-channel EEG acquisition device is used to acquire raw EEG signals of subjects in a resting state with their eyes closed in real time, and transmit them to the Zynq UltraScale+MPSoC ZCU102 platform via UART. The Zynq UltraScale+MPSoC ZCU102 platform connects to a three-channel EEG acquisition device to acquire raw EEG signals. Furthermore, based on the original EEG signals, a lightweight model was used to identify depression in the subjects, and the depression identification results of the subjects were obtained. A host computer, connected to the platform, is used to acquire and display the depression identification results; The lightweight model is obtained by lightweighting the depression recognition model, which includes a sequentially cascaded EfficientNet branch, a GRU branch, and a feature fusion and classification module. The EfficientNet branch includes: an initial convolutional layer, a multi-scale feature extraction module, and a feature output layer, which are cascaded in sequence; the multi-scale feature extraction module includes multiple residual units, which are cascaded in sequence; each residual unit includes a first convolutional layer, a depthwise separable convolutional layer, an SE module, a second convolutional layer, and a Dropout layer; The GRU branch includes: a cascaded feature reshaping layer, a GRU layer, an average pooling layer and a Dropout layer, and a feature fusion and classification module; the GRU layer includes multiple parallel GRU units; the feature fusion and classification module includes a cascaded fully connected layer and a classification layer. The lightweighting steps include: Perform channel pruning and hierarchical pruning on each residual unit in the multi-scale feature extraction module; Replace the first fully connected layer in the SE module with the Ghost module; AdaQuant quantization was used to quantize a 32-bit floating-point parameter into a 16-bit fixed-point number. After the EEG signal is input into the EfficientNet branch, the initial convolutional layer performs low-level feature mapping to generate a feature map containing basic rhythm information. The multi-scale feature extraction module extracts spatial features under different receptive fields layer by layer through residual unit stacking. In the GRU branch, the feature reshaping layer reassembles the spatial features into sequential data according to time steps. Multiple parallel GRU units process data streams at different time scales respectively. The average pooling layer aggregates temporal features, the Dropout layer enhances generalization ability, and the feature fusion and classification module concatenates the output vectors of the two branches. Feature interaction is achieved through a fully connected layer, and finally the classification layer outputs the recognition result. The platform integrates a PL terminal and a PS terminal; The PS side includes a quad-core ARM Cortex-A53 processor and a dual-core Cortex-R5 processor; The PL terminal integrates a ZU9EG FPGA chip; the FPGA chip integrates a DPU accelerator in the form of an IP core; The EfficientNet branch is accelerated by the DPU on the PL side, while the GRU branch is executed by the Cortex-A53 on the PS side via the ONNX Runtime. EEG data is transmitted between the PS and PL terminals via the AXI bus.
2. The system according to claim 1, characterized in that, The PS side of the Zynq UltraScale+ MPSoC ZCU102 platform is equipped with a main thread, a data receiving thread, a preprocessing thread, an EfficientNet inference thread, and a GRU inference thread. The data receiving thread is used to receive the raw EEG signals from the three-channel EEG acquisition device. A preprocessing thread is used to preprocess the raw EEG signals; The preprocessing includes slicing and normalization operations; The Efficient inference thread is used to call the DPU accelerator on the PL side to perform forward inference of the EfficientNet branch on the preprocessed EEG signal, obtain the high-order features of the EEG signal, and transmit the high-order features of the EEG signal to the PS side through the AXI bus. The GRU inference thread is used to complete the final depression identification of the subject using the ONNX Runtime; The main thread coordinates the operation of other threads and enables interaction between the user and the host computer.
3. A method for identifying depression, characterized in that, The depression recognition system according to claim 2 includes: Real-time acquisition of raw electroencephalogram (EEG) signals from subjects in a resting state with their eyes closed; The raw EEG signals are preprocessed; the preprocessing includes slicing and normalization operations. The preprocessed EEG signals were input into a lightweight model to identify depression, and the corresponding depression identification results were obtained. The depression identification results are displayed.
Citation Information
Patent Citations
Gesture recognition method and system based on knowledge distillation
CN114970640A
Depression state auxiliary detection method based on audio dual-mode fusion type neural network
CN115862684A