Encoding method, decoding method, encoding apparatus and decoding apparatus
By encoding, quantizing and indexing the pulse signal, sending vector index, combined with the convolutional neural network and competitive learning mechanism, the problem of pulse signal transmission efficiency and accuracy in high-throughput and low-bandwidth scenarios is solved, and efficient pulse signal is achieved Transmission and reconstruction.
Patent Information
- Application Number
- PCT/CN2024/083339
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-31
- Filing Date
- 2024-03-22
- Publication Date
- 2024-10-03
AI Technical Summary
In high-throughput and low-bandwidth scenarios, invasive brain-computer interface chips are difficult to effectively transmit pulse signals, making it difficult to meet processing accuracy and real-time requirements. In particular, the transmission efficiency and storage requirements of pulse signals are particularly challenging.
The pulse signal is encoded, quantized and indexed through the encoding method to obtain the vector index and sent to the decoding device to reduce the amount of transmitted data. The convolutional neural network and competitive learning mechanism are used for feature extraction and quantification to remove motion artifacts. trace to achieve lossless encoding and decoding.
It effectively reduces the amount of data transmitted by pulse signals, improves transmission efficiency, removes motion artifacts, meets the requirements for pulse signal transmission in high-throughput and low-bandwidth scenarios, and improves the accuracy and compression rate of reconstructed signals.
Smart Images

Figure CN2024083339_03102024_PF_FP_ABST
Abstract
Description
Coding method, decoding method, coding device, and decoding device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 31, 2023, with application number 202310377873.3 and application name “Encoding method, decoding method, encoding device and decoding device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of chip technology, and in particular to an encoding method, a decoding method, an encoding device, and a decoding device. Background Art
[0003] Brain-computer interface technology can be categorized into two main approaches, invasive and non-invasive, based on the degree of motor implantation. Among these, the most widely used invasive signal is the spike signal, which features high spatiotemporal precision, weak amplitude, and sparse temporal and spatial emission. The pulse signal waveform typically lasts 1-2 milliseconds and contains rich physiological and pathological information, making it of great significance for scientific and clinical research.
[0004] However, invasive brain-computer interface chips have very high requirements for power consumption and area. As brain-computer interface technology develops towards high throughput, high precision, high sampling rate, wireless transmission and wireless charging, among which, thousand-level channels can generate 10-100G bits per second (bps) pulse signals per second. A large number of pulse signals are difficult to transmit through limited wireless bandwidth (<5Mbps). As a result, the accuracy, real-time performance and storage requirements of pulse signal processing are greatly challenged, especially the problem of pulse signal transmission in high-throughput and low-bandwidth scenarios still needs to be solved.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide an encoding method, a decoding method, an encoding device, and a decoding device, which reduce the amount of data transmitted by pulse signals in high-throughput and low-bandwidth scenarios.
[0007] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions.
[0008] In a first aspect, an embodiment of the present application provides an encoding method, which includes: obtaining a first pulse signal; encoding the first pulse signal to obtain a latent variable; quantizing the latent variable, and index encoding the quantized latent variable to obtain a vector index of the first pulse signal, the vector index being used by a decoding device to reconstruct the first pulse signal in combination with the latent variable; and sending the vector index to the decoding device.
[0009] Thus, in the encoding method provided in the embodiments of the present application, the first pulse signal is encoded, quantized, and indexed to obtain a vector index for the first pulse signal, which is then sent to a decoding device. Compared to directly transmitting the first pulse signal in the prior art, encoding and quantizing the first pulse signal reduces the amount of data required to be transmitted to the decoding device. Furthermore, since the vector index is transmitted to the decoding device, the amount of data required to be transmitted to the decoding device can be further reduced, solving the problem of pulse signal transmission in high-throughput, low-bandwidth scenarios.
[0010] In one possible design, before sending the vector index to the decoding device, the method further includes: losslessly encoding the vector index.
[0011] In this design, the encoding device can directly transmit the original vector index to the decoding device, or it can perform entropy encoding on the vector index, further reducing the amount of data that needs to be transmitted from the encoding device to the decoding device.
[0012] In a possible design, the first pulse signal is an electroencephalogram signal.
[0013] In this design, the first pulse signal can be an invasive EEG signal collected by an invasive brain-computer interface chip. Collecting the EEG signal through built-in electrodes can improve the accuracy of EEG signal collection.
[0014] In one possible design, encoding the first pulse signal to obtain a latent variable includes: compressing the first pulse signal into a latent space based on a convolutional neural network to obtain a latent variable.
[0015] In this design, the encoding device can perform feature extraction on the first pulse signal based on the convolutional layer in the convolutional neural network to obtain continuous latent variables, and can further reduce the number of parameters.
[0016] In a possible design, quantifying the latent variables includes quantifying the latent variables based on a competitive learning mechanism.
[0017] In this design, the process of quantizing the latent variables by the encoding device can be understood as a discrete process, and multiple discrete quantized latent variables can be obtained.
[0018] In one possible design, before obtaining the first pulse signal, the method further includes: obtaining the first pulse signal based on a comparison result of spectrum energy corresponding to the second pulse signal and a preset threshold.
[0019] In this design, the noise in the second pulse signal can be removed by comparing the spectrum energy corresponding to the second pulse signal with a preset threshold.
[0020] In a second aspect, an embodiment of the present application provides a decoding method, which includes: receiving a vector index of a first pulse signal; determining a quantized latent variable corresponding to the vector index; and reconstructing the quantized latent variable to obtain a reconstructed pulse signal.
[0021] Therefore, after receiving the vector index, the vector index is combined with the corresponding latent variable to determine the latent variable corresponding to the vector index. The pulse waveform is then reconstructed based on the latent variable to obtain a reconstructed pulse signal, thereby completing the transmission of the pulse signal. In addition, during the training process of the original pulse waveform, motion artifacts were removed, so the reconstructed pulse signal does not contain motion artifacts.
[0022] In one possible design, after receiving the vector index of the first pulse signal, the method further includes: losslessly decoding the vector index.
[0023] In this design, if the vector index received by the decoding device is the same as the vector index losslessly encoded by the encoding device, the vector index needs to be losslessly decoded. Encoding the vector index through lossless encoding can avoid information loss and further reduce the amount of data that needs to be transmitted from the encoding device to the decoding device.
[0024] In one possible design, the quantized latent variables are reconstructed to obtain a reconstructed pulse signal, including: calculating a loss function corresponding to the quantized latent variables based on a convolutional neural network; and reconstructing the quantized latent variables based on the loss function to obtain a reconstructed pulse signal.
[0025] In this design, the reconstruction error of the reconstructed pulse signal can be reduced by reconstructing the quantized latent variables based on the loss function.
[0026] In a possible design, the first pulse signal and the reconstructed pulse signal are electroencephalogram (EEG) signals.
[0027] In this design, the first pulse signal is an invasive electroencephalogram signal collected by an invasive brain-computer interface chip, and the reconstructed pulse signal is a reconstructed first pulse signal that can be analyzed and processed.
[0028] In a third aspect, an embodiment of the present application provides an encoding device, which includes: an encoder and a compressed vector discretization circuit; an encoder for obtaining a first pulse signal; an encoder for encoding the first pulse signal to obtain a latent variable; a compressed vector discretization circuit for quantizing the latent variable and index encoding the quantized latent variable to obtain a vector index of the first pulse signal, and the vector index is used by a decoding device to reconstruct the first pulse signal in combination with the latent variable; the compressed vector discretization circuit is also used to send the vector index to the decoding device.
[0029] The beneficial effects of the third aspect can be found in the description of the first aspect.
[0030] In one possible design, the encoder is also used to losslessly encode the vector index.
[0031] In a possible design, the first pulse signal is an electroencephalogram signal.
[0032] In one possible design, the encoder is specifically used to compress the first pulse signal into a latent space based on a convolutional neural network to obtain a latent variable.
[0033] In one possible design, the compressed vector discretization circuit is specifically used to quantize latent variables based on a competitive learning mechanism.
[0034] In one possible design, the encoding device also includes a signal detection circuit; the signal detection circuit is used to obtain the first pulse signal based on a comparison result of the spectrum energy corresponding to the second pulse signal and a preset threshold.
[0035] In a fourth aspect, an embodiment of the present application provides a decoding device, which includes a decoder and a reconstruction circuit; the decoder is used to receive the vector index of the first pulse signal; the decoder is also used to determine the quantized latent variable corresponding to the vector index; the reconstruction circuit is used to reconstruct the quantized latent variable to obtain a reconstructed pulse signal.
[0036] The beneficial effects of the fourth aspect can be found in the description of the second aspect.
[0037] In one possible design, the decoder is also used to losslessly decode the vector index.
[0038] In one possible design, the reconstruction circuit is specifically used to: calculate the loss function corresponding to the quantized latent variable based on the convolutional neural network; reconstruct the quantized latent variable based on the loss function to obtain a reconstructed pulse signal.
[0039] In a possible design, the first pulse signal and the reconstructed pulse signal are electroencephalogram (EEG) signals.
[0040] In a fifth aspect, an embodiment of the present application further provides a coding device, comprising a processor and a memory, wherein the memory stores computer instructions, and the processor executes the coding method of the first aspect after executing the computer instructions.
[0041] In a sixth aspect, an embodiment of the present application further provides a decoding device, comprising a processor and a memory, wherein the memory stores computer instructions, and the processor executes the decoding method of the second aspect after executing the computer instructions.
[0042] In a seventh aspect, an embodiment of the present application provides an electronic device, comprising an antenna, one or more processors, and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, the computer program code comprising computer instructions. When the one or more processors execute the computer instructions, the electronic device performs the encoding method or decoding method of any of the above aspects and any possible implementations.
[0043] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the encoding method or decoding method in any of the above aspects and any possible implementation methods.
[0044] In a ninth aspect, an embodiment of the present application provides a computer program product, which, when running on a computer or processor, enables the computer or processor to execute the encoding method or decoding method in any of the above aspects and any possible implementation methods.
[0045] It can be understood that any of the encoding devices, decoding devices, computer-readable storage media or computer program products provided above can be applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods and will not be repeated here.
[0046] These and other aspects of the present application will become more readily apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] FIG1 is a schematic diagram of a system or device for applying an encoding device according to an embodiment of the present application;
[0048] FIG2 is a schematic diagram of the structure of a SoC provided in an embodiment of the present application;
[0049] FIG3 is a flow chart of an encoding method provided in an embodiment of the present application;
[0050] FIG4 is a waveform diagram of multiple quantized latent variables provided in an embodiment of the present application;
[0051] FIG5 is a module diagram of an encoding device provided in an embodiment of the present application;
[0052] FIG6 is a flowchart of a decoding method provided in an embodiment of the present application;
[0053] FIG7 is a comparison diagram of a first pulse signal and a reconstructed pulse signal provided in an embodiment of the present application;
[0054] FIG8 is a schematic diagram of an encoding process and a decoding process provided in an embodiment of the present application;
[0055] FIG9 is an architecture diagram of a latent variable quantization provided in an embodiment of the present application;
[0056] FIG10 is a diagram showing the effect of motion artifact noise reduction provided by an embodiment of the present application;
[0057] FIG11 is a schematic diagram of the composition of an encoding device provided in an embodiment of the present application;
[0058] FIG12 is a schematic diagram showing the composition of a decoding device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] For ease of understanding, some examples of concepts related to the embodiments of this application are provided for reference as follows:
[0060] Brain-computer interface technology is divided into two major directions according to the degree of electrode implantation: invasive and non-invasive. Among them, the signal-to-noise ratio of invasively collected information (such as pulse signals, local field potential (LFP) and electrocorticogram (ECoG), etc.) is high, but it causes a certain degree of damage to the human body. At this stage, it mainly involves the field of medical rehabilitation. Non-invasive signals (such as non-invasive electroencephalogram (EEG)) have a low signal-to-noise ratio and only need to be worn externally by the user. They are mainly used in physiological status assessment and regulation (such as attention, sleep and stress detection, etc.), human-computer interaction (such as disability assistance, virtual reality equipment (VR) and augmented reality equipment (AR), etc.) and sports and health scenarios.
[0061] Convolutional neural networks (CNN) are a type of feedforward neural networks (FNN) that include convolution calculations and have a deep structure. They are one of the representative algorithms of deep learning.
[0062] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0063] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
[0064] To process pulse signals for invasive brain-computer interfaces (BCIs), an on-chip signal processing solution for invasive BCIs has been proposed. This solution compresses the pulse signal into a pulse rate per unit time by performing analog-to-digital conversion, filtering, and waveform key point detection and matching, thereby enabling on-chip EEG signal processing with thousands of channels. However, this solution increases false negatives at high pulse rates and cannot achieve pulse waveform signal output in high-throughput, low-bandwidth scenarios.
[0065] In addition, the existing technology has also proposed a signal compression technology based on a latent variable model. In this technology, the original pulse signal is reduced to a latent space through latent variable waveforms such as principal component analysis (PCA), independent component analysis (ICA) and factor analysis (FA), and latent variable decomposition is performed in the latent space to achieve compression of the original pulse waveform signal. However, the latent variable model is a dimensionality reduction rather than a compression algorithm, and the compression ratio is limited, making it difficult to meet the wireless transmission bandwidth requirements of brain-computer interface chips. At the same time, the latent variables of the pulse signal do not meet the orthogonal, independent or Gaussian distribution assumptions of methods such as principal component analysis, independent component analysis and factor analysis, and cannot effectively characterize the pulse signal, resulting in low reconstruction accuracy.
[0066] In addition, the test environment of existing brain-computer interface technology is an ideal environment, usually under experimental conditions and the test subject remains in a static state, so it is impossible to effectively detect and reduce the motion artifacts caused by muscle movement and electrode offset in the running state, thereby affecting the performance of the decoding device and its promotion and application in real scenarios. Therefore, the existing technology proposes an empirical mode decomposition (EMD) technology. In this technology, for non-stationary time series signals such as EEG signals, the empirical mode decomposition technology can achieve the need for prior analysis and research, and adaptively decompose into intrinsic mode components (IMF) based on the EEG time series and frequency domain laws. Therefore, it can be used to detect and reduce the motion artifacts caused by muscle movement in the motion state. However, this technology is only for a single channel and is more suitable for continuous EEG signals such as brain flat electroencephalogram and non-invasive EEG or time series signals with obvious periodic emission rules. The noise reduction effect of motion artifacts of discrete and sparse signals such as pulse signals is poor.
[0067] Therefore, an embodiment of the present application provides an encoding method in which a vector index of a first pulse signal is transmitted to a decoding device. Compared to the prior art method of directly transmitting the first pulse signal to the decoding device, encoding and quantizing the first pulse signal reduces the amount of data required to be transmitted to the decoding device. Furthermore, since the vector index is transmitted to the decoding device, the amount of data required to be transmitted to the decoding device can be further reduced, thereby solving the problem of pulse signal transmission in high-throughput, low-bandwidth scenarios.
[0068] Corresponding to the encoding method, embodiments of the present application also provide a decoding method. In this decoding method, after receiving the vector index sent by the encoding device, the decoding device combines the vector index with the corresponding latent vector, determines the latent variable corresponding to the vector index, and then reconstructs the pulse waveform based on the latent variable to obtain a reconstructed pulse signal, thereby completing the transmission of the pulse signal. In addition, during the training process of the original pulse waveform, motion artifacts are removed, so the reconstructed pulse signal does not contain motion artifacts.
[0069] The above-mentioned encoding method and decoding method can be applied to different systems or devices. For example, the encoding method can be applied to an encoding device, and the decoding method can be applied to a decoding device. The encoding device can be a terminal device as shown in Figure 1, such as a mobile phone terminal, a tablet computer, a laptop computer, an augmented reality device, a virtual reality device, and a vehicle-mounted terminal, etc., or a server, etc. In addition, the decoding device can also be a terminal device, such as a mobile phone terminal, a tablet computer, a laptop computer, AR, VR, and a vehicle-mounted terminal, etc. The encoding device or the decoding device can be configured with an input / output (I / O) interface for data interaction with an external device. For example, a user can input data to the input / output interface through a client device. The input data may include: a first pulse signal in an embodiment of the present application, which may be data collected by the encoding device through a data acquisition device, or data in a database of the encoding device, or data from a client device.
[0070] In some embodiments, the encoding device for implementing the encoding method and the decoding device for implementing the decoding method provided in the embodiments of the present application can be a chip, which is a system-on-a-chip (SoC) 20. As shown in Figure 2, the system-on-chip 20 may include a processor 21 (the processor may be a single-core processor or a multi-core processor), a memory 22, and an I / O interface 23, etc. After the processor loads the data and application in the memory, it processes the data, such as the encoding and decoding processing in this application. For example, when the data is a first pulse signal, the first pulse signal can be encoded and quantized to obtain the quantized latent variable, and the vector index of the first pulse signal can be obtained based on the quantized latent variable.
[0071] The encoding method and decoding method provided in the embodiments of the present application can be applied to the processing of invasive EEG signals. The processing of invasive EEG signals can use a dedicated chip for invasive brain-computer interface, or general-purpose chips such as a central processing unit (CPU), a graphics processing unit (GPU), and a neural network processing unit (NPU), as well as brain-computer interface software.
[0072] In addition, the encoding method and decoding method provided in the embodiments of the present application are mainly used in fields that require invasive brain-computer interface chips for signal acquisition, and the main application scenarios are medical health (such as motion control, sensory reconstruction, emotion recognition and disease detection, etc.) and scientific research.
[0073] Applied to the above-mentioned apparatus or device, the encoding method provided in the embodiment of the present application is introduced below.
[0074] The embodiment of the present application provides an encoding method, as shown in Figure 3, which is a flow chart of an encoding method provided by the embodiment of the present application. The encoding method includes the following process.
[0075] Step 301: The encoding device obtains a first pulse signal.
[0076] Exemplarily, the first pulse signal is a signal continuously emitted at a certain voltage amplitude and a certain time interval, wherein the time interval between the pulse signals is a period, and the number of pulses generated within a unit time (eg, 1 s) is called a frequency.
[0077] It is understandable that the first pulse signal is a digital signal, which can be understood as a binary stream. In one embodiment, the first pulse signal is a signal with high throughput (thousand-level channels), high precision (12 bits to 16 bits) and high sampling rate (greater than 20kHz).
[0078] For example, the first pulse signal can be arranged by channel number and waveform length, where the channel number refers to the number of channels read by the encoding device in a single pass. In one example, the number of channels read in a single pass can be 8, and the waveform length can be 100. This can improve the encoding efficiency of the encoding device and allow for subsequent processing based on the correlation between the first pulse waveforms of different channels.
[0079] Step 302: The encoding device encodes the first pulse signal to obtain a latent variable.
[0080] Exemplarily, the encoding device may encode the first pulse signal based on an encoder. The process of encoding the first pulse signal by the encoder may be understood as a dimensionality reduction process, i.e., the encoder encodes the high-dimensional first pulse signal into a low-dimensional latent variable. The latent variable represents a characteristic of the first pulse signal. In one example, the latent variable may represent a waveform characteristic of the first pulse signal.
[0081] In one example, the first pulse signal can be encoded based on the principle of an auto-encoder, wherein the auto-encoder includes an encoder and a decoder, wherein the encoder encodes the high-dimensional first pulse signal into a low-dimensional latent variable, and the decoder can reconstruct or recover the reconstructed first pulse signal based on the low-dimensional latent variable.
[0082] Step 303: The encoding device quantizes the latent variable and performs index encoding on the quantized latent variable to obtain a vector index of the first pulse signal. The vector index is used by the decoding device to reconstruct the first pulse signal in combination with the latent variable.
[0083] Exemplarily, the encoding device can convert a continuous compression vector into a discrete compression vector, but at the same time, a quantization error will be introduced. Since the types and densities of ion channels corresponding to different types of neurons are different, and different types of ion channels have different dynamic characteristics, the pulse signal itself has natural variability, but the pulse signal has second-order smoothness, and a smoothing error will be introduced based on a smoothing prior. Therefore, the error of the encoding method provided in the embodiment of the present application is the sum of the quantization error and the smoothing error. Since the encoding device introduces a second-order smoothing constraint, the noise robustness and interpretability of the latent variable can be improved.
[0084] As shown in Figure 4, Figure 4 is a waveform diagram of multiple quantized latent variables provided in an embodiment of the present application. Figure 4 shows the waveforms of 8 quantized latent variables, such as (a) to (h) in Figure 4. A vector index can be generated for each quantized latent variable, for example, by using binary encoding starting from 0 according to the number of quantized latent variables. In one example, if there are 128 quantized latent variables, the vector index needs to be encoded using at least 7 bits of binary.
[0085] The quantized latent variables can be obtained during the algorithm training phase. If the input first pulse signal contains motion artifacts, the algorithm can reconstruct the pulse signal after de-noising the motion artifacts through training, thereby removing the motion artifacts. If the first pulse signal does not contain motion artifacts, the algorithm can reconstruct the pulse signal through training, further improving the compression rate.
[0086] Step 304: The encoding device sends the vector index to the decoding device.
[0087] Exemplarily, the encoding device can send the vector index to the decoding device via wireless Bluetooth or wireless fidelity (wifi), wherein, since the vector index reduces the amount of data transmitted by the pulse signal compared to the first pulse signal, the bandwidth requirement of the wireless transmission can be met.
[0088] In another implementation, the encoding device may also send the vector index to the decoding device via wired transmission.
[0089] Therefore, compared with the prior art of sending the encoded and quantized first pulse signal to the decoding device, the encoding method provided in the embodiment of the present application reduces the amount of data to be transmitted to the decoding device, and solves the problem of pulse signal transmission in high-throughput and low-bandwidth scenarios.
[0090] Optionally, before step 304, the encoding may further include: the encoding device performing lossless encoding on the vector index.
[0091] In one example, the encoding device can directly transmit the original vector index to the decoding device. In another example, the encoding device can also perform entropy coding on the vector index. Entropy coding is coding that does not lose any information during the encoding process according to the entropy principle. Entropy coding can include Shannon coding, Huffman coding, and arithmetic coding. By performing lossless coding on the vector index, the amount of data sent by the encoding device to the decoding device can be further reduced.
[0092] Optionally, the first pulse signal is an electroencephalogram signal.
[0093] For example, brain-computer interface technology detects the cortical electrical activity of the brain through data acquisition equipment, and then converts the collected electrical signals into signals that control external devices. Among them, there are two main ways for data acquisition equipment to collect data, one is the invasive electrode built-in method, and the other is the non-invasive electrode external method. The invasive brain-computer interface chip adopts the invasive electrode built-in method. The electrodes can be silicon-based electrodes and flexible electrodes. This method surgically implants the electrodes into the cerebral cortex of the test subject, directly contacting the cerebral cortex, so the EEG signals collected by this method are more accurate. In addition, the non-invasive electrode external method collects signals by wearing a device on the brain of the test subject. This method is simple to operate and low in cost, but the intensity of the collected EEG signals is very low, which is usually difficult to meet the requirements. It is necessary to use other devices to amplify and process the collected EEG signals.
[0094] Since EEG signals are generated by the combined action of multiple nerve cells, they have the following characteristics: (1) The signal strength is extremely low, the anti-interference ability is very weak, and it is easy to produce certain fluctuations in different environments. (2) EEG signals are nonlinear and non-stationary, and there are many types of EEG signals. (3) EEG signals are a synthetic wave. Therefore, collecting EEG signals through built-in electrodes can improve the accuracy of EEG signal collection.
[0095] In addition, when acquiring the first pulse signal, the subject may be in a stationary state or in a moving state.
[0096] Optionally, step 302 may include: the encoding device compresses the first pulse signal into a latent space based on a convolutional neural network to obtain a latent variable.
[0097] For example, the convolutional neural network can be a deep residual network (ResNet) architecture, or a combination of a deep residual network and inception, i.e., a ResNeXt architecture. The convolutional neural network can include an input layer, multiple convolutional layers, and a neural network layer.
[0098] In one example, the encoding device can perform feature extraction on the first pulse signal based on a convolutional layer, decomposing the first pulse signal into a compressed vector. To address on-chip power consumption and storage limitations, the group convolution architecture in a deep residual network is employed to effectively extract features of the first pulse signal through skip connections, resulting in continuous latent variables and further reducing the number of parameters.
[0099] The latent variables may be high-precision. Specifically, the latent variables may be represented by floating point (FP) 64 data.
[0100] Optionally, step 303 may include: the encoding device quantizes the latent variables based on a competitive learning mechanism.
[0101] Exemplary, competitive learning mechanisms can be methods such as vector quantization and self-organizing map (SOM). Among them, vector quantization divides the high-dimensional input space into several different regions, determines a central vector for each region as the center of the cluster, and the input vectors in the same region can be represented by the central vector, thereby forming a point set with each central vector as the cluster center. Self-organizing map is an important type of neural network based on unsupervised learning methods. The self-organizing map network classifies the input pattern set by finding the optimal reference vector set. The cluster center formed can be mapped to a curved surface or plane while keeping the topological structure unchanged. Self-organizing map can convert input signals of any dimension into one-dimensional or two-dimensional discrete mappings.
[0102] For example, the process of quantizing the latent variables by the encoding device can be understood as a discretization process, where the encoding device converts the continuous latent variables into multiple discrete quantized latent variables. In one example, assuming the number of continuous latent variables is 16, 128 discrete quantized latent variables can be obtained.
[0103] Optionally, before step 301, the method may include: the encoding device obtains the first pulse signal based on a comparison result of spectrum energy corresponding to the second pulse signal and a preset threshold.
[0104] Exemplarily, before encoding the first pulse signal, the noise signal in the second pulse signal should also be removed. In one example, the noise signal in the second pulse signal can be removed by adaptive threshold denoising. First, the second pulse signal is Fourier transformed to obtain a spectrum, and the spectrum energy of the second pulse signal is obtained based on the spectrum. Then, the spectrum energy is compared with a preset threshold. If the spectrum energy is greater than the preset threshold, the signal corresponding to the spectrum energy is retained to obtain the first pulse signal. If the spectrum energy is less than the preset threshold, the signal corresponding to the spectrum energy can be understood as noise, and the signal corresponding to the spectrum energy is removed. In addition, after the second pulse signal is denoised, the encoding device detects the pulse sending time point and extracts the corresponding waveform information to obtain the first pulse signal.
[0105] In addition, before denoising the second pulse signal, the second pulse signal may be filtered to remove other non-pulse signals such as the local field potential of the second pulse signal. The filtering method may be low-pass filtering, high-pass filtering, band-pass filtering, or other filtering methods, which are not limited in this application.
[0106] Based on the above description, the coding device of the coding method of the embodiment of the present application is introduced below. Specifically, a low-power invasive brain-computer interface dedicated chip with wireless transmission function is shown in Figure 5, wherein the invasive brain-computer interface dedicated chip includes an analog front end (AFE), a filter, a pulse signal detection circuit, an encoder, and a hidden vector quantization and index coding circuit. Among them, the invasive brain-computer interface chip collects EEG signals through a data acquisition device, the analog front end is used to convert the collected analog signal into a digital signal, the filter is used to perform bandpass filtering on the digital signal based on the pulse emission frequency (e.g., 300Hz-3000Hz), the pulse signal detection circuit is used to detect the pulse emission point based on an adaptive threshold, the encoder is used to perform feature extraction based on a convolutional layer and a skip connection, and a lightweight network structure design is designed for on-chip power consumption and storage restrictions, and the hidden vector quantization and index coding circuit is used to convert continuous hidden variables into discrete hidden variables by vector quantization, and index coding is performed on discrete hidden variables. After the EEG signal is processed on the dedicated invasive BCI chip, the index is transmitted to the decoder of the lower computer, thus completing the wireless transmission of the EEG signal. In one example, the encoder and latent vector quantization and index encoding modules in the invasive BCI chip can be implemented on-chip using logic circuits or digital signal processing modules.
[0107] Applied to the above-mentioned apparatus or device, the decoding method provided in the embodiment of the present application is introduced below.
[0108] The present invention provides a decoding method, as shown in Figure 6, which is a flowchart of a decoding method provided by the present invention. The decoding method includes the following process.
[0109] Step 601: A decoding device receives a vector index of a first pulse signal.
[0110] Exemplarily, the decoding device can receive the vector index sent by the encoding device via wireless Bluetooth or wireless fidelity. In one example, there is a correspondence between the vector index and the quantized latent variable, and this correspondence can be stored in a table. It is understood that the table is stored in both the decoding device and the encoding device.
[0111] Step 602: The decoding device determines the quantized latent variable corresponding to the vector index.
[0112] Exemplarily, the vector index and the quantized latent variable are combined, and the quantized latent variable corresponding to the vector index can be determined by looking up a table.
[0113] Step 603: The decoding device reconstructs the quantized latent variables to obtain a reconstructed pulse signal.
[0114] Exemplarily, as shown in FIG7 , FIG7 is a comparison diagram of a first pulse signal and a reconstructed pulse signal provided by an embodiment of the present application. FIG7 shows 12 comparison diagrams of the first pulse signal and the reconstructed pulse signal, such as (a) to (l) in FIG7 . As can be seen from FIG7 , the waveform of the reconstructed pulse signal is substantially the same as the waveform of the first pulse signal. Therefore, the reconstruction error of the reconstructed pulse signal obtained by the embodiment of the present application is low. Moreover, during the training process of the original pulse waveform, motion artifacts have been removed, and thus the reconstructed pulse signal does not contain motion artifacts.
[0115] In addition, combined with the encoding method, the overall error of the encoding method and decoding method provided by the embodiment of the present application is the sum of the quantization error, the smoothing error and the reconstruction error.
[0116] Optionally, before step 601, the decoding method may include: the decoding device performing lossless decoding on the vector index.
[0117] For example, if the vector index received by the decoding device is the original vector index, then there is no need to decode the vector index. If the vector index received by the decoding device is the vector index that was losslessly encoded by the encoding device, then the vector index needs to be losslessly decoded. Encoding the vector index using a lossless encoding method can avoid information loss and further reduce the amount of data that needs to be transmitted from the encoding device to the decoding device.
[0118] Optionally, step 603 may include: the decoding device calculates a loss function corresponding to the quantized latent variable based on a convolutional neural network, and reconstructs the quantized latent variable based on the loss function to obtain a reconstructed pulse signal.
[0119] Exemplarily, the convolutional neural network on the decoding device side may also be a deep residual network structure or a ResNeXt architecture. A loss function is used to indicate the degree of inconsistency between the reconstructed pulse signal and the first pulse signal. During the training phase, a loss function corresponding to the quantized latent variables can be obtained. Reconstructing the quantized latent variables based on the loss function can reduce the reconstruction error of the reconstructed pulse signal.
[0120] Optionally, the first pulse signal and the reconstructed pulse signal are electroencephalogram signals.
[0121] For example, the first pulse signal can be an invasive EEG signal collected by an invasive brain-computer interface chip. Collecting EEG signals through built-in electrodes can improve the accuracy of EEG signal acquisition. The reconstructed pulse signal is reconstructed based on the first pulse signal and is the first pulse signal that can be analyzed and processed.
[0122] Applied to the above-mentioned encoding method, decoding method, encoding device and decoding device, as shown in Figure 8, Figure 8 is a schematic diagram of an encoding process and a decoding process provided by an embodiment of the present application. Among them, the schematic diagram only shows part of the actions of the encoding device and part of the actions of the decoding device. At the encoding device end, the encoder encodes the first pulse signal to obtain a continuous latent variable, quantizes the continuous latent variable through a competitive learning mechanism, obtains the quantized latent variable, and sends the vector index to the decoding device. At the decoding device end, the vector index sent by the encoding device is received, the vector index and the quantized latent variable are combined, and the reconstructed pulse signal is obtained through the decoder. Thus, the transmission process of the first pulse signal is completed.
[0123] Specifically, the architecture of latent variable quantization is shown in Figure 9. On the encoder side, continuous latent variables are used as input. Through a competitive learning mechanism, these continuous latent variables are quantized into discrete latent variables. Index encoding is performed on the discrete latent variables to obtain the vector index corresponding to the discrete latent variable. This vector index is then sent to the decoder. On the decoder side, the vector index sent by the encoder is received and combined with the quantized latent variable to obtain the continuous latent variable as output.
[0124] Assuming the sampling rate is 20kHz, the data length L=100, the number of channels read at a single time M=8, the latent variable N=16, the latent variable C=128 after quantization, the signal accuracy B=12 bits, and the bandwidth required for 1024-channel pulse signal compression and transmission is 2.87Mbps, the signal compression rate is 85.7 times.
[0125] Applied to the above encoding and decoding methods, taking a single readout of 10 channels and a data length of 180 seconds as an example, the effect of motion artifact denoising is shown in Figure 10. Figure 10 (a) shows the effect before motion artifact denoising, and Figure 10 (b) shows the effect after motion artifact denoising. As can be clearly seen from Figure 10, the encoding and decoding methods provided in the embodiments of the present application can effectively identify motion artifacts that have significant differences in characteristics from the first pulse signal.
[0126] It is understandable that in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of this application.
[0127] In this embodiment, the electronic device can be divided into functional modules according to the above-mentioned method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into a single processing module. The above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that the module division in this embodiment is illustrative and is only a logical functional division. In actual implementation, other division methods may be used.
[0128] In the case of dividing the functional modules according to the corresponding functions, Figure 11 shows a possible composition diagram of the encoding device 1100 involved in the above embodiment. As shown in Figure 11, the encoding device 1100 may include: an acquisition unit 1101, an encoding unit 1102, a quantization unit 1103 and a sending unit 1104.
[0129] The acquisition unit 1101 may be used to support the encoding device 1100 in executing the above-mentioned step 301 and / or other processes of the technology described herein.
[0130] The encoding unit 1102 may be configured to support the encoding apparatus 1100 in performing the aforementioned step 302 and / or other processes of the technology described herein.
[0131] The quantization unit 1103 may be used to support the encoding apparatus 1100 in performing the above-mentioned step 303 and / or other processes of the technology described herein.
[0132] The sending unit 1104 may be configured to support the encoding apparatus 1100 in executing the aforementioned step 304 and / or other processes of the technology described herein.
[0133] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0134] The encoding device 1100 provided in this embodiment is used to execute the above encoding method, and thus can achieve the same effect as the above implementation method.
[0135] In the case of dividing the functional modules according to their respective functions, Figure 12 shows a possible composition diagram of the decoding device 1200 involved in the above embodiment. As shown in Figure 12, the decoding device 1200 may include: a receiving unit 1201, a decoding unit 1202 and a reconstruction unit 1203.
[0136] The receiving unit 1201 may be used to support the decoding device 1200 in executing the above-mentioned step 601 and / or other processes of the technology described herein.
[0137] The decoding unit 1202 may be configured to support the decoding apparatus 1200 in executing the aforementioned step 602 and / or other processes for the technology described herein.
[0138] The reconstruction unit 1203 may be used to support the decoding apparatus 1200 in executing the above-mentioned step 603 and / or other processes of the technology described herein.
[0139] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0140] The decoding device 1200 provided in this embodiment is used to execute the above decoding method, and thus can achieve the same effect as the above implementation method.
[0141] When integrated, encoding device 1100 may include a processing module, a storage module, and a communication module. The processing module may be used to control and manage the operations of encoding device 1100. For example, it may be used to support encoding device 1100 in executing the steps performed by acquisition unit 1101, encoding unit 1102, quantization unit 1103, and transmission unit 1104. The storage module may be used to support encoding device 1100 in storing program code and data. The communication module may be used to support communication between encoding device 1100 and other devices, such as wireless access devices.
[0142] When integrated, decoding device 1200 may include a processing module, a storage module, and a communication module. The processing module may be used to control and manage the operations of decoding device 1200. For example, it may be used to support decoding device 1200 in executing the steps performed by receiving unit 1201, decoding unit 1202, and reconstruction unit 1203. The storage module may be used to support decoding device 1200 in storing program code and data. The communication module may be used to support communication between decoding device 1200 and other devices, such as wireless access devices.
[0143] The processing module may be a processor or a controller. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module may be a memory. The communication module may specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, and a Wi-Fi chip.
[0144] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment can be an invasive brain-computer interface dedicated chip having the structure shown in FIG5 .
[0145] An embodiment of the present application further provides an electronic device, comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code. The computer program code includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the above-mentioned related method steps to implement the encoding method or decoding method in the above-mentioned embodiment.
[0146] An embodiment of the present application further provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the encoding method or decoding method in the above-mentioned embodiment.
[0147] An embodiment of the present application further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the encoding method or decoding method executed by the electronic device in the above-mentioned embodiment.
[0148] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the encoding method or decoding method executed by the electronic device in the above-mentioned method embodiments.
[0149] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0150] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0151] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0152] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0153] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0154] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0155] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A coding method, characterized in that: The method comprises: Acquire a first pulse signal; Encoding the first pulse signal to obtain a hidden variable; quantizing the latent variable, and index encoding the quantized latent variable to obtain a vector index of the first pulse signal, wherein the vector index is used by a decoding device to reconstruct the first pulse signal in combination with the latent variable; The vector index is sent to the decoding device.
2. The method according to claim 1, characterized in that Before sending the vector index to the decoding device, the method further includes: The vector index is losslessly encoded.
3. The method according to any one of claims 1 to 2, characterized in that: The first pulse signal is an electroencephalogram signal.
4. The method according to claim 1, characterized in that: The step of encoding the first pulse signal to obtain a hidden variable includes: The first pulse signal is compressed into a latent space based on a convolutional neural network to obtain the latent variable.
5. The method according to claim 1, characterized in that The quantifying of the latent variable comprises: The latent variables are quantified based on a competitive learning mechanism.
6. The method according to claim 1, characterized in that Before acquiring the first pulse signal, the method further includes: Based on the comparison result of the spectrum energy corresponding to the second pulse signal and the preset threshold, the first pulse signal is obtained.
7. A decoding method, characterized in that: The method comprises: Receiving a vector index of a first pulse signal; Determine the quantized latent variable corresponding to the vector index; The quantized latent variables are reconstructed to obtain a reconstructed pulse signal.
8. The method according to claim 7, characterized in that After receiving the vector index of the first pulse signal, the method further includes: The vector index is losslessly decoded.
9. The method according to claim 7, characterized in that: The step of reconstructing the quantized latent variable to obtain a reconstructed pulse signal includes: Calculate the loss function corresponding to the quantized latent variable based on a convolutional neural network; The quantized latent variable is reconstructed based on the loss function to obtain a reconstructed pulse signal.
10. The method according to claim 9, characterized in that The first pulse signal and the reconstructed pulse signal are electroencephalogram signals.
11. A coding device, characterized in that: The encoding device comprises: an encoder and a compression vector discretization circuit; The encoder is used to obtain a first pulse signal; The encoder is further used to encode the first pulse signal to obtain a hidden variable; The compressed vector discretization circuit is used to quantize the latent variable and perform index encoding on the quantized latent variable to obtain a vector index of the first pulse signal, wherein the vector index is used by a decoding device to reconstruct the first pulse signal in combination with the latent variable; The compressed vector discretization circuit is further used to send the vector index to the decoding device.
12. The encoding device according to claim 11, characterized in that The encoder is also used to perform lossless encoding on the vector index.
13. The encoding device according to any one of claims 11 to 12, characterized in that: The first pulse signal is an electroencephalogram signal.
14. The encoding device according to claim 11, characterized in that The encoder is specifically used for: The first pulse signal is compressed into a latent space based on a convolutional neural network to obtain the latent variable.
15. The encoding device according to claim 11, characterized in that The compressed vector discretization circuit is specifically used for: The latent variables are quantified based on a competitive learning mechanism.
16. The encoding device according to claim 11, characterized in that The encoding device also includes a signal detection circuit; The signal detection circuit is used to obtain the first A pulse signal.
17. A decoding device, characterized in that: The decoding device comprises a decoder and a reconstruction circuit; The decoder is configured to receive a vector index of a first pulse signal; The decoder is further used to determine the quantized latent variable corresponding to the vector index; The reconstruction circuit is used to reconstruct the quantized latent variable to obtain a reconstructed pulse signal.
18. The decoding device according to claim 17, characterized in that: The decoder is further used to perform lossless decoding on the vector index.
19. The decoding device according to claim 18, characterized in that: The reconstruction circuit is specifically used for: Calculate the loss function corresponding to the quantized latent variable based on a convolutional neural network; The quantized latent variable is reconstructed based on the loss function to obtain a reconstructed pulse signal.
20. The decoding device according to claim 19, characterized in that: The first pulse signal and the reconstructed pulse signal are electroencephalogram signals.
21. A coding device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 6 after executing the computer instructions.
22. A decoding device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer instructions, and the processor executes the method according to any one of claims 7 to 10 after executing the computer instructions.
23. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, enable the electronic device to execute the method described in any one of claims 1 to 6, or enable the electronic device to execute the method described in any one of claims 7 to 10.
Citation Information
Patent Citations
Encoding method, decoding method, encoding device, and decoding device
CN118740566A
Vector joint coding and decoding method, and codec
CN102623012A
Unmanned aerial vehicle emergency condition detection method and system based on electroencephalogram signals
CN113064493A
Point cloud compression method based on implicit neural network
CN114092579A
Method for coding pulse vectors using statistical properties
US20160049158A1
