A method and device for adaptive compression and reconstruction of electroencephalogram signals

Through the EEG signal adaptive compression reconstruction method, using technologies such as discrete cosine transform and neural network, the balance problem between high compression rate and high accuracy in massive EEG signal data is solved, and the wireless transmission bandwidth occupation and computing pressure are reduced. Improved wearability of wireless brain-computer interface devices.

CN115120251BActive Publication Date: 2024-09-06INST OF SEMICONDUCTORS - CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210769158.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-30
Publication Date
2024-09-06
Estimated Expiration
2042-06-30

AI Technical Summary

Technical Problem

Existing technology is difficult to achieve a balance between high compression rate and high accuracy in massive EEG signal data, resulting in wireless brain-computer interface device bandwidth usage and excessive computing pressure, affecting the implementation of wearable devices.

Method used

The EEG signal adaptive compression reconstruction method is used to achieve a balance between high compression rate and high accuracy of the EEG signal through technologies such as discrete cosine transform, neural network decompression, non-uniform quantization and inverse discrete cosine transform.

Benefits of technology

It achieves high compression rate and high accuracy of massive personalized EEG signals, reduces wireless transmission bandwidth usage and computing pressure, and improves the wearability of wireless brain-computer interface devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115120251B
    Figure CN115120251B
Patent Text Reader

Abstract

The invention discloses an electroencephalogram (EEG) signal adaptive compression and reconstruction method, comprising: preprocessing and discrete cosine transforming an EEG signal to obtain a discrete cosine transform result; selecting multiple points of the discrete cosine transform result as a principal component and inputting the principal component into a trained neural network; decompressing the principal component using the trained neural network to obtain a compression result and a decompression result; padding the decompression result with zero to obtain a discrete cosine transform reconstruction result, and subtracting the discrete cosine transform reconstruction result from the discrete cosine transform result; performing non-uniform quantization processing on the difference result and performing arithmetic coding; performing non-uniform inverse quantization processing on the arithmetic coding result and adding it to the discrete cosine transform reconstruction result to obtain a discrete cosine transform estimation signal; performing inverse discrete cosine transform processing on the discrete cosine transform estimation signal, splicing the obtained reconstruction signals of the electroencephalogram (EEG) signal fragments, and obtaining a reconstruction signal of the electroencephalogram (EEG) signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of communication and data compression, and in particular to a method, device, electronic equipment and storage medium for adaptive compression and reconstruction of electroencephalogram (EEG) signals. Background Art

[0002] The wireless development of brain-computer interface technology has a significant advantage, that is, users can wear it for a long time. During the test, the user's range of movement is not restricted, and neural activity can be monitored throughout the day, which provides greater possibilities for in-depth research by medical experts and neuroscientists.

[0003] However, the more data these wireless devices collect, the greater the amount of data transmitted from the sensor end of the wireless system to the decoder end, which means that the transmission device requires a higher bandwidth, which will take up a large amount of wireless bandwidth resources and also bring huge computing pressure and transmission power consumption to the transmission module, which is not conducive to the realization of wearable brain-computer interfaces.

[0004] For massive and personalized EEG signal data, it is difficult for existing technologies to balance compression rate and accuracy. For example, massive EEG signals have a high compression rate but a low accuracy. There is no corresponding technical solution in the existing technology to achieve a high compression rate of EEG signals while ensuring a high accuracy of EEG signals. Summary of the invention

[0005] In view of the above problems, the present invention provides a method, device, electronic device and storage medium for adaptive compression and reconstruction of EEG signals, in order to solve the above problems.

[0006] According to a first aspect of the present invention, there is provided a method for adaptive compression and reconstruction of an electroencephalogram signal, comprising:

[0007] Preprocessing the EEG signal to obtain a plurality of EEG signal segments of equal length, and performing N-point discrete cosine transform on each EEG signal segment to obtain a plurality of discrete cosine transform results, wherein N is a positive integer;

[0008] Select the first M points of each discrete cosine transform result as the principal component, obtain multiple principal components, and input each principal component into the trained neural network, where M is a positive integer less than or equal to N;

[0009] Using a trained neural network compressor to compress each principal component to obtain a plurality of compression results, and using a trained neural network decompressor to decompress each compression result to obtain a plurality of decompression results;

[0010] Performing a zero padding operation on each decompression result to obtain a plurality of discrete cosine transform reconstruction results, and performing a difference operation on each discrete cosine transform reconstruction result and a discrete cosine transform result corresponding to the same EEG signal segment to obtain a plurality of difference results;

[0011] Performing non-uniform quantization processing on each difference result, and performing arithmetic coding on the result of the non-uniform quantization processing to obtain multiple arithmetic coding results;

[0012] Performing non-uniform inverse quantization processing on each arithmetic coding result to obtain multiple non-uniform inverse quantization results, and adding each non-uniform inverse quantization result corresponding to the same EEG signal segment to a discrete cosine transform reconstruction result to obtain discrete cosine transform estimation signals of the multiple EEG signal segments;

[0013] Performing inverse discrete cosine transform processing on the estimated signal of discrete cosine transform of each EEG signal to obtain reconstructed signals of multiple EEG signal segments;

[0014] The reconstructed signals of all the EEG signal fragments are spliced ​​together to obtain a reconstructed signal of the EEG signal.

[0015] According to an embodiment of the present invention, the non-uniform quantization processing of each difference result includes:

[0016] Calculate the optimal partition point set of the difference result, and determine the quantization table of the difference result according to the optimal partition point;

[0017] According to the quantization table, non-uniform quantization processing is performed on the difference result to obtain a non-uniform quantization processing result.

[0018] According to an embodiment of the present invention, the optimal partition point set for calculating the difference result includes:

[0019] Get the number of data of difference results;

[0020] According to the initial division value, the difference result is divided to obtain multiple division results, wherein each division result includes multiple difference result intervals;

[0021] Calculate the total variation of each partition result and compare them to obtain the partition result with the minimum total variation. Use the partition result with the minimum total variation as the optimal partition point and update the initial partition value.

[0022] The partitioning operation, calculation operation, comparison operation and update operation are iterated until the number of iterations meets the number of data of the difference result, and the optimal partitioning point set of the difference result is obtained.

[0023] According to an embodiment of the present invention, the trained neural network is obtained by training using a loss function based on Smooth L1 and an optimizer based on the Adam algorithm.

[0024] According to an embodiment of the present invention, the trained neural network is trained in the following manner:

[0025] Initialize the parameters of the neural network;

[0026] Select multiple basic data sets to train the neural network, and use the loss function and optimizer to update the parameters of the neural network;

[0027] The updated neural network is incrementally trained using personalized data, and the parameters of the neural network are iteratively optimized using the loss function and optimizer to obtain a trained neural network.

[0028] According to an embodiment of the present invention, the discrete cosine transform result is determined by formula (1) to formula (3):

[0029] F N ={f1,f2,…,f N = DCT(X N ) (1),

[0030]

[0031]

[0032] Among them, F N Represents the discrete cosine transform result, X N represents EEG signal, DCT represents discrete cosine transform, f k Represents the component of the discrete cosine transform result, c k Represents the weight coefficients of discrete cosine transform.

[0033] According to an embodiment of the present invention, the reconstructed signal of the above-mentioned EEG signal is determined by formula (4) to formula (6):

[0034]

[0035]

[0036]

[0037] in, Denotes the non-uniform dequantization result, DeQ(*) denotes the non-uniform dequantization operation, E Nq Represents the arithmetic encoding result, represents the reconstructed signal of the EEG signal, represents the component of the reconstructed signal of the EEG signal, IDCT(*) represents the inverse discrete cosine transform, c k Represents the weight coefficients of discrete cosine transform.

[0038] According to a second aspect of the present invention, there is provided an electroencephalogram signal adaptive compression and reconstruction device, comprising:

[0039] A discrete cosine transform module is used to preprocess the EEG signal to obtain multiple EEG signal segments of equal length, and perform N-point discrete cosine transform on each EEG signal segment to obtain multiple discrete cosine transform results, where N is a positive integer;

[0040] A selection and input module is used to select the first M points of each discrete cosine transform result as the principal component, obtain multiple principal components, and input each principal component into the trained neural network, where M is a positive integer less than or equal to N;

[0041] A decompression module, used to compress each principal component using a compressor of a trained neural network to obtain a plurality of compression results, and decompress each compression result using a decompressor of the trained neural network to obtain a plurality of decompression results;

[0042] The zero-padding and difference module is used to perform a zero-padding operation on each decompression result to obtain multiple discrete cosine transform reconstruction results, and perform a difference operation on each discrete cosine transform reconstruction result and discrete cosine transform result corresponding to the same EEG signal segment to obtain multiple difference results;

[0043] A quantization module, used for performing non-uniform quantization processing on each difference result, and performing arithmetic coding on the result of the non-uniform quantization processing to obtain multiple arithmetic coding results;

[0044] The inverse quantization and summation module is used to perform non-uniform inverse quantization processing on each arithmetic coding result to obtain multiple non-uniform inverse quantization results, and add each non-uniform inverse quantization result corresponding to the same EEG signal segment and the discrete cosine transform reconstruction result to obtain discrete cosine transform estimation signals of multiple EEG signal segments;

[0045] An inverse discrete cosine transform module is used to perform inverse discrete cosine transform processing on the discrete cosine transform estimation signal of each EEG signal to obtain reconstructed signals of multiple EEG signal segments;

[0046] The reconstruction module is used to splice the reconstructed signals of all the EEG signal fragments to obtain the reconstructed signal of the EEG signal.

[0047] According to a third aspect of the present invention, there is provided an electronic device, comprising:

[0048] one or more processors;

[0049] a storage device for storing one or more programs,

[0050] When one or more programs are executed by one or more processors, the one or more processors execute an electroencephalogram signal adaptive compression and reconstruction method.

[0051] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute a method for adaptive compression and reconstruction of electroencephalogram signals.

[0052] The present invention obtains a reconstructed signal of the EEG signal with high compression rate and high accuracy by preprocessing and discrete cosine transforming the EEG signal, decompressing the EEG signal after discrete cosine transforming with a neural network, and performing non-uniform quantization processing, non-uniform inverse quantization processing and inverse discrete cosine transform processing on the decompression result, thereby achieving a balance between high compression rate and high accuracy of massive personalized EEG signals. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 is a flow chart of a method for adaptive compression and reconstruction of EEG signals according to an embodiment of the present invention;

[0054] Figure 2 is a flow chart of performing non-uniform quantization processing on each difference result according to an embodiment of the present invention;

[0055] Figure 3 is a flow chart of calculating an optimal partition point set for calculating a difference result according to an embodiment of the present invention;

[0056] Figure 4 is a flowchart of obtaining a trained neural network according to an embodiment of the present invention;

[0057] Figure 5 is a structural diagram of an electroencephalogram signal adaptive compression and reconstruction method according to an embodiment of the present invention;

[0058] Figure 6 is a structural block diagram of a device for adaptive compression and reconstruction of EEG signals according to an embodiment of the present invention;

[0059] Figure 7 is a schematic diagram of the structure of a neural network compressor according to an embodiment of the present invention;

[0060] Figure 8 The block diagram of an electronic device suitable for implementing the method for adaptive compression and reconstruction of EEG signals according to an embodiment of the present invention is schematically shown. DETAILED DESCRIPTION

[0061] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

[0062] EEG compression techniques can be divided into three major categories: lossy, lossless, and near-lossless. Lossless data compression analysis methods for EEG signals can be divided into two major categories: (1) single stage and (2) multi-stage. In single stage, only entropy reduction techniques such as Huffman, arithmetic, predictive coding, and transform compression are applied to the raw data. In multi-stage methods, preprocessing techniques are applied before applying entropy reduction methods to the raw data. Some examples of multi-stage techniques are correlation dimension removal, removal of DC components in the data by backward subtraction, and arranging data belonging to different channels in two-dimensional and three-dimensional forms. The correlation between the data is then further removed using predictors based on artificial neural networks or using transforms such as wavelet transform, Karhunen-Loeve transform (KLT), filter banks, etc. In the last step, entropy coding is performed on the error.

[0063] In addition, there are compression techniques in compressed sensing (CS). The Shannon / Nyquist sampling theorem states that the samples recorded from a signal should be twice the bandwidth in order to effectively reconstruct the original signal. However, this standard is very expensive in terms of computation and storage. Moreover, in medical imaging, it is very costly to increase the sampling rate to improve accuracy. Compressed sensing technology has evolved to provide a solution that involves acquiring a signal with only a small number of measurements or samples and reconstructing the original signal from it. These capabilities brought by CS have made it popular in areas such as Magnetic Resonance Imaging (MRI), radio detection and ranging, traffic monitoring in digital networks, and wireless sensor networks.

[0064] The present invention proposes a personalized compression and reconstruction algorithm for EEG signals. The algorithm first performs discrete cosine transform (DCT) on the signal and selects the principal component, then uses the pre-training plus fine-tuning method to generate an adaptive artificial neural network (ANN) model for each sample, calculates the difference between the restored value and the original value after decompression by ANN to correct the error, and uses personalized non-uniform quantization to reduce the error, and finally performs an inverse DCT transform to obtain a restored signal close to the input signal.

[0065] In the technical solution of the present invention, the acquisition, research, processing, storage and application of the EEG signal data involved all comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.

[0066] Figure 1 4 is a flow chart of a method for adaptive compression and reconstruction of EEG signals according to an embodiment of the present invention.

[0067] like Figure 1 As shown, the above method includes operations S110 to S180.

[0068] In operation S110, the EEG signal is preprocessed to obtain a plurality of EEG signal segments of equal length, and each EEG signal segment is subjected to N-point discrete cosine transform to obtain a plurality of discrete cosine transform results, where N is a positive integer.

[0069] Preprocessing the EEG signal includes dividing the EEG signal, for example, dividing the EEG signal to be processed into 250-point segments, each segment corresponding to a time length of 1 second, and then performing a 250-point discrete cosine transform (DCT) on the EEG signal.

[0070] In operation S120, the first M points of each discrete cosine transform result are selected as principal components to obtain multiple principal components, and each principal component is input into the trained neural network, where M is a positive integer less than or equal to N.

[0071] M points may be, for example, 80 points. In operation S110, N points (for example, 250 points) of discrete cosine transform are performed on the EEG signal segment. Each EEG signal segment has 250 points. In operation S120, the first 80 points are selected as the main components.

[0072] In operation S130, each principal component is compressed using a compressor of the trained neural network to obtain a plurality of compression results, and each compression result is decompressed using a decompressor of the trained neural network to obtain a plurality of decompression results.

[0073] Neural networks include artificial neural networks (ANN).

[0074] In operation S140, each decompression result is padded with zeros to obtain a plurality of discrete cosine transform reconstruction results, and each discrete cosine transform reconstruction result corresponding to the same EEG signal segment is subtracted from the discrete cosine transform result to obtain a plurality of difference results.

[0075] In the above operation S140, the discrete cosine transform reconstruction result and the discrete cosine transform result subjected to the difference operation belong to the same EEG signal segment.

[0076] In operation S150, each difference result is subjected to non-uniform quantization processing, and the result of the non-uniform quantization processing is arithmetically encoded to obtain a plurality of arithmetically encoded results.

[0077] In operation S160, each arithmetic coding result is subjected to non-uniform inverse quantization processing to obtain multiple non-uniform inverse quantization results, and each non-uniform inverse quantization result corresponding to the same EEG signal segment is added to the discrete cosine transform reconstruction result to obtain discrete cosine transform estimation signals of the multiple EEG signal segments.

[0078] In the above operation S160, the non-uniform inverse quantization result and the discrete cosine transform reconstruction result that are added belong to the same EEG signal segment.

[0079] In operation S170, an inverse discrete cosine transform process is performed on the discrete cosine transform estimation signal of each EEG signal to obtain reconstructed signals of a plurality of EEG signal segments.

[0080] In operation S180, the reconstructed signals of all the EEG signal segments are spliced ​​to obtain a reconstructed signal of the EEG signal.

[0081] The above operation reconstructs each EEG signal segment, and the reconstructed signals of multiple EEG signal segments are spliced ​​to obtain the reconstructed signal of the original EEG signal. Each EEG signal segment needs to undergo multi-point DCT processing, principal component selection, artificial neural network decompression, zero padding and difference processing, non-uniform quantization processing, arithmetic coding processing, inverse quantization processing and inverse DCT processing to obtain the reconstructed signal of the EEG signal segment.

[0082] The present invention obtains a reconstructed signal of the EEG signal with high compression rate and high accuracy by preprocessing and discrete cosine transforming the EEG signal, decompressing the EEG signal after discrete cosine transforming with a neural network, and performing non-uniform quantization processing, non-uniform inverse quantization processing and inverse discrete cosine transform processing on the decompression result, thereby achieving a balance between high compression rate and high accuracy of massive personalized EEG signals.

[0083] Figure 2 FIG. 4 is a flow chart of performing non-uniform quantization processing on each difference result according to an embodiment of the present invention. Figure 2 As shown, the non-uniform quantization process includes operations S210 to S220.

[0084] In operation S210, an optimal partition point set of the difference result is calculated, and a quantization table of the difference result is determined according to the optimal partition point.

[0085] In operation S220, non-uniform quantization processing is performed on the difference result according to the quantization table to obtain a non-uniform quantization processing result.

[0086] The above non-uniform quantization processing operation can effectively reduce errors and obtain more accurate calculation results compared with the prior art.

[0087] Figure 3 4 is a flowchart of calculating an optimal partition point set for calculating difference results according to an embodiment of the present invention.

[0088] like Figure 3 As shown, operation S310 to operation S340 are included.

[0089] In operation S310, the number of data of the difference result is obtained;

[0090] In operation S320, the difference result is divided according to the initial division value to obtain a plurality of division results, wherein each division result includes a plurality of difference result intervals;

[0091] In operation S330, the total variation of each partition result is calculated and compared to obtain the partition result with the minimum total variation, and the partition result with the minimum total variation is used as the optimal partition point and the initial partition value is updated;

[0092] In operation S340, the division operation, calculation operation, comparison operation and update operation are iterated until the number of iterations meets the number of data of the difference result, and the optimal division point set of the difference result is obtained.

[0093] The non-uniform quantization process is further described in detail below in conjunction with specific implementation methods.

[0094] Non-uniform quantization is based on statistical principles. It performs statistical analysis on certain raw data to obtain a quantization table. Then, the difference e is quantized according to the quantization table. The method of constructing the quantization table is described as follows:

[0095] Define a set of sorted numbers X = {x1, x2, ..., x n} has a variation of d, then:

[0096]

[0097] For the sorted training set X = {x1, x2, ..., x n}, m divisions are performed, and a total of m intervals are divided. Each interval is represented by a number. If we want to restore the value as much as possible after quantization, the error between the value in each interval and the average value must be the smallest. If the sum of squares of errors is used to measure the size of the total error, the total error in each interval can be represented by the variation defined by formula (7).

[0098] For X, remember d i,j is a subset of X′={x i ,xi+1 ,…,x j}, remember is the total variation after n numbers are divided into m intervals, where i1,i2,...i m-1 Respectively represent the serial numbers of the separation positions. Then:

[0099]

[0100] For m partitions of n numbers, there is only one set i1,i2,...i m-1 Can make the total worse The smallest, then this group of partitions is the optimal partition, recorded as Consider the case of m=3, then:

[0101]

[0102] in For the optimal partition, formula (9) can be rewritten as:

[0103]

[0104] To calculate the optimal three-way partition, we need to calculate the optimal two-way partition of the first i2 numbers, where i2 = 2, 3, ..., m-1. In general, for an ordered sequence of n numbers X = {x1, x2, ..., x n To calculate the optimal three-partition, we first need to calculate the optimal two-partition of the first n-1 data, the optimal two-partition of the first n-2 numbers, and the optimal two-partition of the first 3 numbers. To calculate the optimal k (k = 4, 5, ..., n-1) partition, we only need to calculate the optimal k-1 partition of n-2 numbers, ..., the optimal k-1 partition of the first k numbers.

[0105] After calculating the optimal division of a set of numbers, the corresponding optimal division point can be used as the boundary of the quantization table. Since the calculation of the optimal division is based on the principle of minimum total variation, the reasonable reconstruction value should be given by the mean of each quantization interval.

[0106] According to an embodiment of the present invention, the trained neural network is obtained by training using a loss function based on Smooth L1 and an optimizer based on the Adam algorithm.

[0107] Figure 4 4 is a flowchart of obtaining a trained neural network according to an embodiment of the present invention.

[0108] like Figure 4 As shown, operation S410 to operation S430 are included.

[0109] In operation S410, parameters of the neural network are initialized;

[0110] In operation S420, multiple basic data sets are selected to train the neural network, and the parameters of the neural network are updated using a loss function and an optimizer;

[0111] In operation S430, the updated neural network is incrementally trained using the personalized data, and the parameters of the neural network are iteratively optimized using a loss function and an optimizer to obtain a trained neural network.

[0112] In the process of training the neural network, the network is first trained using the basic training sets S1 to S15 to obtain a more general compression model. In specific applications, for each subject in the test set, the pre-trained model is incrementally trained using the first two sets of experiments to obtain a specific model for the individual, that is, a personalized model. This final version of the model is used to test the next two sets of experiments on the individual to obtain the compression and decompression results.

[0113] In the training of ANN, a training method is proposed to first pre-train on a wide range of data sets, and then perform incremental training on specific targeted data sets. The former can train a model with strong adaptability and generalization, and the latter can obtain a targeted model based on the former. With the pre-trained model as the basis, incremental training requires less data, converges faster, and the model is more targeted. This achieves personalized compression.

[0114] According to an embodiment of the present invention, the discrete cosine transform result is determined by formula (1) to formula (3):

[0115] F N ={f1,f2,…,f N = DCT(X N ) (1),

[0116]

[0117]

[0118] Among them, F N Represents the discrete cosine transform result, X N represents EEG signal, DCT represents discrete cosine transform, f k Represents the component of the discrete cosine transform result, c k Represents the weight coefficients of discrete cosine transform.

[0119] According to an embodiment of the present invention, the reconstructed signal of the above-mentioned EEG signal is determined by formula (4) to formula (6):

[0120]

[0121]

[0122]

[0123] in, Denotes the non-uniform dequantization result, DeQ(*) denotes the non-uniform dequantization operation, E Nq Represents the arithmetic encoding result, represents the reconstructed signal of the EEG signal, represents the component of the reconstructed signal of the EEG signal, IDCT(*) represents the inverse discrete cosine transform, c k Represents the weight coefficients of discrete cosine transform.

[0124] Figure 5 is a structural diagram of a method for adaptive compression and reconstruction of EEG signals according to an embodiment of the present invention.

[0125] Combine the following Figure 5 And specific implementation methods, the electroencephalogram signal adaptive compression reconstruction method provided by the present invention is further described in detail.

[0126] like Figure 5 As shown in FIG. 1 , a compression system is mainly divided into two parts: a compressor and a decompressor. In the system provided by the present invention, the compressor is mainly divided into three steps, namely, DCT transformation, neural network feature extraction, and quantization of differences. The system structure provided by the present invention is as follows: Figure 5 As shown, wherein EEG stands for electroencephalography.

[0127] DCT transform can extract the frequency components of each signal, and for natural data, most signal energy is concentrated in some limited low-frequency components. DCT transform can N As a first step, it is combined with an ANN-based compression scheme. Therefore, the DCT transform is applied to the input block in the first step, and then some low-frequency coefficients, called primary coefficients, are selected as shown in Figure 1. N After entering the compression system, the system first performs DCT transformation on it, as shown in formula (1):

[0128] F N ={f1,f2,…,f N = DCT(X N ) (1),

[0129] The calculation formula of DCT transform is shown in formula (2):

[0130]

[0131] Among them, c kAs shown in formula (3):

[0132]

[0133] Then the DCT coefficients obtained by the transformation are selected, as shown in formula (11):

[0134] F main ={f1,f2,…,f 80} (11),

[0135] Use neural network to compress the principal component and get the compressed coefficient F c , and then use the neural network to recover and get As shown in formula (12):

[0136]

[0137] Again Zero padding is performed to reconstruct the DCT coefficients at point N, as shown in formula (13):

[0138]

[0139] Subtract the reconstructed DCT coefficients from the original coefficients to get the error E N , as shown in formula (14):

[0140]

[0141] In order to compress the error, it is necessary to find a quantization table. Traditional methods mostly use uniform quantization, while the present invention proposes non-uniform quantization, and proposes an idea of ​​using different quantization tables for quantization according to the statistical characteristics of coefficients at different positions.

[0142] E Nq =Q(E N ) (15),

[0143] F c With E Nq This is the compressed signal.

[0144] Then, arithmetic coding is used to perform source coding on the compressed signal.

[0145] After transmission, the arithmetic encoding result is transmitted to the decompressor, and F is obtained after arithmetic decoding. c and E Nq These two sets of numbers are then decompressed by the decompressor. c After similar steps as in the compressor, we get E Nq After the dequantizer, we get E N Estimated value of Therefore, we can add the DCT estimate and the error estimate to obtain a DCT coefficient that is closer to the true value. The difference between this coefficient and the original DCT coefficient is smaller than the direct estimate of the DCT coefficient. Then, the coefficient is inversely transformed to obtain the reconstructed value of the original EEG signal, as shown in formula (5):

[0146]

[0147]

[0148]

[0149] In this way, a good estimate of the EEG data can be obtained with a higher compression rate.

[0150] Figure 6 4 is a structural block diagram of a device for adaptive compression and reconstruction of EEG signals according to an embodiment of the present invention.

[0151] like Figure 6 As shown, the above-mentioned device 600 includes a discrete cosine transform module 610, a selection and input module 620, a decompression module 630, a zero padding and difference module 640, a quantization module 650, an inverse quantization and summation module 660, an inverse discrete cosine transform module 670 and a reconstruction module 680.

[0152] The discrete cosine transform module 610 is used to pre-process the EEG signal to obtain multiple EEG signal segments of equal length, and perform N-point discrete cosine transform on each EEG signal segment to obtain multiple discrete cosine transform results, where N is a positive integer.

[0153] The selection and input module 620 is used to select the first M points of each discrete cosine transform result as principal components, obtain multiple principal components, and input each principal component into the trained neural network, where M is a positive integer less than or equal to N.

[0154] The decompression module 630 is used to compress each principal component using the trained neural network compressor to obtain multiple compression results, and decompress each compression result using the trained neural network decompressor to obtain multiple decompression results.

[0155] The zero-padding and difference module 640 is used to perform a zero-padding operation on each decompression result to obtain multiple discrete cosine transform reconstruction results, and to perform a difference operation on each discrete cosine transform reconstruction result and discrete cosine transform result corresponding to the same EEG signal segment to obtain multiple difference results.

[0156] The quantization module 650 is configured to perform non-uniform quantization on each difference result, and perform arithmetic coding on the result of the non-uniform quantization to obtain a plurality of arithmetic coding results.

[0157] The inverse quantization and summation module 660 is configured to perform non-uniform inverse quantization on each arithmetic coding result to obtain a plurality of non-uniform inverse quantization results, and perform an addition operation on each non-uniform inverse quantization result corresponding to the same EEG signal segment and the discrete cosine transform reconstruction result to obtain an estimated signal of the discrete cosine transform of a plurality of EEG signal segments.

[0158] The inverse discrete cosine transform module 670 is configured to perform inverse discrete cosine transform processing on the estimated signal of the discrete cosine transform of each EEG signal to obtain a plurality of reconstructed signals of EEG signal segments.

[0159] The reconstruction module 680 is configured to splice the reconstructed signals of all EEG signal segments to obtain the reconstructed signal of the EEG signal.

[0160] The above device provided by the present invention can achieve a high compression rate of EEG signals while ensuring high accuracy.

[0161] Figure 7 It is a schematic structural diagram of a neural network compressor according to an embodiment of the present invention.

[0162] Next, in conjunction with Figure 7 and specific implementation manners, the above method or device provided by the present invention will be further described in detail.

[0163] The input EEG signal is divided into segments of 250 points, and each segment corresponds to a time length of 1 second. Then, a 250-point DCT transform is performed on the signal; then, the first 80 points of the transform result are selected as the principal components and input into the neural network.

[0164] As Figure 7 shown, the neural network in the compressor part uses a two-layer perceptron. The first layer acts as a compressor called ANNc, and the second layer is used for decompression called ANNd. In this model, the input data is a signal with a length of 80 points. After these signals are input into the ANN, they are compressed by the ANNc layer to obtain a shorter sequence F with a length of 16 points c as the compression result. Similarly, the output layer ANNd of the ANN generates a reconstructed signal from the compressed signal in the opposite way. The overall structure of this ANN-based compression scheme is as Figure 3 shown. In this structure, each input is a signal with a length of N. The compressed signal is generated in the output of the ANNc part, which reduces the input block from N samples to c samples (c < N). In the decompression layer (ANNd part), the c samples are restored to N samples. The loss function selects Smooth L1, and the optimizer selects Adam.

[0165] The training set is used to train the neural network to obtain a trained neural network to process EEG signals.

[0166] After pre-restoration in the compressor, the 80-point restoration result is padded with zeros to 250 points to obtain the reconstructed result, which is then subtracted from the original input and the difference is non-uniformly quantized.

[0167] The optimal partition of a set of numbers is calculated using non-uniform quantization operations, and the corresponding optimal partition point is used as the boundary of the quantization table. Since the calculation of the optimal partition is based on the principle of minimum total variation, the reasonable reconstruction value should be given by the mean of each quantization interval.

[0168] After non-uniform quantization, the result is arithmetically encoded and transmitted. The content transmitted in the channel includes the result of arithmetic encoding and the result of ANNc compression. When the decompressor receives this signal, it first arithmetically decodes the result of arithmetic encoding, and then performs non-uniform inverse quantization. During inverse quantization, the result of each quantization interval is assigned the mean of the interval. The decompressor performs ANNd decompression on the compressed result of ANNc, and then fills zeros to 250 points. It is added to the result of inverse quantization to obtain the estimated value of the DCT of the original signal. Finally, the IDCT transform is performed to obtain the decompressed result.

[0169] Figure 8 The block diagram of an electronic device suitable for implementing the method for adaptive compression and reconstruction of EEG signals according to an embodiment of the present invention is schematically shown.

[0170] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present invention includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0171] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present invention by executing the programs in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present invention by executing the programs stored in the one or more memories.

[0172] According to an embodiment of the present invention, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage portion 808 as needed.

[0173] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.

[0174] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.

[0175] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for adaptive compression and reconstruction of electroencephalogram signals, comprising: Preprocessing the EEG signal to obtain a plurality of EEG signal segments of equal length, and performing N-point discrete cosine transform on each of the EEG signal segments to obtain a plurality of discrete cosine transform results, wherein N is a positive integer; Selecting the first M points of each discrete cosine transform result as principal components to obtain multiple principal components, and inputting each principal component into the trained neural network, where M is a positive integer less than or equal to N; Using the trained neural network compressor to compress each of the principal components to obtain a plurality of compression results, and using the trained neural network decompressor to decompress each of the compression results to obtain a plurality of decompression results; Performing a zero padding operation on each of the decompression results to obtain a plurality of discrete cosine transform reconstruction results, and performing a difference operation on each of the discrete cosine transform reconstruction results corresponding to the same EEG signal segment and the discrete cosine transform result to obtain a plurality of difference results; Performing non-uniform quantization processing on each of the difference results, and performing arithmetic coding on the results of the non-uniform quantization processing to obtain multiple arithmetic coding results; Performing non-uniform inverse quantization processing on each of the arithmetic coding results to obtain a plurality of non-uniform inverse quantization results, and performing an addition operation on each of the non-uniform inverse quantization results corresponding to the same EEG signal segment and the discrete cosine transform reconstruction result to obtain discrete cosine transform estimation signals of the plurality of EEG signal segments; Performing inverse discrete cosine transform processing on the estimated signal of the discrete cosine transform of each of the EEG signals to obtain reconstructed signals of a plurality of the EEG signal segments; splicing the reconstructed signals of all the EEG signal segments to obtain a reconstructed signal of the EEG signal; The non-uniform quantization processing of each difference result includes: Calculating an optimal division point set of the difference result, and determining a quantization table of the difference result according to the optimal division point; According to the quantization table, non-uniform quantization processing is performed on the difference result to obtain a non-uniform quantization processing result; The optimal partition point set for calculating the difference result includes: Obtain the number of data of the difference result; According to the initial division value, the difference result is divided to obtain a plurality of division results, wherein each of the division results includes a plurality of difference result intervals; Calculate the total variation of each of the partition results and compare them to obtain the partition result with the minimum total variation, and use the partition result with the minimum total variation as the optimal partition point and update the initial partition value; The division operation, the calculation operation, the comparison operation and the update operation are iterated until the number of iterations meets the number of data of the difference result, thereby obtaining an optimal division point set of the difference result.

2. The method according to claim 1, wherein: The trained neural network is trained in the following way: Initializing parameters of the neural network; Selecting multiple basic data sets to train the neural network, and updating the parameters of the neural network using a loss function and an optimizer; The updated neural network is incrementally trained using the personalized data, and the parameters of the neural network are iteratively optimized using the loss function and the optimizer to obtain the trained neural network.

3. A device for implementing the method for adaptive compression and reconstruction of EEG signals according to any one of claims 1 and 2, comprising: A discrete cosine transform module is used to preprocess the EEG signal to obtain a plurality of EEG signal segments of equal length, and perform N-point discrete cosine transform on each of the EEG signal segments to obtain a plurality of discrete cosine transform results, wherein N is a positive integer; A selection and input module, used for selecting the first M points of each discrete cosine transform result as principal components, obtaining multiple principal components, and inputting each principal component into the trained neural network, wherein M is a positive integer less than or equal to N; A decompression module, used to compress each of the principal components using the compressor of the trained neural network to obtain a plurality of compression results, and decompress each of the compression results using the decompressor of the trained neural network to obtain a plurality of decompression results; A zero-padding and difference module, used for performing a zero-padding operation on each of the decompression results to obtain a plurality of discrete cosine transform reconstruction results, and performing a difference operation on each of the discrete cosine transform reconstruction results corresponding to the same EEG signal segment and the discrete cosine transform result to obtain a plurality of difference results; A quantization module, used for performing non-uniform quantization processing on each of the difference results, and performing arithmetic coding on the results of the non-uniform quantization processing to obtain multiple arithmetic coding results; A dequantization and summing module, configured to perform non-uniform dequantization processing on each of the arithmetic coding results to obtain a plurality of non-uniform dequantization results, and perform addition operation on each of the non-uniform dequantization results corresponding to the same EEG signal segment and the discrete cosine transform reconstruction result to obtain discrete cosine transform estimation signals of the plurality of EEG signal segments; An inverse discrete cosine transform module, used for performing inverse discrete cosine transform processing on the estimated signal of the discrete cosine transform of each of the EEG signals to obtain reconstructed signals of a plurality of the EEG signal segments; The reconstruction module is used to splice the reconstructed signals of all the EEG signal segments to obtain the reconstructed signal of the EEG signal.

4. An electronic device, comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method according to any one of claims 1 and 2.

5. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to perform the method according to any one of claims 1 and 2.