Neural data compression, decompression, sending and receiving method and system and electronic equipment
By using preprocessing technology and autoregression models on the microcontroller to reshape and entropy coding of neural data, the problem of difficult to achieve efficient neural data compression and decompression in the prior art is solved, and efficient, real-time and lossless neural data transmission is achieved.
Patent Information
- Application Number
- CN202510280257.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-06-27
AI Technical Summary
The prior art is difficult to achieve efficient neural data compression and decompression in microcontrollers, and cannot meet the bandwidth limitations of low-power wireless communications, affecting the efficiency and integrity of real-time neural data transmission.
The preprocessing technology is used to reshape the code distribution of neural data to zero, the data distribution is reshape using autoregressive models, and data compression and decompression is performed through entropy encoding (such as Hoffman encoding), ensuring efficient data processing and transmission on the microcontroller.
It realizes efficient compression and decompression of neural data on the microcontroller, improves the efficiency and integrity of data transmission, meets the bandwidth requirements of low-power wireless communication, and ensures real-time and data losslessness.
Smart Images

Figure CN120223092A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of neural data processing, and particularly to methods, systems, and electronic devices for neural data compression, decompression, transmission, and reception. Background Art
[0002] Wirelessly transmitting a large amount of neural data from a neural interface device to a host poses a huge challenge. The data needs to be compressed at the transmitter and decompressed at the receiver to adapt to the limitations of low-power wireless communication technologies (such as BLE). The actual maximum data throughput of BLE 5.2 is 1.4 Mbps, while the data rate generated by the motor decoder in previous work when operating at 12-bit resolution and 10 kHz sampling rate for 16 - 32 channels reaches 1.9 - 3.8 Mbps, far exceeding the BLE bandwidth.
[0003] Data compression can reduce the neural data rate, but there are practical difficulties in developing compression algorithms suitable for neural interface devices. The microprocessors in the devices have limited computing power and memory, making it difficult to support complex compression and decompression technologies. Moreover, many neural decoding applications require real-time and low-latency transmission. Compression algorithms that rely on detecting large sequence repetition patterns will disrupt real-time performance due to latency. Therefore, low-complexity algorithms need to be adopted to effectively retain neural data while reducing computational costs.
[0004] Data compression mainly has two methods: lossy and lossless. Lossy compression sacrifices data integrity for a high compression ratio and is not suitable for neural data because neuroscientists have limited understanding of neural information. Neuroscientists prefer lossless data transmission to maintain signal integrity for analyzing and developing improved neural decoding technologies.
[0005] Lossless compression methods are divided into three categories: statistical coding, dictionary-based coding, and transform coding. Statistical coding optimizes storage by allocating short codes according to frequencies; dictionary-based coding builds a dictionary of repeated sequences to replace short codes and reduce redundancy; transform coding modifies the data representation to improve compressibility and is often used in combination with other techniques. Modern lossless compression schemes combine these techniques and are integrated into file formats such as ZIP, PNG, and FLAC, but they have not been effectively used for real-time neural data compression due to high computational and memory requirements. Summary of the Invention
[0006] In view of the deficiencies of the above-mentioned prior art, one of the objectives of the present invention is to provide a neural data compression method for real-time neural data transmission. Compared with existing algorithms, it can be implemented on a microcontroller, conform to the bandwidth of low-power Bluetooth, improve the transmission rate, and at the same time achieve lossless transmission of neural data.
[0007] Another objective of the present invention is to provide a neural data decompression method.
[0008] Another objective of the present invention is to provide a neural data transmission method.
[0009] A fourth object of the present invention is to provide a method for receiving neural data.
[0010] A fifth object of the present invention is to provide a neural data acquisition system.
[0011] A sixth object of the present invention is to provide an electronic device.
[0012] A seventh object of the present invention is to provide a computer-readable medium.
[0013] To achieve the above object, the present invention adopts the following technical solutions:
[0014] On the one hand, the present invention provides a method for compressing neural data, including:
[0015] Preprocessing the neural data to distribute the codes of the neural data to zero;
[0016] Using an autoregressive model to reshape the code distribution of the neural data;
[0017] Performing an entropy coding operation on the reshaped neural data to obtain compressed data.
[0018] Preferably, the preprocessing includes:
[0019] Processing the neural data using one or more filtering units; the filtering unit includes a downsampling unit, an anti-aliasing filtering unit, and a notch filter.
[0020] Preferably, the neural data includes multiple channel sub-data obtained from multiple data channels; before using the autoregressive model to reshape the code distribution of the neural data, the following is also performed:
[0021] Performing a cross-channel transformation operation on the neural data to reduce the dependence between the multiple channel sub-data.
[0022] Preferably, before performing the cross-channel transformation operation, the following is also performed:
[0023] Determining whether there is a predetermined situation between the multiple channel sub-data, and if so, performing the cross-channel transformation operation, otherwise not performing the cross-channel transformation operation; the predetermined situation includes a highly correlated situation and an artifact situation.
[0024] Preferably, the cross-channel transformation operation is completed using a cross-channel formula, and the cross-channel formula is as follows:
[0025] x′1 = (x1 + x2 + … + x n ) / n;
[0026] x′2 = (x1 - x2) / 2;
[0027] …
[0028] x′ n = (x n-1 - x n ) / 2;
[0029] where {x1, x2, …, x n} is the data before conversion; {x′1, x′2, …, x′ n} is the data after conversion.
[0030] Preferably, reshaping the code distribution of the neural data using an autoregressive model specifically includes:
[0031] Processing each of the channel sub - data in the neural data using an autoregressive conversion formula to achieve reshaping of the neural data; the autoregressive conversion formula is:
[0032]
[0033] where a k is the autoregressive coefficient; x[m] is the data before reshaping; x′[m] is the data after reshaping; N AR is the order of the autoregressive model.
[0034] Preferably, the autoregressive coefficient is set fixed or obtained by the host computer sending it according to a predetermined period.
[0035] Preferably, the entropy coding includes Huffman coding, arithmetic coding, and asymmetric digital coding.
[0036] On the other hand, the present invention provides a method for decompressing neural data, including:
[0037] Performing an entropy - coding decoding operation on the compressed data to obtain pre - decoded data;
[0038] Decoding the pre - decoded data using an autoregressive model to obtain neural data.
[0039] Preferably, the neural data includes multiple channel sub - data obtained from multiple data channels;
[0040] After obtaining the neural data, a reverse cross - channel transformation operation is further performed to obtain the original neural data; the reverse cross - channel transformation operation is completed using a reverse transformation formula, and the reverse transformation formula is as follows:
[0041]
[0042] x2 = x1 - 2x′2;
[0043] …
[0044] xn = x n-1 - 2x' n ;
[0045] where {x1, x2, …, x n} is the data after inverse transformation; {x'1, x'2, …, x' n} is the data before inverse transformation.
[0046] Preferably, before performing the inverse cross-channel transformation operation, it further includes:
[0047] Determine whether there is a predetermined situation among multiple pieces of the channel sub-data. If so, perform the inverse cross-channel transformation operation; otherwise, do not perform the cross-channel transformation operation; the predetermined situation includes a highly correlated situation and an artifact situation.
[0048] On the other hand, the present invention provides a method for sending neural data, which is applied to a neural data detection device and includes:
[0049] Compress the obtained neural data by using any of the neural data compression methods to obtain compressed data corresponding to the neural data;
[0050] Truncate the compressed data into bytes with a predetermined number of digits and transmit it to the host computer wirelessly.
[0051] Preferably, after obtaining the compressed data, store the compressed data in a buffer;
[0052] Before processing the neural data, it further includes:
[0053] When the operating state of the device is in the low-latency mode, if the amount of data in the buffer does not exceed the latency threshold, normally perform the data compression operation; otherwise, delete one sample data in the buffer.
[0054] On the other hand, the present invention provides a method for receiving neural data, which is applied to a host computer and includes:
[0055] Receive the compressed data wirelessly;
[0056] Decode the compressed data by using any of the neural data decompression methods to obtain neural data.
[0057] On the other hand, the present invention provides a neural data acquisition system, which includes:
[0058] A neural data acquisition device that executes any of the neural data sending methods;
[0059] A host computer that executes the neural data receiving method.
[0060] In another aspect, the present invention provides an electronic device, comprising:
[0061] a memory storing a computer program;
[0062] A processor, when executing the computer program, implements any of the neural data compression methods, or implements any of the neural data decompression methods, or implements any of the neural data sending methods, or implements the neural data receiving method.
[0063] On the other hand, the present invention provides an electronic device storing a computer program, which, when executed by a processor, implements any of the neural data compression methods, or any of the neural data decompression methods, or any of the neural data sending methods, or any of the neural data receiving methods.
[0064] Compared with the prior art, the neural data compression, decompression, transmission, and reception method, system, and electronic device provided by the present invention have the following beneficial effects:
[0065] 1. Improved data stability: Preprocessing operations (such as distributing codes to zero) can reduce the impact of noise in the data to a certain extent, making the data more stable and conducive to mining the essential characteristics of the data.
[0066] 2. Improved data transmission efficiency: Through preprocessing and entropy coding, the storage space and transmission bandwidth requirements of data can be significantly reduced. This is particularly important for neural interface devices that generate a large amount of data, whether it is stored locally or transmitted to the host through the network, it has obvious advantages;
[0067] 3. Data feature extraction: The autoregressive model can mine potential sequence patterns in neural data and improve the compressibility of data. In addition, the autoregressive model can be used to reshape the code distribution of neural data and improve the security of neural data. After the data is processed by the autoregressive model, its internal redundant information may be better organized, which is more conducive to subsequent compression operations.
[0068] 4. Data integrity preservation: Entropy coding is a lossless compression technology that can compress data to the maximum extent without losing data information. This ensures that the original information of the data can be accurately restored when the host performs subsequent processing, ensuring the accuracy of analysis and processing;
[0069] 5. Data privacy protection: In some cases, data compression can be used to process data without exposing the original data, which helps protect data privacy. For example, in some neural interface applications that need to protect user privacy, compressed data can be transmitted and analyzed without leaking sensitive information.
[0070] 6. Improvement in data processing efficiency: By preprocessing and compressing neural data, the computational amount of data processing can be reduced, and the efficiency of data processing can be improved. This is particularly important for application scenarios of neural interface devices with high real-time requirements (such as brain-computer interfaces). Description of the Drawings
[0071] Figure 1 is a flowchart of the neural data compression method provided by the present invention.
[0072] Figure 2 is a flowchart of an embodiment of the neural data compression method provided by the present invention.
[0073] Figure 3 is the influence of each step in the neural data compression method provided by the present invention on time series data and code distribution.
[0074] Figure 4 is the bit length of each code in the Huffman dictionary provided by the present invention.
[0075] Figure 5 is the compression ratio corresponding to different orders of the autoregressive model in the neural data compression method provided by the present invention.
[0076] Figure 6 is a flowchart of the neural data decompression method provided by the present invention.
[0077] Figure 7 is a flowchart of the neural data sending method provided by the present invention.
[0078] Figure 8 is a flowchart of another embodiment of the neural data sending method provided by the present invention.
[0079] Figure 9 is a flowchart of the neural data receiving method provided by the present invention.
[0080] Figure 10 is a block diagram of the structure of the neural data acquisition system provided by the present invention.
[0081] Figure 11 is a block diagram of the structure of an embodiment of the neural data acquisition system provided by the present invention.
[0082] Figure 12 is the real-time compression ratio during the data stream transmission provided by the present invention.
[0083] Figure 13 is the running time allocated for compression and decompression by NRF52840 provided by the present invention. Detailed Embodiments
[0084] To make the objectives, technical solutions and effects of the present invention clearer and more explicit, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific examples described herein are only for explaining the present invention and are not intended to limit the present invention.
[0085] Those skilled in the art should understand that the foregoing general description and the following detailed description are exemplary and illustrative specific embodiments of the present invention and are not intended to limit the present invention.
[0086] As used herein, the term "comprising", "including" or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process or method comprising a list of steps does not include only those steps but may include other steps not expressly listed or inherent to such process or method. Throughout the specification, the appearances of the phrases "in one embodiment", "in another embodiment" and similar language may, but do not necessarily, all refer to the same embodiment.
[0087] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0088] Please refer to Figure 1 , the present invention provides a method for compressing neural data, including:
[0089] S1. Preprocess the neural data to distribute the codes of the neural data to zero; the neural data contains several superimposed components, such as compound action potential (CAP), neural spike (NS), and local field potential (LFP), which exhibit different temporal and spectral characteristics. To ensure accurate neural decoding, these characteristics must be retained through lossless compression.
[0090] After a large amount of neural data is generated by a neural interface device, the first step is to preprocess this data, aiming to distribute its codes to zero. This is beneficial for subsequent operations, distributing the data to a range centered around zero, enabling subsequent model processing (such as autoregressive models) to operate within a relatively unified numerical range and reducing the computational complexity caused by the overly large numerical range of the data. At the same time, it can improve data stability: distributing the codes of the neural data to zero can, to a certain extent, reduce the noise impact in the data, making the data more stable and facilitating the extraction of the essential characteristics of the data.
[0091] The specific operation of distributing the code of the neural data to zero can be to perform a certain normalization operation on the original neural data to achieve a coding distribution centered around zero for the code of the neural data. For example, assuming that the neural data encodes information in terms of the amplitude and frequency of electrical signals, we can adjust the numerical values of these signals through a specific algorithm so that a certain statistic (such as the mean or median) of them approaches zero.
[0092] S2. Reshape the code distribution of the neural data using an autoregressive model; an autoregressive model is a model that can capture the internal dependencies within a data sequence. In this step, the preprocessed neural data is input into the autoregressive model, which can uncover the potential sequential patterns in the neural data and improve the compressibility of the data. For the neural data processed by the autoregressive model, the redundant information within it may be better organized, which is more conducive to subsequent compression operations. Additionally, since neural data often has time series characteristics, the autoregressive model can well adapt to this feature and adjust the data distribution to better reflect the internal logical relationships of the data.
[0093] In a preferred embodiment, the autoregressive model can be based on a neural network, such as a Long Short-Term Memory (LSTM) network or a Gated Recurrent Unit (GRU), etc.
[0094] S3. Perform entropy coding operation on the reshaped neural data to obtain compressed data. Specifically, the advantage of the entropy coding operation is that it can compress the data to the maximum extent without losing data information. For the large amount of data generated by the neural interface device, effective compression can reduce the bandwidth requirements for data transmission and storage costs, and at the same time improve the efficiency of data transmission and processing.
[0095] In this embodiment, the compression steps for neural data include: data screening, reshaping and coding, and entropy coding. The following beneficial effects can be brought:
[0096] 1. Improved data stability: The preprocessing operation (such as distributing the code to zero) can reduce the influence of noise in the data to a certain extent, making the data more stable and conducive to uncovering the essential features of the data.
[0097] 2. Enhanced data transmission efficiency: Through preprocessing and entropy coding, the storage space and transmission bandwidth requirements of the data can be significantly reduced. This is particularly important for neural interface devices that generate a large amount of data, whether for local storage or transmission to the host through the network, and has obvious advantages;
[0098] 3. Data Feature Extraction: The autoregressive model can mine the potential sequential patterns in neural data, improve the compressibility of the data, and additionally reshape the code distribution of neural data through the autoregressive model to enhance the security of neural data. For the data processed by the autoregressive model, the internal redundant information may be better organized, which is more conducive to subsequent compression operations.
[0099] 4. Data Integrity Preservation: Entropy coding is a lossless compression technique that can compress data to the maximum extent without losing data information. This ensures that when the host performs subsequent processing, the original information of the data can be accurately restored, ensuring the accuracy of analysis and processing;
[0100] 5. Data Privacy Protection: In some cases, data compression can process data without exposing the original data, which helps to protect data privacy. For example, in some neural interface applications that require protecting user privacy, the compressed data can be transmitted and analyzed without revealing sensitive information.
[0101] 6. Data Processing Efficiency Improvement: By preprocessing and compressing neural data, the computational amount of data processing can be reduced, and the data processing efficiency can be improved. This is particularly important for application scenarios of neural interface devices with high real-time requirements (such as brain-computer interfaces).
[0102] As a preferred solution, in this embodiment, the preprocessing includes:
[0103] Processing the neural data using one or more filtering units; the filtering unit includes a downsampling unit, an anti-aliasing filtering unit, and a notch filter. In this embodiment, one or more filters can be combined and applied to neural data. Further, if some data in the neural data is important, the anti-aliasing filtering unit and the downsampling unit can be used to reduce the data rate. For example, in practical applications, a neural signal sampled at 10 kHz is downsampled to 5 kHz. Next, a notch filter is used to remove unwanted components, such as DC offset (0 Hz), chopping frequency (half of the sampling frequency), and power line interference (50 or 60 Hz). These filters merge the code distribution of the data to zero, thereby increasing the compression rate in the subsequent stage.
[0104] As a preferred solution, in this embodiment, the filter is preferably a digital filter. When multiple digital filters are used for preprocessing, the digital filters of direct form I or II can be used to execute. Further, all digital filters can be combined into a single filtering operation, and the coefficients of multiple digital filters can be combined. For example, when preprocessing with two digital filters, the digital filters are implemented using direct form II:
[0105] The first is an nth-order filter, which requires two sets of coefficients a_1[1, 2, …, n] and b_2[0, 1, 2, …, n].
[0106] The second mth-order filter requires two sets of coefficients a_2[1, 2, …, m] and b_2[0, 1, 2, …, m].
[0107] In this embodiment, these coefficients can be used to combine these two independent digital filters into a (n + m)th-order filter:
[0108] a = a_1 * a_2;
[0109] b = b_1 * b_2;
[0110] where * is the convolution operation.
[0111] Please refer to Figure 2 , as a preferred solution, in this embodiment, the neural data includes multiple channel sub-data obtained from multiple data channels; before reshaping the code distribution of the neural data using the autoregressive model, the following is also performed:
[0112] S1’: Perform a cross-channel transformation operation on the neural data to reduce the dependence between multiple channel sub-data.
[0113] That is, in this embodiment, the neural data compression method includes four steps: data preprocessing, cross-channel transformation, code reshaping, and entropy encoding. After adding the cross-channel transformation operation, the interference between multiple channel sub-data in the neural data will be greatly reduced, and at the same time, the data volume and data complexity can also be further reduced. When the dependence between multiple channel sub-data is reduced, each channel sub-data can more independently reflect a certain aspect of the neural information. This helps to more accurately analyze the specific neural signal characteristics carried by each channel. For example, when studying the neural activities in different regions of the brain, different channels correspond to different brain regions. If the dependence of the channel sub-data is reduced, the neural activity patterns of each brain region itself can be more clearly understood without being interfered by the signals of other brain regions.
[0114] Furthermore, after processing the neural data through the cross-channel transformation operation, when using the autoregressive model to process the neural data subsequently, reducing the dependence between channel sub-data can improve the training and processing efficiency of the model. For the autoregressive model, the reduction of the dependence between channel sub-data means that the features of the input data are more independent. The model can more easily learn the rules of each channel sub-data, reduce the complexity of model training, and improve the convergence speed. For classification models (such as support vector machines, neural network classifiers, etc.), the channel sub-data with enhanced independence can provide clearer classification features, improving the accuracy and efficiency of classification.
[0115] In addition, when performing data compression operations, channel sub-data with low dependencies are more easily compressed separately. For example, during entropy encoding, if the dependencies between channel sub-data are strong, their joint probability distribution will be relatively complex and difficult to compress efficiently. When the dependencies are reduced, each channel sub-data can be more effectively entropy encoded according to its own probability distribution, thereby increasing the overall data compression ratio.
[0116] As a preferred solution, in this embodiment, when a predetermined situation exists among multiple channel sub-data, before performing the cross-channel transformation operation, the following is also performed:
[0117] Determine whether a predetermined situation exists among multiple channel sub-data. If so, perform the cross-channel transformation operation; otherwise, do not perform the cross-channel transformation operation. The predetermined situation includes a highly correlated situation and an artifact situation.
[0118] Furthermore, in order to process neural data more flexibly, when there is no predetermined situation among multiple channel sub-data, the cross-channel transformation operation is not performed. The method for determining whether there is a predetermined situation can be through data correlation detection (using common detection means in the art), or the user can perform correlation selection in advance. For example, the user can select two modes of high correlation and low correlation to correspond to different compression processes.
[0119] As a preferred solution, in this embodiment, the cross-channel transformation operation is completed using the cross-channel formula, and the cross-channel formula is as follows:
[0120] x′1 = (x1 + x2 + … + x n ) / n;
[0121] x′2 = (x1 - x2) / 2;
[0122] …
[0123] x′ n = (x n-1 - x n ) / 2;
[0124] Where {x1, x2, …, x n} is the data before transformation; {x′1, x′2, …, x′ n} is the data after transformation. Specifically, in the transformed data {x′1, x′2, …, x′ n}, x′1 captures the common signal, and the remaining terms capture the differential signal.
[0125] As a preferred solution, in this embodiment, reshaping the code distribution of the neural data using an autoregressive model specifically includes:
[0126] For each of the channel sub - data in the neural data, an autoregressive transformation formula is used for processing to achieve reshaping of the neural data; the autoregressive transformation formula is:
[0127]
[0128] where a k is the autoregressive coefficient; x[m] is the data before reshaping; x′[M] is the data after reshaping; N AR is the order of the autoregressive model.
[0129] As a preferred solution, in this embodiment, the autoregressive coefficient is fixedly set or obtained by the host computer sending it according to a predetermined period.
[0130] In some embodiments, the autoregressive coefficient is fixedly set in the neural data acquisition device and the host computer. At this time, the autoregressive coefficient does not change. At this time, the autoregressive model uses a set of default autoregressive coefficients, and these autoregressive coefficients are pre - calculated based on past neural data recorded by the same device under similar configurations.
[0131] In some embodiments, the autoregressive coefficient is adaptive. At this time, in order to optimize the compression ratio, the host computer can recalculate the autoregressive coefficient at regular intervals based on the received data during operation, and then, the updated coefficient will be sent back to the device and can be adjusted separately for each channel. Since the computing resources of the neural data acquisition device are limited, it does not calculate the coefficient itself. This adaptive method allows the compression pipeline to respond to changes in data characteristics with a minimum device processing load.
[0132] Please refer to Figure 5 , which shows the compression ratio results obtained by processing different data using different autoregressive model orders based on the neural data compression method provided by the present invention. The number of orders ranges from 2 to 8. A historical sample data set was used during the evaluation. These data sets were obtained from different experimental devices, electrode types, and recording configurations, and the neural data compression method provided by the present invention was used to process all data sets separately. Among them, data set 1 is the peripheral nerve data of an amputee recorded using in - bundle microelectrodes; data set 2 is the peripheral nerve and EMG data recorded from the wrist of a healthy participant using surface electrodes; data set 3 is the neural signals of a Parkinson's disease patient recorded using a deep - brain stimulation (DBS) probe during active stimulation. The results show that the proposed method always achieves a compression ratio between 3 and 5.
[0133] As a preferred solution, in this embodiment, the entropy coding includes Huffman coding, arithmetic coding, and asymmetric digital coding. Further, the entropy coding is preferably Huffman coding.
[0134] The last step of the compression method provided by the present invention is an entropy encoding operation to achieve data compression. It can be efficiently implemented on a microcontroller. Although the entropy encoding operation is the only step to achieve data reduction, the effectiveness of compression depends to a large extent on the code distribution of the data. The previous preprocessing operation, cross-channel transformation operation, and autoregressive model processing step will process or reshape the code distribution of the neural data to ensure the achievement of a high compression ratio.
[0135] Table 1 shows the comparison of the compression ratios between the neural data compression method provided by the present invention and existing lossless compression schemes (including BZIP2, LZMA, Deflate, and PPMD). Each data set uses its own optimized set of autoregressive coefficients and Huffman dictionary. The proposed method achieves a compression ratio between 3.7 and 4.4, which is better than all other schemes. This excellent performance highlights the advantages of this method because it is specifically optimized for neural data, which is different from other algorithms designed for general data types.
[0136]
[0137] Table 1. Comparison results of the compression ratio between the neural data compression method provided by the present invention and existing lossless compression schemes
[0138] Please refer to Figure 3 , which shows how the code distribution evolves after each step, Figure 4 shows the bit length assigned to each code in the Huffman dictionary. Although the preprocessing operation, cross-channel transformation operation, and autoregressive model processing step do not produce any compression results, they fundamentally reshape the data code distribution, gradually concentrating the code distribution at each stage to zero. The more concentrated the distribution, the higher the compression ratio that can be achieved in the last step of Huffman encoding (Huffman encoding is used as the entropy encoding in this embodiment). The Huffman dictionary is pre-estimated based on the previous data sets recorded by the same neural interface device with the same configuration. During the entire normal operation, this dictionary remains fixed on the host computer and the neural data acquisition device.
[0139] The neural data compression method provided by the present invention has significant advantages in processing neural signal data. The autoregressive model is used for predictive coding, and the autoregressive coefficients are recalculated regularly to adapt to the dynamic characteristics of neural signals, thereby ensuring that the compression efficiency can be continuously maintained. In terms of compression effect, a compression ratio between 3.7 and 4.4 is achieved, which reflects that the method performs well in compressing neural data. For example, the initial data rate of the original neural data is 3.8 million bits per second (3.8 Mbps). This rate cannot be transmitted via low-power Bluetooth because it is higher than the maximum throughput of low-power Bluetooth, which is 1.4 million bits per second (1.4 Mbps). After being processed by the neural data compression method provided by the present invention, the data rate of the original neural data becomes 3.8÷4 (taking the compression ratio of 4 as an example) = 0.95 Mbps, and thus it can be transmitted using low-power Bluetooth.
[0140] The following table shows the results of the computational complexity and storage complexity of each step in the neural data compression method provided by the present invention.
[0141] Phase Step Name Computational Complexity Storage Complexity 1 Data Filtering <![CDATA[O(N F )]]> <![CDATA[O(N F ·N CH )]]> 2 Cross-Channel Transformation <![CDATA[O(N CH )]]> <![CDATA[O(N CH )]]> 3 Predictive Coding of Autoregressive Model <![CDATA[O(N AR )]]> <![CDATA[O(N AR ·N CH )]]> 4 Huffman Coding <![CDATA[O(log N C )]]> <![CDATA[O(N C )]]>
[0142] Table 2. Results of the computational complexity and storage complexity of each step in the neural data compression method
[0143] Among them, O(*) is the computational complexity; N F is the order of the filter, with a preferred value of 4 - 8; N CH is the channel number, with a preferred value of 16 - 32; N AR is the order of the AR model, with a preferred value of 3 - 10; N C is the number of different codes, with a preferred value of 2 8 -2 12 . It can be seen from Table 2 that the compression method provided by the present invention has a relatively small computational complexity and can run on a microcontroller.
[0144] Table 2 summarizes the complexity associated with each stage of the proposed compression scheme. This highlights several advantages of the method proposed by the present invention for neural data transmission:
[0145] 1. Computationally friendly: Each step of the pipeline is designed to be computationally efficient, allowing implementation on a low-power microcontroller with linear time complexity or faster.
[0146] 2. Memory efficient: Each step only requires storage of a few past samples at most, making the method suitable for low-power microcontrollers, which typically have less than 1 MB of RAM.
[0147] 3. Low latency: The input data is processed, transmitted, and received sample by sample without waiting for long sequences of data. This is crucial for real-time neural decoding applications, ensuring minimal latency from data acquisition to the interpretation by the neural decoder.
[0148] Meanwhile, the neural data compression method provided by the present invention has low computational complexity and memory requirements and can be implemented on low-power microcontrollers. In the prototype neural interface verification phase, the NRF52840 system-on-chip (SoC) is used. This chip acquires data from 16 neural data channels at a sampling rate of 10 kHz and then streams the data to the host computer through a BLE 5.2 data link. During this transmission process, the neural data acquisition system can maintain a compression ratio of 3.5 and a data throughput of 220 kbps, thereby achieving real-time and lossless transmission of neural signals with minimal latency.
[0149] The neural data compression method provided by the present invention is of great significance for neural prosthesis control, especially providing strong support for the development of wireless peripheral neural interfaces. Through Bluetooth Low Energy (BLE) technology, reliable real-time data transmission can be ensured between the neural interface and the neural decoder, which lays a solid foundation for the precise control of neural prostheses and has broad application prospects in the fields of neuroscience research and neural prosthesis applications.
[0150] Correspondingly, please refer to Figure 6 , the present invention also provides a neural data decompression method, including:
[0151] Performing entropy coding decoding operation on the compressed data to obtain pre-decoded data;
[0152] Decoding the pre-decoded data using an autoregressive model to obtain neural data.
[0153] Specifically, contrary to the neural data compression steps, after receiving the compressed data, the host computer uses the same dictionary (the coding dictionary corresponding to entropy coding) to decode the compressed data back to the original data. Next, an autoregressive model with the same autoregressive coefficients is applied for reverse processing to decode and obtain neural data.
[0154] Of course, in some embodiments, the autoregressive coefficients used in the autoregressive model in the neural data decompression method are recalculated and generated once at regular intervals. After generating new autoregressive coefficients, the host computer will keep the autoregressive coefficients between the host computer and the neural data acquisition device unified through data transmission.
[0155] As a preferred solution, in this embodiment, the neural data includes multiple channel sub-data obtained from multiple data channels;
[0156] After obtaining the aforementioned neural data, an inverse cross-channel transformation operation is also performed to obtain the original neural data; the inverse cross-channel transformation operation is completed using the inverse transformation formula, and the inverse transformation formula is as follows:
[0157]
[0158] x2 = x1 - 2x′2;
[0159] …
[0160] x n = x n-1 - 2x′ n ;
[0161] wherein, {x1, x2, …, x n} is the data after inverse transformation; {x′1, x′2, …, x′ n} is the data before inverse transformation
[0162] As a preferred solution, in this embodiment, before performing the inverse cross-channel transformation operation, it further includes:
[0163] Determine whether there is a predetermined situation among multiple pieces of the channel sub-data. If so, perform the inverse cross-channel transformation operation; otherwise, do not perform the cross-channel transformation operation; the predetermined situation includes a highly correlated situation and an artifact situation.
[0164] In this example, it is possible to determine whether the transmitted data has undergone a cross-channel transformation operation by a data identifier sent by the neural data acquisition device, greatly reducing the processing complexity of the determination step.
[0165] Specifically, in view of the fact that in the neural data compression step, unnecessary components have been removed from the neural data using a filter, the neural data decompression process provided by the present invention does not include a filtering step, reducing the decompression step and improving the processing efficiency.
[0166] Correspondingly, please refer to Figure 7 , the present invention also provides a neural data sending method, which is applied to a neural data detection device and includes:
[0167] Compress the obtained neural data using the neural data compression method described in any of the embodiments to obtain compressed data corresponding to the neural data;
[0168] Truncate the compressed data into bytes with a predetermined number of digits and transmit it wirelessly to the host computer. For example, the generated compressed data stream (such as bitstream data) is truncated into 8-bit bytes and transmitted wirelessly to the host computer.
[0169] Please refer to Figure 8, As a preferred solution, in this embodiment, after obtaining the compressed data, the compressed data is stored in a buffer; to prevent data loss during real-time transmission due to changes in the compression ratio.
[0170] Before processing the neural data, it further includes:
[0171] When the operating state of the device is in the low-latency mode, if the amount of data in the buffer does not exceed the latency threshold, the data compression operation is normally executed, otherwise one sample data in the buffer is deleted. Here, one sample data is the compressed data of the neural data processed at one time point.
[0172] Of course, in some embodiments, when the device is in the low-latency mode, if the amount of data in the buffer exceeds the latency threshold, the compression process of new neural data is no longer processed.
[0173] Low-latency mode: The recommended pipeline can operate in normal or low-latency mode. During the data stream, a BLE connection interruption may temporarily reduce the data throughput. Figure 8 The shown low-latency mode is designed for time-sensitive applications. For example, when a user controls a neural prosthesis in real time, if there is a data backlog in the buffer, it may cause a lag in data transmission in the rehabilitation control. At this time, in some embodiments, the data load in the buffer is continuously monitored. If the data in the buffer exceeds the latency threshold, the data samples of all channels are deleted. Until the BLE connection is restored and the buffer load returns to an acceptable level.
[0174] In the normal mode, a larger output data buffer is used to prevent data loss, making this mode suitable for non-time-sensitive applications, such as collecting training data.
[0175] Correspondingly, please refer to Figure 9 , The present invention also provides a neural data receiving method, which is applied to a host computer and includes:
[0176] Receiving compressed data wirelessly;
[0177] Decoding the compressed data by using the neural data decompression method described in any of the embodiments to obtain neural data.
[0178] Correspondingly, please refer to Figures 10 - 11 , The present invention also provides a neural data acquisition system, including:
[0179] A neural data acquisition device that executes the neural data sending method described in any of the above embodiments;
[0180] The host computer executes the neural data receiving method described in any of the above embodiments. Every predetermined time, the host computer recalculates the autoregressive coefficients using the latest data and transmits the updated autoregressive coefficients to the neural data acquisition device wirelessly. After receiving the new autoregressive coefficients, the neural data acquisition device deletes the old coefficients and updates them to the received autoregressive coefficients.
[0181] Preferably, the host computer is a host device, such as a PC (personal computer), a mobile intelligent device, etc.
[0182] Figure 11 The overall architecture of the system is illustrated. The neural data acquisition device has two Neuronix neural recording chips, generating a total of 16 data channels at a sampling rate of 10 kHz and a resolution of 12 bits. The NRF52840 SoC (System on Chip) can implement the data compression method proposed in the present invention and maintain the smoothness of the BLE 5.2 data link, including an ARM Cortex-M4 microprocessor with an operating frequency of 64 MHz and 250 kB RAM. The compressed data will be transmitted to a receiver with the same SoC configuration. The receiver hardware consists of an NRF5290 USB dongle, which performs data decompression and then sends the uncompressed data to a computer for neural decoding through a USB data link.
[0183] Please refer to Figure 12 Shows the real-time compression ratio, calculated once per second for a 7-minute neural data sample. The compression ratio stabilizes at around 3.5, with the smallest fluctuations, and the data throughput is 220 kbps. This setting provides a large data throughput overhead (up to 1.4 Mbps) to ensure reliable performance, even in the case of connection interruptions during actual experiments.
[0184] Figure 13 Shows the runtime allocation of the compression and decompression processes on the NRF52840 SoC. On the neural data acquisition device side, compression accounts for 60% of the runtime, while on the host computer side, decompression accounts for 38%. Packets are compressed every 2 ms, which is consistent with the data transmission between the neural chip and the microcontroller. Packets received every 50 ms are decompressed, which matches the BLE connection interval. It can be seen that the data compression method provided by the present invention can run smoothly on the microcontroller.
[0185] Correspondingly, the present invention also provides an electronic device, including:
[0186] A memory storing a computer program;
[0187] A processor, when executing the computer program, implements the neural data compression method described in any embodiment, or implements the neural data decompression method described in any embodiment, or implements the neural data sending method described in any embodiment, or implements the neural data receiving method described above.
[0188] Correspondingly, the present invention further provides an electronic device, preferably a computer-readable medium, storing a computer program, which, when executed by a processor, implements the neural data compression method described in any embodiment, or implements the neural data decompression method described in any embodiment, or implements the neural data sending method described in any embodiment, or implements the neural data receiving method described in any embodiment.
[0189] More specific examples of the computer-readable storage medium may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0190] In the present application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present application, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
[0191] It can be understood that for those of ordinary skill in the art, equivalent substitutions or changes can be made according to the technical solutions of the present invention and its inventive concept, and all such changes or substitutions should fall within the protection scope of the appended claims of the present invention.
Claims
1. A neural data compression method, characterized in that: include: preprocessing the neural data to distribute the codes of the neural data to zero; reshape the code distribution of the neural data using an autoregressive model; The reshaped neural data is subjected to entropy coding operation to obtain compressed data.
2. The neural data compression method according to claim 1, characterized in that: The pre-processing comprises: One or more filtering units are used to process the neural data; the filtering units include a downsampling unit, an anti-aliasing filtering unit, and a notch filter.
3. The neural data compression method according to claim 1, characterized in that: The neural data includes a plurality of channel sub-data obtained from a plurality of data channels; before reshaping the code distribution of the neural data using the autoregressive model, further executing: A cross-channel transformation operation is performed on the neural data to reduce dependencies between the plurality of channel sub-data.
4. The neural data compression method according to claim 3, characterized in that: Before performing the cross-channel transformation operation, the following is also performed: Determine whether a predetermined situation exists between the plurality of channel sub-data, if so, perform the cross-channel transformation operation, otherwise, do not perform the cross-channel transformation operation; the predetermined situation includes a highly correlated situation and an artifact situation.
5. The neural data compression method according to claim 3, characterized in that: The cross-channel transformation operation is performed using a cross-channel formula, which is as follows: x1 ′ =(x1+x2+…+x n ) / n; x ′ 2=(x1-x2) / 2; … x ′ n =(x n-1 -x n ) / 2; Among them, {x1,x2,…,x n } is the data before conversion; {x1 ′ ,x ′ 2,…,x ′ n } is the converted data.
6. The neural data compression method according to claim 3, characterized in that: The code distribution for reshaping the neural data using the autoregressive model specifically includes: Each of the channel sub-data in the neural data is processed using an autoregressive transformation formula to achieve neural data reshaping; the autoregressive transformation formula is: Among them, a k is the autoregressive coefficient; x[m] is the data before reshaping; x ′ [m] is the reshaped data; N AR is the order of the autoregressive model.
7. The neural data compression method according to claim 6, characterized in that: The autoregressive coefficient is fixedly set or obtained by being sent by a host computer according to a predetermined period.
8. The neural data compression method according to claim 1, characterized in that: The entropy coding includes Huffman coding, arithmetic coding, and asymmetric digital coding.
9. A neural data decompression method, characterized in that: include: The compressed data is decoded based on entropy coding to obtain pre-decoded data; The pre-decoded data is decoded using an autoregressive model to obtain neural data.
10. The neural data decompression method according to claim 9, characterized in that: The neural data includes a plurality of channel sub-data obtained from a plurality of data channels; After obtaining the neural data, an inverse cross-channel transformation operation is performed to obtain the original neural data; the inverse cross-channel transformation operation is performed using an inverse transformation formula, and the inverse transformation formula is as follows: x2=x1-2x ′ 2; … x n =x n-1 -2x ′ n ; Among them, {x1,x2,…,x n } is the data after inverse transformation; {x1 ′ ,x ′ 2,…,x ′ n } is the data before inverse transformation.
11. The neural data decompression method according to claim 10, characterized in that: Before performing the inverse cross-channel transformation operation, the method further includes: Determine whether a predetermined situation exists between the plurality of channel sub-data, if so, perform the inverse cross-channel transformation operation, otherwise, do not perform the cross-channel transformation operation; the predetermined situation includes a highly correlated situation and an artifact situation.
12. A neural data transmission method, characterized in that: Applied to neural data detection equipment, including: Compressing the obtained neural data using the neural data compression method according to claim 1 to obtain compressed data corresponding to the neural data; The compressed data is truncated into bytes of a predetermined number of bits and transmitted to a host computer via wireless means.
13. The neural data transmission method according to claim 12, characterized in that: After obtaining the compressed data, storing the compressed data in a buffer; Before processing the neural data, the method further includes: When the device is running in low latency mode, if the amount of data in the buffer does not exceed the latency threshold, the data compression operation is performed normally, otherwise a sample data in the buffer is deleted.
14. A neural data receiving method, characterized in that: Applied to the host computer, including: receiving compressed data wirelessly; The neural data decompression method according to claim 9 is used to decode the compressed data to obtain neural data.
15. A neural data acquisition system, characterized in that: include: A neural data acquisition device, which executes the neural data sending method according to claim 12; The host computer executes the neural data receiving method described in claim 14.
16. An electronic device, characterized in that: include: a memory storing a computer program; A processor, when executing the computer program, implements the neural data compression method described in any one of claims 1-8, or implements the neural data decompression method described in any one of claims 9-11, or implements the neural data sending method described in any one of claims 12-13, or implements the neural data receiving method described in claim 14.
17. An electronic device, characterized in that: A computer program is stored, and when the computer program is executed by a processor, it actually implements the neural data compression method described in any one of claims 1-8, or the neural data decompression method described in any one of claims 9-11, or the neural data sending method described in any one of claims 12-13, or the neural data receiving method described in claim 14.
Citation Information
Cited By
Methods, system and electronic device for neural data compression, decompression, transmission and reception
EP4807996A1