EEG signal compression coding method and device based on Bayesian network model
Through the EEG signal compression and coding method based on the Bayesian network model, combined with wavelet decomposition and ICA separation, the semantic grouping and cognitive function localization of the EEG signal are achieved, which solves the problem of insufficient compression performance in the existing technology and achieves Efficient compression and high-quality transmission.
Patent Information
- Application Number
- CN202410870476.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-07-01
AI Technical Summary
Existing EEG signal compression coding methods such as wavelet transform coding have limitations in selecting wavelet basis functions and the number of decomposition layers. It is difficult to achieve high compression ratios while retaining signal quality, and cannot meet the needs of practical applications.
The EEG signal compression and coding method based on the Bayesian network model is adopted, and the EEG signal is divided into different task clusters through wavelet decomposition, ICA separation and Bayesian network grouping technology, and adaptive coding is performed according to the cognitive function load. Combined with the LORETA inverse positioning algorithm, efficient compression and precise positioning are achieved.
It achieves semantic grouping and cognitive function positioning of EEG signals, provides a new analysis perspective, achieves high compression ratio and high-quality EEG data transmission, and supports brain-computer interface systems and remote processing.
Smart Images

Figure CN118413240B
Abstract
Description
Technical Field
[0001] The present application relates to the field of brain-computer interface technology, and in particular to a method and device for compressing and encoding electroencephalogram (EEG) signals based on a Bayesian network model. Background Art
[0002] EEG signals record the bioelectric activity of the neuron population in the cerebral cortex and are widely used in brain-computer interfaces, neuroscience research, clinical auxiliary diagnosis and other fields. However, due to the complex physiological structure of the human body and the interference of the external environment, EEG signals often contain a lot of noise and a large amount of data, which brings many challenges to signal storage, transmission and subsequent analysis. Therefore, it is extremely important to efficiently compress and encode EEG signals.
[0003] Traditional EEG signal compression coding methods mainly include wavelet transform coding, principal component analysis coding, adaptive filter coding, etc. Among them, wavelet transform coding is one of the most widely used methods. Wavelet transform can perform multi-scale analysis on signals in both time and frequency domains, and is suitable for processing non-stationary signals. This method decomposes EEG signals at multiple levels by selecting appropriate wavelet basis functions and decomposition layers, retaining useful details and approximate components and discarding noise components, thereby achieving compression coding.
[0004] Wavelet transform coding has certain adaptability and noise resistance, but its compression performance is limited by factors such as the selection of wavelet basis functions, the determination of the number of decomposition levels, and prior knowledge of the signal. It has certain limitations and it is often difficult to achieve a high compression ratio while retaining signal quality. New technical solutions are urgently needed to meet practical application needs. Summary of the invention
[0005] The present application provides an EEG signal compression coding method based on a Bayesian network model, which aims to solve the problem that the compression performance of existing wavelet transform coding is limited by factors such as the selection of wavelet basis functions, the determination of the number of decomposition layers, and the prior knowledge of the signal. It has certain limitations and is often difficult to achieve a high compression ratio while retaining the signal quality. New technical solutions are urgently needed to meet the needs of practical applications.
[0006] In a first aspect, the present application provides an EEG signal compression encoding method based on a Bayesian network model, comprising:
[0007] Obtaining the original EEG signal collected by the EEG device, performing multi-scale decomposition on the original EEG signal, and obtaining multiple groups of wavelet coefficients;
[0008] Transform and reconstruct the wavelet coefficients to obtain the target EEG signal, decompose the target EEG signal to obtain multiple EEG component signals;
[0009] Input each EEG component signal into the Bayesian network model to be constructed, so that each EEG component signal is respectively connected to the task feature node, the task state node and the task parallel node of the Bayesian network model;
[0010] Optimizing the node connection weights of the Bayesian network model to generate a completed target Bayesian model, which outputs parallel compression task relationships corresponding to multiple EEG component signals;
[0011] Divide multiple EEG component signals into multiple task clusters according to the parallel compression task relationship, and obtain the positioning result of each task cluster in the EEG device;
[0012] The original component signal corresponding to each task cluster is extracted from the original EEG signal, the task cluster and the corresponding original component signal are input into a preset compression encoder, the target task load data corresponding to the task cluster is output, and the compression encoding of multiple original component signals is completed according to the multiple target task load data.
[0013] In a second aspect, the present application provides an electroencephalogram signal compression encoding device, comprising:
[0014] A data acquisition module is used to acquire the original EEG data to be aligned, pre-process the original EEG data, and acquire standard EEG data and label information;
[0015] A matrix construction module, used to construct an EEG data matrix corresponding to the original EEG data according to the time point information and channel information corresponding to the standard EEG data;
[0016] A feature output module, used to input the EEG data matrix into a preset convolutional neural network and output the global features corresponding to the EEG data matrix;
[0017] A feature decomposition module, used for inputting the global feature into a preset generalized low-rank approximate decomposition model, decomposing the global feature into a low-rank component and a sparse component, performing feature selection on the low-rank component and the sparse component respectively, and outputting low-rank feature channel data and sparse feature channel data;
[0018] A similarity calculation module, used to calculate first similarities between the low-rank feature channel data and the sparse feature channel data and the preset expert knowledge data, and determine target feature channel data in the low-rank feature channel data and the sparse feature channel according to the first similarity;
[0019] A data alignment module is used to align the feature distribution of the target feature channel data across domains according to an iterative feature alignment algorithm, and output the aligned target feature channel data; wherein, in the iterative feature alignment algorithm, the original EEG data is the target domain data, and the standard EEG data and label information are the source domain data, completing the feature distribution alignment of the original EEG data.
[0020] In a third aspect, the present application provides a computer device comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement any step of the EEG signal compression encoding method based on the Bayesian network model provided in the embodiments of the present application when executing the computer program.
[0021] In a fourth aspect, the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the steps of any one of the methods for compressing and encoding electroencephalogram signals based on a Bayesian network model provided in the embodiments of the present application.
[0022] Compared with the prior art, this application has at least the following beneficial effects:
[0023] 1. The semantic clustering and cognitive function positioning of EEG signals are realized; traditional EEG signal analysis methods are difficult to directly separate different cognitive function components and their corresponding brain source locations from the original mixed signals. The present invention uses wavelet decomposition, ICA separation, Bayesian network clustering and other technical means to automatically divide EEG signals into different task clusters, each cluster corresponding to a specific cognitive function, such as visual processing, motor imagery, language comprehension, etc. At the same time, through the LORETA back-calculation positioning algorithm, the spatial coordinates of the brain source location of each task cluster on the cerebral cortex can be accurately determined. This automatic semantic clustering and cognitive function positioning capability provides a new analytical perspective for the interpretation and application of EEG data.
[0024] 2. Adaptive compression coding based on cognitive function load is realized; the present invention proposes an adaptive compression coding strategy based on cognitive function load. Specifically, by calculating the power spectral density of each task cluster, the corresponding cognitive function load level is quantified. Then, hierarchical coding is used to assign a higher bit rate to the task cluster with a larger functional load, so that the quantization error is smaller, thereby maximally retaining the key cognitive load information in the original EEG signal under the constraint of limited bit rate. This adaptive coding strategy can flexibly balance the compression rate and signal fidelity, and achieve a higher compression ratio while ensuring the reconstruction quality.
[0025] 3. Support high-quality wireless transmission and remote processing of EEG data; Due to the weak bioelectric characteristics of EEG signals, their wireless transmission and remote processing have always been the bottleneck restricting the development of applications such as brain-computer interfaces. The present invention uses an adaptive compression coding strategy to significantly reduce the bit rate of EEG data without losing too much original signal quality. At the same time, the encoded data also carries the cognitive function annotations and brain source location information of the task cluster, providing the necessary metadata support for subsequent data decoding and cognitive analysis. This low-bit-rate and high-quality EEG data feature provides key support for building an efficient brain-computer interface system and realizing remote EEG signal cloud processing.
[0026] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of a flow chart of an EEG signal compression encoding method based on a Bayesian network model according to an embodiment of the present application;
[0028] Figure 2 This is a schematic diagram of the structure of an EEG signal compression encoding device shown in an embodiment of the present application;
[0029] Figure 3 A schematic diagram of the structure of a computer device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0030] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0031] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0032] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0033] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0034] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0035] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0036] The technical solution of the embodiment of the present application is introduced below.
[0037] EEG signals record the bioelectric activity of the neuron population in the cerebral cortex and are widely used in brain-computer interfaces, neuroscience research, clinical auxiliary diagnosis and other fields. However, due to the complex physiological structure of the human body and the interference of the external environment, EEG signals often contain a lot of noise and a large amount of data, which brings many challenges to signal storage, transmission and subsequent analysis. Therefore, it is extremely important to efficiently compress and encode EEG signals.
[0038] Traditional EEG signal compression coding methods mainly include wavelet transform coding, principal component analysis coding, adaptive filter coding, etc. Among them, wavelet transform coding is one of the most widely used methods. Wavelet transform can perform multi-scale analysis on signals in both time and frequency domains, and is suitable for processing non-stationary signals. This method decomposes EEG signals at multiple levels by selecting appropriate wavelet basis functions and decomposition layers, retaining useful details and approximate components and discarding noise components, thereby achieving compression coding.
[0039] Wavelet transform coding has certain adaptability and noise resistance, but its compression performance is limited by factors such as the selection of wavelet basis functions, the determination of the number of decomposition levels, and prior knowledge of the signal. It has certain limitations and it is often difficult to achieve a high compression ratio while retaining signal quality. New technical solutions are urgently needed to meet practical application needs.
[0040] To solve the above problems, please refer to Figure 1 , Figure 1 The flowchart of a method for compressing and encoding EEG signals based on a Bayesian network model provided in an embodiment of the present application is shown below. The method for compressing and encoding EEG signals based on a Bayesian network model in an embodiment of the present application can be applied to computer devices, including but not limited to smart phones, laptops, tablet computers, desktop computers, physical servers, cloud servers, and other devices. Figure 1 As shown, the EEG signal compression encoding method based on the Bayesian network model of this embodiment includes steps S101 to S106, which are described in detail as follows:
[0041] Step S101, obtaining the original EEG signal collected by the EEG device, performing multi-scale decomposition on the original EEG signal, and obtaining multiple groups of wavelet coefficients.
[0042] Specifically, the EEG acquisition equipment includes hardware components such as EEG sensors, amplifiers, analog-to-digital converters, and corresponding signal processing and acquisition software. In terms of hardware, there are two types of commonly used EEG sensors: dry electrodes and wet electrodes. Dry electrodes do not require the use of conductive paste and are easy to wear, but the signal-to-noise ratio is low; although the wet electrodes are complicated to prepare, they can obtain EEG signals with a higher signal-to-noise ratio. Considering the requirements for signal quality in practical applications, the present invention tends to use wet electrodes as EEG sensors. For example, Ag / AgCl electrodes can be selected. This electrode material has good biocompatibility and electrochemical stability and is widely used. The electrode layout needs to follow the international 10-20 system standard, and 21 electrodes are evenly distributed on the scalp at specific locations such as Fp1, Fp2, F7, F3, Fz, F4, F8, T3, C3, Cz, C4, T4, T5, P3, Pz, P4, T6, O1, Oz, O2, etc. to cover the cerebral cortex areas of interest, such as the frontal lobe, parietal lobe, temporal lobe, etc. For specific applications, the number of electrodes can be increased and the layout can be adjusted as needed. For example, for a motor imagery brain-computer interface system, the electrode density can be appropriately increased near the motor cortex area.
[0043] The amplitude of the original EEG signal collected by the sensor is usually in the order of a few microvolts to tens of microvolts, and needs to be amplified by an amplifier to improve the signal resolution. The amplifier usually includes modules such as instrument amplifiers and filters. The instrument amplifier plays the role of differential mode amplification and common mode suppression, and the filter is used to filter out interference noise in a specific frequency band. The gain and bandwidth of the amplifier need to be reasonably set according to the specific application scenario and experimental purpose. For example, for general EEG signal acquisition, the gain can be set to 10000-100000 times and the bandwidth can be set to 0.5-100Hz. In addition, some amplifiers also have a 50 / 60Hz notch filter function to suppress power frequency interference.
[0044] The amplified analog EEG signal needs to be converted into a digital signal through an analog-to-digital converter (ADC) for subsequent digital processing. The sampling rate and resolution of the ADC need to be selected according to the specific application. Usually, the sampling rate is set to 250-1000Hz and the resolution is set to 12-24bit. For example, for the application scenario of analyzing high-frequency EEG activity (such as the γ band), a higher sampling rate is required; while for the analysis of low-frequency EEG activity (such as the δ and θ bands), the sampling rate can be appropriately reduced to reduce the amount of data. The higher the resolution, the more subtle the voltage changes can be captured, but at the same time it will increase the amount of data and the processing burden. Finally, the digitized EEG signal is read by a special signal processing and acquisition software and temporarily stored in the computer memory to form the pre-processed raw EEG data.
[0045] Step S102, transform and reconstruct the wavelet coefficients to obtain a target EEG signal, decompose the target EEG signal to obtain a plurality of EEG component signals.
[0046] Specifically, the wavelet reconstruction process is actually the inverse operation of wavelet decomposition. The filtered wavelet coefficients obtained in the previous step are used to perform upsampling, filtering and reconstruction calculations in the opposite path to finally synthesize the target EEG signal in the time domain. The target EEG signal is decomposed to obtain multiple EEG component signals. The time-frequency features of these component signals, such as MFCC (Mel-frequency cepstral coefficients), are extracted to prepare for subsequent positioning.
[0047] In some embodiments, each group of the wavelet coefficients includes detail coefficients and coarse approximation coefficients; the multi-scale decomposition of the original EEG signal to obtain multiple groups of wavelet coefficients includes: performing multi-level wavelet decomposition of the original EEG signal based on a preset wavelet basis function, and obtaining the detail coefficients and coarse approximation coefficients corresponding to each level of the wavelet decomposition.
[0048] As a time-frequency analysis tool, wavelet transform can represent signals at multiple scales in both time and frequency domains, and is particularly suitable for analyzing non-stationary signals, such as EEG signals. By selecting appropriate wavelet basis functions, signal energy can be compressed or de-coherented to the greatest extent, thereby achieving signal denoising, compression coding, and other purposes.
[0049] Wavelet transform mainly includes two processes: wavelet decomposition and wavelet reconstruction. In the process of wavelet decomposition, the time domain signal is convolved and downsampled through the wavelet basis function to obtain low-frequency approximate components and high-frequency detail components. Due to the orthogonality and compact support of the wavelet basis function, the low-frequency approximate component contains most of the energy of the signal, and the high-frequency detail component mainly contains noise and high-frequency components. Therefore, wavelet decomposition can ideally separate the original signal in the frequency domain and time domain.
[0050] For EEG signals, multi-level wavelet decomposition is usually used to decompose the signal at different time-frequency scales to obtain rich time-frequency information. For example, the db4 wavelet in the Daubechies wavelet family can be used to perform a 5-layer decomposition on the first EEG signal. The db4 wavelet basis function has a short compact support interval and high orthogonality, which is suitable for processing pulse signals. In the multi-level decomposition, each layer of decomposition will obtain a low-frequency approximate component and a high-frequency detail component. Taking the 5-layer decomposition as an example, in the order from high frequency to low frequency, a total of 5 detail coefficients cD1, cD2, cD3, cD4, cD5 and an approximate coefficient cA5 are obtained, where cD1 corresponds to the highest frequency band and cA5 corresponds to the lowest frequency band.
[0051] Specifically, let x[n] be the first EEG signal, then the j-th level wavelet decomposition can be expressed as:
[0052] cA_j[k] = Σ_n h[2k-n]cA_j+1[n] (low-pass filter);
[0053] cD_j[k] = Σ_n g[2k-n]cA_j+1[n] (high-pass filter);
[0054] Where h[n] is a low-pass decomposition filter, g[n] is a high-pass decomposition filter, and their impulse responses satisfy the orthogonality and dual redundancy conditions. cA_j[k] is the j-th level approximation coefficient, and cD_j[k] is the j-th level detail coefficient. By iterative calculation of the above formula, multiple groups of wavelet coefficients can be obtained. It is worth noting that downsampling operations are required in the wavelet decomposition process to reduce the number of coefficients and reduce the computational complexity.
[0055] By using wavelet multi-scale decomposition, EEG signals can be effectively separated in time and frequency, so that different frequency components and instantaneous event characteristics can be well characterized. Generally speaking, detail coefficients mainly include low-frequency components such as δ, θ, α, and β, which reflect the discharge activity of neurons in the cerebral cortex; while approximate coefficients contain the overall characteristics and baseline information of the signal. By selecting the appropriate number of wavelet decomposition layers, the detail information of EEG signals in specific frequency bands such as δ (1-4Hz), θ (4-8Hz), α (8-13Hz), β (13-30Hz), and γ (>30Hz) can be well separated.
[0056] For example, for event-related potential (ERP) analysis, the main focus is on the low-frequency components of the δ and θ bands, so only the three low-frequency coefficients of cD4, cD5 and cA5 need to be retained, and the high-frequency cD1, cD2, and cD3 detail coefficients are discarded, which can effectively reduce the amount of data. On the contrary, for some brain-computer interface applications that need to pay attention to the γ wave, the high-frequency cD1 detail coefficient should be retained.
[0057] Exemplarily, the transform and reconstruction of the wavelet coefficients includes: determining a reconstruction calculation formula for transforming and reconstructing the wavelet coefficients based on the detail coefficients and coarse approximation coefficients of multiple groups of the wavelet coefficients; and acquiring the target EEG signal based on the reconstruction calculation formula.
[0058] Assuming that the detail coefficients {cD1', cD2', ..., cDJ'} and the rough approximation coefficients {cAJ'} are obtained through J-layer wavelet decomposition, the calculation formula of wavelet reconstruction is:
[0059] cA_j-1[k] = Σ_n h'[n-2k]cA_j[n]+ Σ_n g'[n-2k]cD_j[n];
[0060] Where h'[n] and g'[n] are low-pass and high-pass reconstruction filters, respectively. They are in dual relationship with the decomposition filters h[n] and g[n], satisfying the orthogonality and biorthogonality conditions. cA_j-1[k] is the approximation coefficient of the j-1th level, obtained by upsampling, filtering and summing the jth level approximation coefficient cA_j[n] and the detail coefficient cD_j[n]. Repeat this process until j=1, and the time domain signal x'[n] can be finally synthesized.
[0061] Taking the 5-layer wavelet decomposition as an example, the reconstruction process is: (1) Use cD5' and cA5' to calculate cA4' (2) Use cD4' and cA4' to calculate cA3' (3) Use cD3' and cA3' to calculate cA2' (4) Use cD2' and cA2' to calculate cA1' (5) Use cD1' and cA1' to calculate the final time domain signal x'[n].
[0062] It should be pointed out that the filtering and upsampling operations in the wavelet reconstruction process need to correspond precisely to the downsampling and filtering operations during decomposition to ensure the distortion-free nature of the reconstructed signal. The "periodic extension" method is usually used to process the signal boundary, so that the entire process has a circular symmetry and avoids edge effects. Due to the compact support properties of the wavelet basis, the reconstructed signal x'[n] will only contain a part of the original EEG signal x[n], which needs to be segmented and summed to cover the entire domain. The final target EEG signal is x'[n].
[0063] It is worth mentioning that the wavelet components that need to be reconstructed can be flexibly selected during the wavelet reconstruction process. For example, if the main focus is on low-frequency components such as delta waves and theta waves in the EEG signal, it is only necessary to reconstruct the low-frequency components including cA5, cD5 and cD4, without reconstructing the high-frequency cD1, cD2 and cD3 detail components, thereby further reducing the amount of data. Similarly, if it is necessary to analyze the high-frequency gamma band signal, it is sufficient to retain the high-frequency cD1 detail component. This strategy of selective reconstruction based on actual needs can make full use of the properties of wavelet decomposition such as "precise reconstruction" and "compact support separation", and minimize data redundancy while meeting signal quality requirements.
[0064] In some embodiments, before transforming and reconstructing the wavelet coefficients, it also includes: filtering multiple groups of wavelet coefficients according to a preset threshold and a soft threshold function to obtain the filtered wavelet coefficients, so as to transform and reconstruct the filtered wavelet coefficients.
[0065] The purpose of further processing the wavelet decomposition results is to eliminate the noise components in the wavelet coefficients and extract useful signal features. Since there are usually various physiological and non-physiological noise interferences in EEG signals, such as electrooculography, electromyography, power frequency interference, etc., these noises will seriously affect the accuracy of subsequent analysis and encoding. Wavelet decomposition can better separate these noises from brain source signals. The noise is mainly concentrated in the high-frequency detail coefficients, so the noise effect can be eliminated by threshold denoising.
[0066] Threshold denoising is based on the assumption that the wavelet coefficients with larger energy are useful signal components, while those with smaller energy are noise components. By comparing the absolute values of all wavelet coefficients with the preset threshold, those greater than the threshold are retained unchanged, while those less than the threshold are eliminated or shrunk, effective denoising can be achieved. The present invention adopts the RigrsureSure threshold estimation method, which can automatically determine a reasonable threshold based on the statistical characteristics of the wavelet coefficients. The threshold calculation formula is as follows:
[0067] λ = σ * sqrt(2*logN);
[0068] Where N is the data length and σ is the noise standard deviation, which can be obtained through empirical formulas or unbiased robust median estimation of wavelet coefficients. Of course, in order to obtain better denoising effect, the threshold can also be manually tuned according to the specific application scenario.
[0069] After determining the threshold λ, it is also necessary to select a suitable threshold function (thresholding rule) to process the wavelet coefficients. There are two commonly used hard threshold functions and soft threshold functions, which have different shrinkage or elimination strategies for the wavelet coefficients to be processed. The hard threshold function is to set all coefficients with absolute values less than the threshold to zero, and those greater than the threshold remain unchanged, showing the distortion effect of a "hard" inflection point, which is easy to introduce pseudo textures; while the soft threshold function completely eliminates coefficients less than the threshold, and shrinks coefficients greater than the threshold to the difference with the threshold, showing a "soft" inflection point, which can effectively avoid pseudo textures. The formula of the soft threshold function is as follows:
[0070] y = sign(x)*max(0, |x| - λ);
[0071] Where x is the original wavelet coefficient, and y is the processed wavelet coefficient. Since there are usually no obvious edges and sharp mutations in EEG signals, the present invention uses a soft threshold function to process the wavelet coefficients to reduce signal distortion.
[0072] Specifically, each group of wavelet coefficients cDj (j=1,2,...,J) and cAJ obtained in the above steps is processed as follows:
[0073] (1) Calculate the threshold λj of the current layer using the above formula;
[0074] (2) Compare the absolute values of all coefficients with λj;
[0075] (3) For coefficients less than λj, shrink them according to the softThresh(x, λj) function;
[0076] (4) For coefficients greater than λj, they remain unchanged;
[0077] (5) Perform inverse wavelet transform on the processed coefficients to reconstruct the denoised signal of this layer.
[0078] Taking the 5-layer wavelet decomposition as an example, first calculate the threshold λ1 corresponding to the detail coefficient cD1, and use the soft threshold function softThresh(cD1, λ1) to denoise cD1 to obtain the new detail coefficient cD1'. Then perform the same threshold calculation and soft threshold processing on cD2, cD3, cD4, cD5 and cA5, and finally obtain the filtered wavelet coefficients such as cD1', cD2', cD3', cD4', cD5' and cA5'.
[0079] In some embodiments, the target EEG signal is decomposed to obtain multiple EEG component signals, including: Although the EEG signal has been preprocessed by wavelet decomposition, denoising and reconstruction, it is still a complex time domain signal, containing the superposition of discharge activities of multiple different neuronal groups. In order to better capture the contribution of these different brain sources, the target EEG signal needs to be decomposed and separated into multiple relatively independent component signals.
[0080] Commonly used EEG signal decomposition methods include independent component analysis (ICA), principal component analysis (PCA), wavelet packet analysis, etc. Among them, ICA is a blind source separation algorithm that can separate EEG signals into multiple independent subspaces based on their statistical independence, each of which corresponds to a potential brain source. ICA has been widely used to remove physiological artifacts such as electrooculography and electromyography and extract brain source signals. The present invention uses ICA to decompose the preprocessed target EEG signal.
[0081] Specifically, assuming that the target EEG signal is X, which contains N time samples and M sensor channels, then X can be expressed as: X = AS; where A is an unknown mixing matrix, and S=[s1,s2,...,sN]^T is a potential source component signal. The goal of ICA is to solve A and S based on X so that the components in S are statistically independent of each other. This application adopts the FastICA algorithm to achieve blind separation by maximizing the non-Gaussianity of the source signal or minimizing the mutual information of the source signal. The basic idea is to iteratively solve the projection direction with the largest non-Gaussianity on the unit sphere so that the projected component has the largest non-Gaussianity, which is the required source component. The specific steps are as follows: (1) Preprocess X, such as removing the mean and whitening, to obtain Z; (2) Randomly initialize the projection vector w; (3) Calculate the projection y=w^TZ of w on Z, and perform Newton iterative optimization to update w; (4) Repeat (3) until w converges; (5) Add w to the solution space W, and remove the component corresponding to w from Z; (6) Repeat (2)-(5) until the number of vectors in W is equal to the number of sources. Finally, ICA can obtain the separation matrix W and the source component matrix S=WX.
[0082] Through ICA, the target EEG signal X is decomposed into M independent source components s1, s2, ..., sM, each of which corresponds to a specific brain source or brain area, and contains the discharge activity information of the neuron group in the area. These component signals are relatively simple and independent of each other, laying the foundation for subsequent wireless node positioning and task classification. In addition, the ICA decomposition process can also be combined with the back projection method to estimate the scalp topology corresponding to each component signal, that is, the projection pattern of the EEG signal on the scalp sensor, which provides a powerful clue for analyzing the spatial location of the brain source.
[0083] Next, it is necessary to extract features from each EEG component signal to prepare for wireless node positioning. Common EEG signal features include time-frequency features such as MFCC and wavelet packets, as well as frequency domain features such as power spectrum and coherence. The wavelet decomposition-based method has been applied in the previous steps, and the present invention will focus on extracting MFCC (Mel frequency cepstral coefficient) features.
[0084] MFCC is widely used in speech recognition and other fields, and can well describe the frequency characteristics of the signal under the Mel scale. For non-stationary signals such as EEG, MFCC also has certain characterization capabilities. The specific steps are:
[0085] (1) Divide the EEG component signals into frames and add windows to obtain a series of short-time analysis frames; (2) Perform fast Fourier transform on each analysis frame to obtain the power spectrum; 3) Map the power spectrum to the Mel frequency scale and perform triangular filter bank filtering to obtain the Mel spectrum; (4) Take the logarithm of the Mel spectrum to obtain the logarithmic Mel spectrum; (5) Perform discrete cosine transform on the logarithmic Mel spectrum to obtain the MFCC coefficients.
[0086] The key to the above steps is the Mel scale and its filter bank, which simulates the high-resolution perception of low-frequency signals by the human ear. When calculating MFCC, usually only the first 12-20 coefficients need to be retained, and the subsequent high-frequency coefficients have low energy and can be ignored. In addition, the short-time energy of each frame signal needs to be calculated as a supplementary feature of MFCC.
[0087] For each EEG component signal si, a corresponding MFCC feature sequence mfcc_i can be obtained. These MFCC features not only reflect the time-frequency characteristics of each brain source, but also indirectly contain spatial location information, which is the key feature of wireless node positioning.
[0088] It is worth mentioning that in addition to MFCC, we can also consider extracting other time-frequency features, such as wavelet packet energy, PCA projection features, etc., and fuse them to capture richer information.
[0089] Step S103, input each EEG component signal into the Bayesian network model to be constructed, so that each EEG component signal is respectively connected to the task feature node, task state node and task parallel node of the Bayesian network model.
[0090] Specifically, the Bayesian network model is a probabilistic graphical model that can effectively represent the causal relationship and conditional independence between complex data through a directed acyclic graph, and is widely used in fields such as uncertainty reasoning and pattern recognition. The present invention applies the Bayesian network model to the EEG signal compression coding task, aiming to fully explore the intrinsic connection between multiple EEG component signals, cluster the related components, and thus achieve efficient compression coding.
[0091] In some embodiments, before inputting each of the EEG component signals into the Bayesian network model to be constructed, it also includes: extracting the time-frequency features corresponding to each of the EEG component signals to input the time-frequency features into the Bayesian network model; the Bayesian network model includes a feature layer, a state layer and a parallel layer; inputting each of the EEG component signals into the Bayesian network model to be constructed includes: connecting the time-frequency features with the task feature nodes of the feature layer; determining the task feature nodes corresponding to each task state node of the state layer, and connecting the task state nodes with the corresponding task feature nodes; determining the task state nodes corresponding to each task parallel node of the parallel layer, and connecting the task parallel nodes with the corresponding task state nodes.
[0092] First, this application constructs a three-layer Bayesian network model, including a feature layer, a state layer, and a parallel layer. The feature layer corresponds to the time-frequency features such as MFCC extracted in the above steps, which are used to represent the input EEG component signals; the state layer characterizes the task state of the component signal corresponding to the brain source, such as motor imagery, language processing, etc.; the parallel layer corresponds to the result of task cluster division and encoding of the component signal. There are directed edge connections between the three layers, reflecting the conditional dependency relationship between variables at different levels.
[0093] Specifically, assume that there are M EEG component signals s1, s2, ..., sM, and the corresponding MFCC features are x1, x2, ..., xM. The present application sets M nodes F1, F2, ..., FM in the feature layer, and connects each xi to the corresponding Fi node as the observation node of Fi. Next, N task state nodes S1, S2, ..., SN are set in the state layer, corresponding to different cognitive task states, such as vision, hearing, movement, language, etc. Each Si node is connected to some Fi nodes, indicating that the task state depends on some EEG component features. Finally, K nodes P1, P2, ..., PK are set in the parallel layer, corresponding to K different task clusters, and each Pk is connected to some Si nodes, indicating that the task cluster contains some cognitive tasks.
[0094] Let's take a simple example of two tasks (motor imagery and language processing) and three brain sources to illustrate the connection relationship: Assuming that s1 corresponds to the motor cortex, s2 corresponds to the language area, and s3 corresponds to the visual area, then:
[0095] F1 ---> S1 (motor imagery);
[0096] F2 ---> S2 (language processing);
[0097] F3 --->S1, S2 (visual area involved in both tasks);
[0098] S1, S2 ---> P1;
[0099] S1, S3 ---> P2;
[0100] That is, the P1 cluster includes two tasks: motor imagery and language processing, and the P2 cluster includes motor imagery and visual processing tasks.
[0101] Through this hierarchical Bayesian network model, the present application can model complex EEG signals and capture the dependencies between variables at different levels. For example, if the observed value xi of Fi is known, the posterior probability distribution P(Si|xi) of Si can be calculated; and then the probability distribution P(Pk|S) of Pk can be inferred based on the value of Si. The latter will serve as the encoding criterion of the present invention, that is, clustering EEG component signals with similar parallel task relationships and encoding each cluster.
[0102] It is worth mentioning that the above Bayesian network structure is a priori model, in which the node connection relationship and conditional probability distribution need to be learned through training data to obtain a model with certain semantics. The present invention adopts a parameter optimization method based on gradient descent.
[0103] Specifically, let the observed data be D={x1, x2, ..., xM}, where each xi is an MFCC feature sequence corresponding to the i-th EEG component signal si. The goal of this application is to maximize the log-likelihood of D given the model parameters θ:
[0104] θ* = argmax_θ logP(D|θ);
[0105] Since the direct optimization of the above formula is relatively complicated, this application adopts the equivalent optimization objective of the expected complete data log likelihood:
[0106] Q(θ',θ) = Σ_Z P(Z|D,θ)logP(D,Z|θ');
[0107] Where Z represents all possible values of hidden nodes (S and P layer nodes) in the network. Q(θ',θ) is called the Q function, which represents the expected log-likelihood of the hidden nodes under the current model parameter θ. The optimization process adopts the idea of the generalized expectation maximization (GEM) algorithm, that is, in each iteration, θ is fixed to calculate the Q function Q(θ',θ), and then the Q function is gradient updated to obtain the new θ'. The specific approach is:
[0108] (1) Fix the current parameter θ and calculate Q(θ',θ); (2) Let Q'(θ') = ∂Q(θ',θ) / ∂θ' be the gradient of the Q function; (3) Update the parameter θ' = θ + α*Q'(θ'), where α is the learning rate; (4) Repeat (1)-(3) until convergence.
[0109] Through the above parameter learning process based on gradient descent, this application finally obtains a Bayesian network model with clear probabilistic semantics, which can perform conditional probability reasoning on the time-frequency features xi of multiple input EEG component signals, and calculate the corresponding task state probability P(Si|xi) and parallel task cluster probability P(Pk|xi).
[0110] Step S104, optimizing the node connection weights of the Bayesian network model to generate a constructed target Bayesian model, the target Bayesian model outputs parallel compression task relationships corresponding to multiple EEG component signals.
[0111] Specifically, this application constructs a priori structure of a three-layer Bayesian network, including feature layer nodes F, state layer nodes S, and parallel layer nodes P, and determines the connection relationship between layers. However, the connection strength of this structure, that is, the weights between nodes, has not yet been determined, so it is necessary to further optimize the network parameters so that it can fit the observed data well, thereby generating the target Bayesian model.
[0112] The present invention adopts a gradient-based parameter optimization method to iteratively update network parameters, gradually reduce the error between the model and training data, and achieve model optimization.
[0113] Specifically, let the observed data be D={x1,x2,...,xM}, where each xi is an MFCC feature sequence corresponding to the i-th EEG component signal si. Let θ represent the set of connection weights of all nodes in the Bayesian network, and the goal is to maximize the log-likelihood of D given θ:
[0114] θ* = argmax_θ logP(D|θ);
[0115] Since the direct optimization of the above formula is relatively complicated, this application adopts the equivalent optimization objective of the expected complete data log likelihood:
[0116] Q(θ',θ) = Σ_Z P(Z|D,θ)logP(D,Z|θ');
[0117] Where Z represents all possible values of hidden nodes (S and P layer nodes) in the network. Q(θ',θ) is called the Q function, which represents the expected log-likelihood of the hidden nodes under the current model parameters θ. The optimization process uses the generalized expectation maximization (GEM) algorithm, that is, in each iteration, θ is fixed to calculate the expected log-likelihood Q(θ',θ) of the hidden nodes, and then the Q function is maximized to obtain the new θ'. The specific approach is:
[0118] (1) Fix the current parameter θ and calculate Q(θ',θ); (2) Let Q'(θ') = ∂Q(θ',θ) / ∂θ' be the gradient of the Q function; (3) Update the parameter θ' = θ + α*Q'(θ'), where α is the learning rate; (4) Repeat (1)-(3) until convergence.
[0119] The above gradient update rule can be regarded as continuously adjusting the model parameters in the direction of improving the log-likelihood of the observed data. By learning a large amount of training data, we can eventually obtain a better node connection weight parameter θ*, thereby generating a target Bayesian model that meets actual needs.
[0120] In the process of parameter learning, each network node can be regarded as a reference node, and its connection weight corresponds to its importance in the entire network. Using big data analysis technology, this application can further explore the main factors that affect the accuracy of node positioning.
[0121] Specifically, by collecting and organizing a large number of EEG data samples and corresponding location annotation information, a large data set containing MFCC features, Bayesian network node connection weights and node positioning results can be constructed. Then, based on this data set, unsupervised learning algorithms such as hierarchical clustering and principal component analysis are used to analyze and sort the factors that affect positioning accuracy.
[0122] Taking hierarchical clustering as an example, we can first calculate the similarity between the node connection weight vectors (such as Euclidean distance, cosine similarity, etc.), and then build a tree-like hierarchical structure based on the similarity matrix to cluster similar features at different levels. By analyzing the connection weight distribution in each cluster and its corresponding positioning accuracy, we can find which weight combinations correspond to higher positioning accuracy. Then, based on these combined features, we can extract the key weights (corresponding to key nodes) that affect positioning accuracy.
[0123] The target Bayesian model obtained through the above steps performs forward inference on the component signals, calculates the probability distribution of the task parallel nodes, and outputs the parallel compression task relationship. This probability distribution is regarded as the location prior probability of the node to be located. After obtaining the optimized Bayesian network model, the present application can perform probabilistic reasoning on new input data, output the posterior distribution of the variable of interest, and provide a basis for subsequent tasks. For the EEG signal compression coding problem of the present invention, the goal of the present application is to calculate the probability distribution of the task parallel layer node P, and divide the task clusters according to the distribution, so as to achieve efficient coding.
[0124] Specifically, assume that the new input data is D'={x'1, x'2, ..., x'M}, where each x'i is a new MFCC feature sequence of the i-th EEG component signal si. This application inputs D' into the optimized Bayesian network and performs forward reasoning through the model to calculate the conditional probability distribution P(P|D') of the parallel node P. The reasoning process follows the standard rules of probability propagation, including basic operations such as evidence propagation, chain rule and marginalization.
[0125] The forward reasoning process is illustrated by a simple example of a three-layer network: (1) Based on the observed data x'i, calculate the feature layer evidence P(Fi|x'i); (2) Propagate the evidence along the directed edge to the state layer and calculate P(Si|x'i)=Σ_Fi P(Si|Fi)P(Fi|x'i); (3) Continue to propagate the evidence to the parallel layer and calculate P(P|x'i)=Σ_Si P(P|Si)P(Si|x'i); (4) Fusion the results of the different component signals in (3) to obtain P(P|D')=P(P|x'1,x'2,...,x'M);
[0126] Through the above steps, the posterior probability distribution P(Pk|D') of each parallel node Pk can be obtained under the condition of observing the new input data D'. This distribution describes the probability values corresponding to different task parallel clusters, reflecting the type of cognitive function that the input signal is most likely to represent. This application uses P(Pk|D') as a metric for parallel compression task relationships, and is used to divide EEG component signals into task clusters.
[0127] Specifically, the parallel nodes Pk can be sorted according to the size of the probability distribution P(Pk|D'), and the first K' nodes with larger probability values can be selected, and the state nodes Sj connected to them can be classified into a task cluster. In this way, all EEG component signals si are divided into K' parallel compression task clusters {C1, C2, ... CK'}. Multiple si belonging to the same cluster Ck will be collectively encoded in the future to achieve data compression.
[0128] Let's take a simple example of two tasks (motor imagery and language processing) and three brain sources: Assume that the P1 node corresponds to the "motor + language" task, and the P2 node corresponds to the "motor + visual" task. When the three MFCC feature sequences x'1 (motor cortex), x'2 (language area) and x'3 (visual area) are input, forward reasoning may obtain P(P1|D') = 0.7, P(P2|D') = 0.3.
[0129] Then the task cluster will be divided into:
[0130] C1 = {s1, s2} (motor+language cluster);
[0131] C2 = {s1, s3} (motion + visual cluster);
[0132] It can be seen that through the probabilistic reasoning of the Bayesian network, the present application can not only output the parallel compression task relationship (i.e., task cluster division), but also obtain the position prior probability distribution of each node to be located (corresponding to the source of the EEG component signal).
[0133] Step S105 , dividing the multiple EEG component signals into multiple task clusters according to the parallel compression task relationship, and obtaining the positioning result of each task cluster in the EEG device.
[0134] Specifically, according to the parallel compression task relationship outputted from the above steps, the present application divides the multiple EEG component signals si obtained from the above steps into task clusters to obtain K' parallel compression task clusters {C1, C2, ..., CK'}. Each cluster Ck contains a group of interrelated EEG component signals, which will be collectively encoded in the future to achieve compression. Next, the present application needs to spatially locate the component signals within each task cluster Ck and determine the corresponding brain source area to lay the foundation for separation encoding. The positioning process utilizes the inverse EEG signal source inversion algorithm, and its basic idea is: under the conditions of a given scalp electrode position and a head model, based on the potential value measured on the electrode for each component signal, the area on the cerebral cortex where it is most likely to come from is inferred as the positioning result.
[0135] In some embodiments, the EEG device includes multiple scalp electrodes; obtaining the positioning result of each task cluster in the EEG device includes: obtaining the response power of the EEG component signal in the task cluster at each scalp electrode; constructing a response power vector based on the multiple response powers; calculating the optimal source position of the task cluster in the EEG device based on a preset inverse positioning algorithm and the response power vector; and using the optimal source position as the positioning result.
[0136] Assume that the task cluster Ck contains M EEG component signals si (i=1,2,...,M). For each si, this application first calculates its response power on all scalp electrodes and constructs a response power vector ri=[ri1, ri2, ..., riN]^T, where rij represents the response power of si on the jth electrode and N is the total number of electrodes. Then, using ri as input, the inverse positioning algorithm is used to search for the best source position in the three-dimensional space of the cerebral cortex.
[0137] The present invention adopts a nonlinear standardized least squares algorithm. The basic idea of the standardized least squares algorithm is that for each source position, the steering vector on each electrode is first calculated based on the head model and the electrode position, and then the steering vector is inner-producted with the response power vector ri to minimize the sum of the squares of the difference between the two, that is, to obtain the optimal fitting source position. The algorithm framework is:
[0138] 1. Initialize the starting source position vector q0 and preset the convergence threshold ε;
[0139] 2. In the kth iteration: Calculate the electrode response matrix A(qk) and its pseudo-inverse A+(qk) Let xk = A+(qk)ri be the estimated value of the current source position Calculate the residual matrix B(qk) = diag(A(qk)xk) - A(qk) Select the eigenvector corresponding to the minimum eigenvalue of the new source position qk+1 = B^T(qk)B(qk);
[0140] 3. If ||qk+1 - qk|| < ε, convergence occurs, otherwise continue to the next iteration;
[0141] 4. Output the optimal source position qk+1;
[0142] Although the above algorithm can effectively estimate the position of a single source, for multiple sources activated simultaneously, the position estimation is often subject to significant deviations. To solve this problem, this application will adopt the regularization strategy of LORETA (Low Resolution Electromagnetic Algorithm). The basic idea of LORETA is to reduce the multi-source localization problem to solving a constrained optimization problem:
[0143] min ||Wx||^2 subject to Ax = ri;
[0144] Where x is the spatial distribution of the source to be determined, and W is a weighted matrix used to smooth the distribution differences between adjacent source positions. A is still the electrode response matrix. This constrained optimization problem is actually seeking a smooth distribution solution x* that minimizes a certain weighted norm under the constraints given by A, thereby obtaining the optimal fit. The optimal solution can be obtained using the Lagrangian method:
[0145] x* = (A^TA + λW^TW)^-1 A^Tri;
[0146] Where λ is a regularization parameter, which is used to adjust the trade-off between the degree of fitting and the smoothness of the distribution. According to the location of the region with the largest energy value in x*, the location of the brain region where the source signal si is most likely to come from can be determined.
[0147] For all component signals si within each task cluster Ck, repeat the above LORETA positioning process and mark the regional positions corresponding to all components in the cerebral cortex space. Since these component signals themselves have functional relevance, their source positions should be concentrated in certain specific areas, such as motor cortex, visual cortex, language area, etc. By calculating the weighted centroid position of the above regional positions, the present application can obtain the optimal positioning result of the task cluster Ck, that is, the central coordinates of its corresponding functional brain area. This method of positioning by iterative shrinkage can effectively overcome the limitations of single-source back-calculation positioning, make full use of the synergy and spatial constraints between multiple related EEG component signals, and improve the accuracy and robustness of positioning.
[0148] Finally, the positioning results of the K' task clusters determined above are mapped back to the original EEG signals to provide the necessary spatial position and functional labeling information for the subsequent compression encoding process.
[0149] Step S106, extract the original component signal corresponding to each task cluster from the original EEG signal, input the task cluster and the corresponding original component signal into a preset compression encoder, output the target task load data corresponding to the task cluster, and complete the compression encoding of multiple original component signals according to multiple target task load data.
[0150] Specifically, the positioning results obtained in the above steps are matched to the original EEG signal, and the parallel compression task cluster is input into the preset EEG signal compression encoder to determine the target task load data of each task cluster. According to the target task load data, the parallel compression task cluster is input into the preset compression coding model to obtain the compressed EEG coding data, thereby realizing the compression coding of the original EEG signal.
[0151] In some embodiments, the compression encoding of the multiple original component signals is completed respectively according to the multiple target task load data, including: inputting the target task load data and the original component signals into a preset compression encoding model, the compression encoding model outputs a compression encoding signal corresponding to each of the original component signals; and constructing the compressed and encoded original EEG signal according to the multiple compression encoding signals.
[0152] First, this application needs to establish a mapping relationship between the task cluster positioning results obtained in the above steps and the original EEG signal. Specifically, assume that the original EEG signal is X, which contains N time sampling points and M sensor channels, that is, X is an N×M matrix. When performing ICA decomposition in the above steps, X is separated into M independent EEG component signals si (i=1,2,...,M). In the above steps, these component signals are divided into K' task clusters Ck, each Ck contains a group of related component signals and is located in a specific brain area. Therefore, this application can correspond each component signal si in Ck back to the signal component of the corresponding channel in X.
[0153] Specifically, assume that the task cluster Ck contains L component signals {s1, s2, ..., sL}, which are located in the brain region Rk in the above steps. This application constructs an N×L matrix Xk, whose i-th column corresponds to si, that is:
[0154] Xk = [s1, s2, ..., sL];
[0155] Then each column in Xk is the component of the original EEG signal X on the corresponding sensor channel, and these components together correspond to the cognitive load of the brain area Rk. By splicing all Xk matrices by column, the original EEG signal X can be reconstructed:
[0156] X = [X1, X2, ..., XK'];
[0157] Among them, each submatrix Xk corresponds to a task cluster Ck and its localized brain region Rk. This way of dividing the original signal into blocks provides a natural basis for grouping in the subsequent encoding process.
[0158] Next, the present application inputs these K' task clusters {C1, C2, ..., CK'} and their corresponding matrices {X1, X2, ..., XK'} into a preset EEG signal compression encoder to determine the target task load data of each task cluster, that is, the effective amount of information that needs to be encoded.
[0159] Specifically, for each task cluster Ck, this application divides its corresponding matrix Xk into L' non-overlapping time periods {Tk1, Tk2, ..., TkL'}, where each Tkj is a small Nk×L matrix representing the L component signals of Ck in time period j. For each Tkj, this application calculates its energy matrix:
[0160] Ekj = Tkj^T * Tkj;
[0161] Where Ekj is a symmetric positive definite matrix of L×L, the diagonal elements represent the energy of each component, and the off-diagonal elements represent the cross-correlation between components. This application order:
[0162] ek = sum(diag(Ekj));
[0163] That is, sum the diagonal elements of Ekj to get the total energy ek of Ck in the time period j. By calculating the sum of ek in all time periods and dividing it by the signal length N, the application can get the average power spectral density of Ck:
[0164] Pk = (1 / N) * Σ_j ek;
[0165] The spectral density Pk is regarded as the target task load data of Ck, reflecting the information content of the cognitive function corresponding to the task cluster in the original EEG signal.
[0166] Next, the present application inputs these K' task clusters {C1, C2, ..., CK'} and their corresponding target task load data {P1, P2, ..., PK'} into a preset compression coding model. The model achieves lossy compression of the original EEG signal by applying different degrees of quantization and coding strategies to different task clusters, while retaining the main cognitive load information.
[0167] Specifically, the coding model first allocates a corresponding bit rate Rk to each Ck according to the task load Pk, so that the larger the bit rate, the smaller the quantization error of Ck, and the more cognitive information is retained. A simple bit rate allocation strategy is:
[0168] Rk = Rmax * Pk / Σ_i Pi;
[0169] Where Rmax is the total bit rate allocated, and Pk / Σ_i Pi is the normalized task load ratio of Ck. Then, the L component signals in each time period Tkj are scalar quantized, and the quantization step Δk is determined by Rk. Assuming that the quantized version of the component signal sij is s'ij, then:
[0170] s'ij = round(sij / Δk) * Δk;
[0171] Wherein round(x) is a rounding operation on x. Furthermore, the present application applies entropy coding or other lossless compression coding to the quantized signal s'ij, thereby obtaining a final coded data stream.
[0172] Through the above-mentioned hierarchical coding strategy, for clusters with heavier task loads, this application will allocate a higher bit rate to reduce the quantization error, thereby retaining most of the cognitive load information; while for clusters with lighter task loads, the bit rate will be appropriately reduced in exchange for a higher compression ratio. This software-defined coding method can dynamically balance the contradiction between compression rate and reconstructed signal quality, thereby retaining the key cognitive load components in the original EEG signal to the greatest extent under limited bit rate constraints.
[0173] Finally, the present application multiplexes the encoded K'-channel data streams to obtain compressed EEG encoded data, thereby achieving effective compression encoding of the original EEG signal. The encoded data not only has a greatly reduced volume, but also carries task cluster positioning and function labeling information, providing a basis for subsequent wireless transmission, brain decoding, etc.
[0174] Compared with the prior art, this application has at least the following beneficial effects:
[0175] 1. The semantic clustering and cognitive function positioning of EEG signals are realized; traditional EEG signal analysis methods are difficult to directly separate different cognitive function components and their corresponding brain source locations from the original mixed signals. The present invention uses wavelet decomposition, ICA separation, Bayesian network clustering and other technical means to automatically divide EEG signals into different task clusters, each cluster corresponding to a specific cognitive function, such as visual processing, motor imagery, language comprehension, etc. At the same time, through the LORETA back-calculation positioning algorithm, the spatial coordinates of the brain source location of each task cluster on the cerebral cortex can be accurately determined. This automatic semantic clustering and cognitive function positioning capability provides a new analytical perspective for the interpretation and application of EEG data.
[0176] 2. Adaptive compression coding based on cognitive function load is realized; the present invention proposes an adaptive compression coding strategy based on cognitive function load. Specifically, by calculating the power spectral density of each task cluster, the corresponding cognitive function load level is quantified. Then, hierarchical coding is used to assign a higher bit rate to the task cluster with a larger functional load, so that the quantization error is smaller, thereby maximally retaining the key cognitive load information in the original EEG signal under the constraint of limited bit rate. This adaptive coding strategy can flexibly balance the compression rate and signal fidelity, and achieve a higher compression ratio while ensuring the reconstruction quality.
[0177] 3. Support high-quality wireless transmission and remote processing of EEG data; due to the weak bioelectric characteristics of EEG signals, their wireless transmission and remote processing have always been the bottleneck restricting the development of applications such as brain-computer interfaces. The present invention uses an adaptive compression coding strategy to significantly reduce the bit rate of EEG data without losing too much original signal quality. At the same time, the encoded data also carries cognitive function annotations and brain source location information of the task cluster, providing necessary metadata support for subsequent data decoding and cognitive analysis. This low-bit-rate and high-quality EEG data feature provides key support for building an efficient brain-computer interface system and realizing remote EEG signal cloud processing. In order to execute the EEG signal compression coding method based on the Bayesian network model corresponding to the above method embodiment, to achieve the corresponding functions and technical effects. See Figure 2 , Figure 2 The structural block diagram of an EEG signal compression encoding device 200 provided in an embodiment of the present application is shown. For the convenience of description, only the parts related to the present embodiment are shown. The EEG signal compression encoding device 200 provided in an embodiment of the present application includes:
[0178] The data acquisition module 201 is used to acquire the original EEG data to be aligned, pre-process the original EEG data, and acquire standard EEG data and label information;
[0179] A matrix construction module 202, for constructing an EEG data matrix corresponding to the original EEG data according to the time point information and channel information corresponding to the standard EEG data;
[0180] A feature output module 203, used to input the EEG data matrix into a preset convolutional neural network and output the global features corresponding to the EEG data matrix;
[0181] A feature decomposition module 204 is used to input the global feature into a preset generalized low-rank approximate decomposition model, decompose the global feature into a low-rank component and a sparse component, perform feature selection on the low-rank component and the sparse component respectively, and output low-rank feature channel data and sparse feature channel data;
[0182] A similarity calculation module 205 is used to respectively calculate the first similarities between the low-rank feature channel data and the sparse feature channel data and the preset expert knowledge data, and determine the target feature channel data in the low-rank feature channel data and the sparse feature channel according to the first similarities;
[0183] The data alignment module 206 is used to align the feature distribution of the target feature channel data across domains according to an iterative feature alignment algorithm, and output the aligned target feature channel data; wherein, in the iterative feature alignment algorithm, the original EEG data is the target domain data, and the standard EEG data and label information are the source domain data, thereby completing the feature distribution alignment of the original EEG data.
[0184] The above-mentioned EEG signal compression encoding device 200 can implement the EEG signal compression encoding method based on the Bayesian network model of the above-mentioned method embodiment. The options in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here. The rest of the contents of the embodiment of the present application can refer to the contents of the above-mentioned method embodiment, and will not be repeated in this embodiment.
[0185] Figure 3 This is a schematic diagram of the structure of a computer device provided in one embodiment of the present application. Figure 3 As shown, the computer device 3 of this embodiment includes: at least one processor 30 ( Figure 3 Only one is shown in the figure), a memory 31 and a computer program 32 stored in the memory 31 and executable on the at least one processor 30, wherein the processor 30 implements the steps of any of the above method embodiments when executing the computer program 32.
[0186] The computer device 3 may be a computing device such as a smart phone, a tablet computer, a desktop computer, a cloud server, etc. The computer device may include but is not limited to a processor 30 and a memory 31. Those skilled in the art will understand that Figure 3 It is only an example of computer device 3 and does not constitute a limitation on computer device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0187] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0188] In some embodiments, the memory 31 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 31 may also be an external storage device of the computer device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the computer device 3. The memory 31 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 31 may also be used to temporarily store data that has been output or is to be output.
[0189] In addition, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0190] An embodiment of the present application provides a computer program product. When the computer program product is run on a computer device, the computer device implements the steps in the above-mentioned method embodiments when executing the computer device.
[0191] In several embodiments provided in the present application, it is understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.
[0192] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0193] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A method for compressing and encoding electroencephalogram signals based on a Bayesian network model, characterized in that: include: Obtaining an original EEG signal collected by an EEG device, performing multi-scale decomposition on the original EEG signal, and obtaining multiple groups of wavelet coefficients; Transform and reconstruct the wavelet coefficients to obtain a target EEG signal, and decompose the target EEG signal to obtain multiple EEG component signals; Inputting each of the EEG component signals into the Bayesian network model to be constructed, so that each of the EEG component signals is respectively connected to the task feature node, the task state node and the task parallel node of the Bayesian network model; Optimizing the node connection weights of the Bayesian network model to generate a constructed target Bayesian model, wherein the target Bayesian model outputs parallel compression task relationships corresponding to a plurality of the EEG component signals; Dividing the plurality of EEG component signals into a plurality of task clusters according to the parallel compression task relationship, and obtaining a positioning result of each task cluster in the EEG device; Extracting the original component signal corresponding to each of the task clusters from the original EEG signal, inputting the task cluster and the corresponding original component signal into a preset compression encoder, outputting the target task load data corresponding to the task cluster, and completing compression encoding of the plurality of original component signals respectively according to the plurality of target task load data; Each group of wavelet coefficients includes detail coefficients and rough approximation coefficients; the multi-scale decomposition of the original EEG signal to obtain multiple groups of wavelet coefficients includes: Performing multi-level wavelet decomposition on the original EEG signal based on a preset wavelet basis function, and obtaining the detail coefficients and coarse approximation coefficients corresponding to each level of the wavelet decomposition; The transforming and reconstructing the wavelet coefficients comprises: Determining a reconstruction calculation formula for transforming and reconstructing the wavelet coefficients according to the detail coefficients and the rough approximation coefficients of the plurality of groups of the wavelet coefficients; Acquire the target EEG signal according to the reconstruction calculation formula; Determine the reconstruction calculation formula for transforming and reconstructing the wavelet coefficients, including: Assuming that the detail coefficients {cD1', cD2', ..., cDJ'} and the rough approximation coefficients {cAJ'} are obtained through J-layer wavelet decomposition, the calculation formula of wavelet reconstruction is: cA_j-1[k] = Σ_n h'[n-2k]cA_j[n] + Σ_n g'[n-2k]cD_j[n]; Among them, h'[n] and g'[n] are low-pass and high-pass reconstruction filters respectively, which are in a dual relationship with the decomposition filters h[n] and g[n], satisfying the orthogonality and biorthogonality conditions; cA_j-1[k] is the approximation coefficient of the j-1th level, which is obtained by upsampling, filtering and summing the j-th level approximation coefficient cA_j[n] and the detail coefficient cD_j[n]; the process is repeated until j=1, and the time domain signal x'[n] is finally synthesized.
2. The method according to claim 1, characterized in that Before transforming and reconstructing the wavelet coefficients, the method further includes: A plurality of groups of wavelet coefficients are filtered according to a preset threshold value and a soft threshold function to obtain the filtered wavelet coefficients, so as to transform and reconstruct the filtered wavelet coefficients.
3. The method according to claim 1, characterized in that Before inputting each of the EEG component signals into the Bayesian network model to be constructed, the method further includes: extracting the time-frequency features corresponding to each of the EEG component signals to input the time-frequency features into the Bayesian network model; the Bayesian network model includes a feature layer, a state layer and a parallel layer; inputting each of the EEG component signals into the Bayesian network model to be constructed, including: Connecting the time-frequency feature with the task feature node of the feature layer; Determine a task feature node corresponding to each task state node of the state layer, and connect the task state node with the corresponding task feature node; Determine a task status node corresponding to each task parallel node of the parallel layer, and connect the task parallel node to the corresponding task status node.
4. The method according to claim 1, characterized in that: The EEG device includes a plurality of scalp electrodes; and obtaining the positioning result of each task cluster in the EEG device includes: Acquire the response power of the EEG component signal in the task cluster at each of the scalp electrodes; constructing a response power vector according to a plurality of the response powers; Calculating the optimal source position of the task cluster in the EEG device according to a preset back-calculation positioning algorithm and the response power vector; The optimal source position is taken as the positioning result.
5. The method according to claim 1, characterized in that The step of respectively completing compression encoding of the plurality of original component signals according to the plurality of target task load data comprises: Inputting the target task load data and the original component signals into a preset compression coding model, the compression coding model outputting a compression coding signal corresponding to each of the original component signals; The compressed and encoded original electroencephalogram signal is constructed based on a plurality of the compressed and encoded signals.
6. An electroencephalogram signal compression encoding device, characterized in that: The method for implementing the EEG signal compression encoding method according to any one of claims 1 to 5 comprises: A signal acquisition module is used to acquire the original EEG signal collected by the EEG device, perform multi-scale decomposition on the original EEG signal, and acquire multiple groups of wavelet coefficients; A time-frequency acquisition module, used to transform and reconstruct the wavelet coefficients to obtain a target EEG signal, and perform signal decomposition on the target EEG signal to obtain multiple EEG component signals; A node connection module, used for inputting each of the EEG component signals into the Bayesian network model to be constructed, so that each of the EEG component signals is respectively connected to the task feature node, the task state node and the task parallel node of the Bayesian network model; A model generation module, used for optimizing the node connection weights of the Bayesian network model, generating a constructed target Bayesian model, wherein the target Bayesian model outputs parallel compression task relationships corresponding to a plurality of the EEG component signals; A positioning acquisition module, used for dividing the plurality of EEG component signals into a plurality of task clusters according to the parallel compression task relationship, and obtaining a positioning result of each task cluster in the EEG device; A compression coding module is used to extract the original component signal corresponding to each task cluster from the original EEG signal, input the task cluster and the corresponding original component signal into a preset compression encoder, output the target task load data corresponding to the task cluster, and complete the compression coding of multiple original component signals according to multiple target task load data.
7. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the steps of the EEG signal compression encoding method based on the Bayesian network model as described in any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the steps of the EEG signal compression encoding method based on the Bayesian network model as described in any one of claims 1 to 5.
