Encoding method, decoding method, encoding device, and decoding device
By encoding and quantizing the pulse signal, generating a vector index, and reconstructing the pulse signal in the decoding device, the problem of pulse signal transmission in high-throughput and low-bandwidth scenarios is solved, and processing accuracy and real-time performance are improved.
Patent Information
- Application Number
- CN202310377873.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-01
AI Technical Summary
In high-throughput and low-bandwidth scenarios, invasive brain-computer interface chips are difficult to effectively transmit a large number of pulse signals, making it difficult to meet processing accuracy and real-time requirements.
By encoding, quantizing and indexing the pulse signal, a vector index is generated, and the pulse signal is reconstructed by combining latent variables in the decoding device to reduce the amount of transmitted data, and a convolutional neural network and competitive learning mechanism are used for feature extraction and quantification.
It effectively reduces the amount of transmitted data, reduces motion artifacts, improves the reconstruction accuracy and compression ratio of pulse signals, and meets the pulse signal transmission needs in high-throughput and low-bandwidth scenarios.
Smart Images

Figure CN118740566A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] Brain-computer interface technology can be divided into two major directions according to the degree of motor implantation: invasive and non-invasive. Among them, the most widely used invasive signal is the pulse signal (spike), which has the characteristics of high temporal and spatial accuracy, weak amplitude, and sparse temporal and spatial emission. The waveform of the pulse signal is usually 1-2ms, including rich physiological and pathological information, which is of great significance to scientific research and clinical research.
[0003] 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, a thousand-level channel can generate 10-100G bits per second (bps) of pulse signals per second, and a large number of pulse signals are difficult to transmit through limited wireless bandwidth (<5Mbps). As a result, the accuracy, real-time 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. Summary of the invention
[0004] 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.
[0005] In order to achieve the above-mentioned purpose, the embodiment of the present application adopts the following technical solution.
[0006] 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 hidden variable; quantizing the hidden variable, and index encoding the quantized hidden 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 hidden variable; and sending the vector index to the decoding device.
[0007] Therefore, in the encoding method provided in the embodiment of the present application, the first pulse signal is encoded, quantized and indexed to obtain the vector index of the first pulse signal, and the vector index is sent to the decoding device. Compared with the direct transmission of the first pulse signal in the prior art, encoding and quantizing the first pulse signal reduces the amount of data to be transmitted to the decoding device, and the vector index transmitted to the decoding device can further reduce the amount of data to be transmitted to the decoding device, solving the problem of pulse signal transmission in high-throughput and low-bandwidth scenarios.
[0008] In one possible design, before sending the vector index to the decoding device, the method further includes: losslessly encoding the vector index.
[0009] 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.
[0010] In a possible design, the first pulse signal is an electroencephalogram signal.
[0011] 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.
[0012] In one possible design, the first pulse signal is encoded to obtain a latent variable, including: compressing the first pulse signal into a latent space based on a convolutional neural network to obtain a latent variable.
[0013] 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.
[0014] In a possible design, quantifying the latent variables includes: quantifying the latent variables based on a competitive learning mechanism.
[0015] 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.
[0016] In one possible design, before acquiring 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.
[0017] 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.
[0018] 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.
[0019] 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, and then the pulse waveform is 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 have been removed, so that the reconstructed pulse signal does not contain motion artifacts.
[0020] In one possible design, after receiving the vector index of the first pulse signal, the method further includes: losslessly decoding the vector index.
[0021] In this design, if the vector index received by the decoding device is the vector index that the encoding device performs lossless encoding, the vector index needs to be losslessly decoded. Encoding the vector index in a lossless encoding manner can avoid information loss and further reduce the amount of data that needs to be transmitted from the encoding device to the decoding device.
[0022] In a 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.
[0023] 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.
[0024] In a possible design, the first pulse signal and the reconstructed pulse signal are electroencephalogram signals.
[0025] 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.
[0026] In a third aspect, an embodiment of the present application provides a coding device, which includes: an encoder and a compressed vector discretization circuit; the encoder is used to obtain a first pulse signal; the encoder is also used to encode the first pulse signal to obtain a hidden variable; the compressed vector discretization circuit is used to quantize the hidden variable and index encode the quantized hidden variable to obtain a vector index of the first pulse signal, and the vector index is used for a decoding device to reconstruct the first pulse signal in combination with the hidden variable; the compressed vector discretization circuit is also used to send the vector index to the decoding device.
[0027] The beneficial effects of the third aspect can refer to the description of the first aspect.
[0028] In one possible design, the encoder is also used to losslessly encode the vector index.
[0029] In a possible design, the first pulse signal is an electroencephalogram signal.
[0030] 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.
[0031] In one possible design, the compressed vector discretization circuit is specifically used to quantize latent variables based on a competitive learning mechanism.
[0032] 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 between the spectrum energy corresponding to the second pulse signal and a preset threshold.
[0033] 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 a vector index of a first pulse signal; the decoder is also used to determine a 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.
[0034] The beneficial effects of the fourth aspect can be found in the description of the second aspect.
[0035] In one possible design, the decoder is also used to losslessly decode the vector index.
[0036] 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.
[0037] In a possible design, the first pulse signal and the reconstructed pulse signal are electroencephalogram signals.
[0038] In a fifth aspect, an embodiment of the present application further provides a coding device, including 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.
[0039] In a sixth aspect, an embodiment of the present application further provides a decoding device, including 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.
[0040] In a seventh aspect, an embodiment of the present application provides an electronic device, including 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 codes, and the computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the encoding method or decoding method in any of the above aspects and any possible implementations.
[0041] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, including 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.
[0042] In a ninth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a computer or a processor, the computer or the processor executes the encoding method or the decoding method in any of the above aspects and any possible implementation methods.
[0043] 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.
[0044] These and other aspects of the present application will become more apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic diagram of a system or device for applying a coding device provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of the structure of a SoC provided in an embodiment of the present application;
[0047] Figure 3 A flowchart of an encoding method provided in an embodiment of the present application;
[0048] Figure 4 A waveform diagram of multiple quantized latent variables provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of a module of an encoding device provided in an embodiment of the present application;
[0050] Figure 6 A flowchart of a decoding method provided in an embodiment of the present application;
[0051] Figure 7 A comparison diagram of a first pulse signal and a reconstructed pulse signal provided in an embodiment of the present application;
[0052] Figure 8 A schematic diagram of an encoding process and a decoding process provided in an embodiment of the present application;
[0053] Fig. 9 An architecture diagram of latent variable quantization provided in an embodiment of the present application;
[0054] Fig.10 A motion artifact denoising effect diagram provided in an embodiment of the present application;
[0055] Fig.11 A schematic diagram of the composition of an encoding device provided in an embodiment of the present application;
[0056] Fig.12 A schematic diagram of the composition of a decoding device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] For ease of understanding, some examples of concepts related to the embodiments of the present application are provided for reference, as shown below:
[0058] Brain-computer interface technology is divided into two major directions: invasive and non-invasive according to the degree of electrode implantation. 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 state 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 health and other scenarios.
[0059] Convolutional neural networks (CNN) are a type of feedforward neural networks (FNN) that contain convolution calculations and have a deep structure. They are one of the representative algorithms of deep learning.
[0060] The technical solutions in the embodiments of the present application will be described below in conjunction with the 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 only a description of the association relationship of associated objects, indicating that there can be three relationships, 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.
[0061] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, 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.
[0062] In order to realize the processing of pulse signals of invasive brain-computer interfaces, a processing scheme for on-chip signals of invasive brain-computer interfaces has been proposed in the prior art. In this scheme, the pulse signals are converted into analog-to-digital signals, filtered, and waveform key point detected and matched, and finally the pulse signals are compressed into a pulse emission rate per unit time, so as to realize on-chip EEG signal processing of thousands of channels. However, this scheme will increase the false negative rate when the pulse emission rate is high, and it is also impossible to realize the output of pulse waveform signals in high-throughput and low-bandwidth scenarios.
[0063] In addition, the prior art has also proposed a signal compression technology based on a latent variable model, in which 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, thereby achieving 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, which makes it difficult to meet the wireless transmission bandwidth requirements of the brain-computer interface chip. 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, and the reconstruction accuracy is low.
[0064] In addition, the test environment of the existing brain-computer interface technology is an ideal environment, usually under experimental conditions and the test subject remains stationary, so the motion artifacts caused by muscle movement and electrode offset in the running state cannot be effectively detected and denoised, thereby affecting the performance of the decoding device and its promotion and application in real scenes. Therefore, the prior art 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 be realized without prior analysis and research, and based on the EEG time series and frequency domain laws, it can be adaptively decomposed into intrinsic mode components (IMF), so it can be used for the detection and denoising of 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 electroencephalograms and non-invasive EEGs or time series signals with obvious periodic release laws. The noise reduction effect of motion artifacts of discrete and sparse signals such as pulse signals is poor.
[0065] Therefore, an embodiment of the present application provides an encoding method, in which a vector index of a first pulse signal is sent to a decoding device. Compared with the prior art in which the first pulse signal is directly sent to the decoding device, encoding and quantizing the first pulse signal reduces the amount of data to be transmitted to the decoding device. In addition, the vector index is transmitted to the decoding device, which can further reduce the amount of data to be transmitted to the decoding device, solving the problem of pulse signal transmission in high-throughput and low-bandwidth scenarios.
[0066] Corresponding to the encoding method, an embodiment of the present application also provides a decoding method. In the 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, in the training process of the original pulse waveform, the motion artifacts have been removed, so that the reconstructed pulse signal does not contain motion artifacts.
[0067] The above 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. Figure 1The terminal devices shown, such as mobile phone terminals, tablet computers, laptop computers, augmented reality devices, virtual reality devices, and vehicle-mounted terminals, can also be servers, 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 vehicle-mounted terminals, 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 in the embodiment of the present application may include: a first pulse signal, which can 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.
[0068] 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 may be a chip, and the chip is a system-on-a-chip (SoC) 20. Figure 2 As shown, 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. After the processor loads the data and application in the memory, it processes the data, such as the encoding process and the decoding process in the present application. For example, when the data is a first pulse signal, the first pulse signal may be encoded and quantized to obtain a quantized hidden variable, and a vector index of the first pulse signal may be obtained based on the quantized hidden variable.
[0069] 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), an image processing unit (GPU), and a neural network processing unit (NPU), as well as brain-computer interface software.
[0070] 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.
[0071] Applied to the above-mentioned device or equipment, the encoding method provided in the embodiment of the present application is introduced below.
[0072] The present application embodiment provides a coding method, such as Figure 3 As shown, Figure 3A flowchart of a coding method provided in an embodiment of the present application. The coding method includes the following process.
[0073] Step 301: The encoding device obtains a first pulse signal.
[0074] Exemplarily, the first pulse signal is a signal that is 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.
[0075] It is understandable that the first pulse signal is a digital signal, which can be understood as a binary stream. In one example, 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).
[0076] Exemplarily, the first pulse signal can be arranged in the form of channel number and waveform length, wherein the channel number is the number of channels read by the encoding device at a single time. In one example, the number of channels read at a single time can be 8, and the waveform length can be 100. Thus, the encoding efficiency of the encoding device can be improved, and the correlation of the first pulse waveforms between different channels can be combined for subsequent processing.
[0077] Step 302: The encoding device encodes the first pulse signal to obtain a latent variable.
[0078] Exemplarily, the encoding device can encode the first pulse signal based on the encoder, and the process of the encoder encoding the first pulse signal can be understood as a dimensionality reduction process, that is, the encoder encodes the high-dimensional first pulse signal into a low-dimensional latent variable. Among them, the latent variable represents a feature of the first pulse signal. In an example, the latent variable can represent the waveform feature of the first pulse signal.
[0079] 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, the encoder encodes the high-dimensional first pulse signal into a low-dimensional latent variable, and the decoder can reconstruct or restore the reconstructed first pulse signal based on the low-dimensional latent variable.
[0080] 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.
[0081] 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 a natural difference (variability), but the pulse signal has a 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 hidden variable can be improved.
[0082] like Figure 4 As shown, Figure 4 A waveform diagram of multiple quantized latent variables provided in an embodiment of the present application, Figure 4 8 waveforms of quantized latent variables are shown in FIG. A vector index may 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.
[0083] Among them, the quantized latent variables can be obtained in the algorithm training stage, wherein the first pulse signal input is superimposed with motion artifacts, and the algorithm can reconstruct the pulse signal after the motion artifacts are denoised 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, and further improve the compression rate.
[0084] Step 304: The encoding device sends a vector index to the decoding device.
[0085] 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.
[0086] In another implementation, the encoding device may also send the vector index to the decoding device via wired transmission.
[0087] 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.
[0088] Optionally, before step 304, the encoding may further include: the encoding device performs lossless encoding on the vector index.
[0089] In one example, the encoding device may directly transmit the original vector index to the encoding device. In another example, the encoding device may also perform entropy coding on the vector index. Entropy coding is coding that does not lose any information according to the entropy principle during the encoding process. Entropy coding may 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.
[0090] Optionally, the first pulse signal is an electroencephalogram signal.
[0091] Exemplarily, 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 for controlling external devices. Among them, there are two main ways of collecting data for data acquisition equipment, 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 an invasive electrode built-in method. The electrodes can be silicon-based electrodes and flexible electrodes. This method implants the electrodes into the cerebral cortex of the subject through surgery and directly contacts the cerebral cortex, so the EEG signals collected by this method are more accurate. In addition, the non-invasive external electrode method collects signals by wearing a device on the brain of the subject. This method is easy 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 the collected EEG signals.
[0092] Since EEG signals are generated by the joint 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 under 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.
[0093] In addition, when acquiring the first pulse signal, the subject may be in a stationary state or in a moving state.
[0094] 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.
[0095] Exemplarily, 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.
[0096] In one example, the encoding device can perform feature extraction on the first pulse signal based on the convolution layer, and decompose the first pulse signal into a compressed vector. In view of the on-chip power consumption and storage limitations, the group convolution architecture in the deep residual network is adopted to effectively extract the features of the first pulse signal through skip connections, thereby obtaining continuous latent variables, and further reducing the number of parameters.
[0097] The latent variable may be of high precision. Specifically, the latent variable may be represented by floating point (FP) 64 data.
[0098] Optionally, step 303 may include: the encoding device quantizes the latent variables based on a competitive learning mechanism.
[0099] Exemplary, competitive learning mechanism 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, and determines a central vector as the center of clustering for each region. The input vector 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 method. The self-organizing map network classifies the input pattern set by finding the optimal reference vector set, and the formed cluster center 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 mapping.
[0100] Exemplarily, the process of quantizing the latent variables by the encoding device can be understood as a discrete process, and the encoding device converts the continuous latent variables into multiple discrete quantized latent variables. In one example, assuming that the number of continuous latent variables is 16, 128 discrete quantized latent variables can be obtained.
[0101] Optionally, before step 301, the method may include: the encoding device obtains the first pulse signal based on a comparison result between spectrum energy corresponding to the second pulse signal and a preset threshold.
[0102] 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 according to 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.
[0103] In addition, before the second pulse signal is denoised, 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.
[0104] Based on the above description, the following is an introduction to the coding device using the coding method in the embodiment of the present application. Specifically, a low-power invasive brain-computer interface dedicated chip with wireless transmission function such as Figure 5 As shown, the invasive brain-computer interface dedicated chip includes an analog front end (AFE), a filter, a spike 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 (for example, 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 extract features based on a convolutional layer and a skip connection, and a lightweight network structure 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 through vector quantization, and index coding is performed on discrete hidden variables. After completing the processing of the EEG signal on the invasive brain-computer interface dedicated chip, the index is transmitted to the decoder of the lower computer, thereby completing the wireless transmission of the EEG signal. In one example, the encoder and latent vector quantization and index encoding module in the invasive brain-computer interface chip can be implemented on-chip through logic circuits or digital signal processing modules.
[0105] Applied to the above-mentioned device or equipment, the decoding method provided in the embodiment of the present application is introduced below.
[0106] The present application embodiment provides a decoding method, such as Figure 6 As shown, Figure 6 A flowchart of a decoding method provided in an embodiment of the present application. The decoding method includes the following process.
[0107] Step 601: A decoding device receives a vector index of a first pulse signal.
[0108] Exemplarily, the decoding device may receive the vector index sent by the encoding device via wireless Bluetooth or wireless fidelity. In one example, there is a corresponding relationship between the vector index and the quantized latent variable, and the corresponding relationship may be stored in a table. It is understandable that the table is stored in both the decoding device and the encoding device.
[0109] Step 602: The decoding device determines the quantized latent variable corresponding to the vector index.
[0110] 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.
[0111] Step 603: The decoding device reconstructs the quantized latent variable to obtain a reconstructed pulse signal.
[0112] For example, Figure 7 As shown, Figure 7 A comparison diagram of a first pulse signal and a reconstructed pulse signal provided in an embodiment of the present application. Figure 7 The comparison diagram of 12 first pulse signals and reconstructed pulse signals is shown in FIG. Figure 7 It can be seen that 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, in the training process of the original pulse waveform, the motion artifacts have been removed, so that the reconstructed pulse signal does not contain motion artifacts.
[0113] 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.
[0114] Optionally, before step 601, the decoding method may include: the decoding device performs lossless decoding on the vector index.
[0115] Exemplarily, if the vector index received by the decoding device is the original vector index, there is no need to decode the vector index. If the vector index received by the decoding device is the vector index that the encoding device performs lossless encoding, the vector index needs to be losslessly decoded. Encoding the vector index in a lossless encoding manner can avoid information loss and further reduce the amount of data that needs to be transmitted from the encoding device to the decoding device.
[0116] 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.
[0117] Exemplarily, the convolutional neural network on the decoding device side may also be a deep residual network structure or a ResNeXt architecture. The loss function is used to indicate the degree of inconsistency between the reconstructed pulse signal and the first pulse signal. During the training phase, the loss function corresponding to the quantized latent variable may be obtained. Reconstructing the quantized latent variable based on the loss function may reduce the reconstruction error of the reconstructed pulse signal.
[0118] Optionally, the first pulse signal and the reconstructed pulse signal are electroencephalogram signals.
[0119] Exemplarily, the first pulse signal may be an invasive EEG signal collected by an invasive brain-computer interface chip. By collecting EEG signals through built-in electrodes, the accuracy of EEG signal collection can be improved. The reconstructed pulse signal is reconstructed based on the first pulse signal and is the first pulse signal that can be analyzed and processed.
[0120] Applicable to the above encoding method, decoding method, encoding device and decoding device, such as Figure 8 As shown, Figure 8 A schematic diagram of an encoding process and a decoding process provided for an embodiment of the present application. Among them, the schematic diagram only shows some actions of the encoding device and some 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 a reconstructed pulse signal is obtained through a decoder. In this way, the transmission process of the first pulse signal is completed.
[0121] Specifically, the architecture diagram of latent variable quantization is as follows Fig. 9As shown, at the encoding device end, the continuous latent variable is used as input, and the continuous latent variable is quantized into a discrete latent variable through a competitive learning mechanism, and the discrete latent variable is indexed and encoded to obtain the vector index corresponding to the discrete latent variable, and the vector index is sent to the decoding device. At the decoding device end, the vector index sent by the encoding device is received, and the vector index and the quantized latent variable are combined to obtain a continuous latent variable as output.
[0122] 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 compression and transmission of 1024-channel pulse signals is 2.87Mbps, the signal compression rate is 85.7 times.
[0123] Applied to the above encoding and decoding methods, taking the single reading channel number as 10 and the data length as 180s as an example, the motion artifact denoising effect is shown in the figure below: Fig.10 As shown. Among them, Fig.10 (a) is the effect picture before motion artifact denoising. Fig.10 (b) is the effect of motion artifact denoising. Fig.10 It can be clearly seen that the encoding method and decoding method provided in the embodiments of the present application can effectively identify motion artifacts that have significant differences in characteristics from the first pulse signal.
[0124] 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 the present application.
[0125] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0126] In the case of dividing each functional module into corresponding functional modules, Fig.11 A possible schematic diagram of the composition of the encoding device 1100 involved in the above embodiment is shown. Fig.11As shown, the encoding device 1100 may include: an acquisition unit 1101, an encoding unit 1102, a quantization unit 1103 and a sending unit 1104.
[0127] The acquisition unit 1101 may be used to support the encoding device 1100 to execute the above-mentioned step 301, etc., and / or other processes of the technology described herein.
[0128] The encoding unit 1102 may be configured to support the encoding device 1100 in performing the above-mentioned step 302 and the like, and / or other processes for the technology described herein.
[0129] The quantization unit 1103 may be used to support the encoding device 1100 to perform the above-mentioned step 303, etc., and / or other processes of the technology described herein.
[0130] The sending unit 1104 may be configured to support the encoding device 1100 to perform the above-mentioned step 304 and / or other processes for the technology described herein.
[0131] 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.
[0132] 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.
[0133] In the case of dividing each functional module into corresponding functional modules, Fig.12 A possible schematic diagram of the composition of the decoding device 1200 involved in the above embodiment is shown. Fig.12 As shown, the decoding device 1200 may include: a receiving unit 1201 , a decoding unit 1202 and a reconstruction unit 1203 .
[0134] The receiving unit 1201 may be used to support the decoding device 1200 to execute the above-mentioned step 601, etc., and / or other processes of the technology described in this document.
[0135] The decoding unit 1202 may be configured to support the decoding device 1200 to perform the above-mentioned step 602 and the like, and / or other processes for the technology described herein.
[0136] The reconstruction unit 1203 may be used to support the decoding device 1200 to perform the above-mentioned step 603 and / or other processes of the technology described herein.
[0137] 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.
[0138] 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.
[0139] In the case of using an integrated unit, the coding device 1100 may include a processing module, a storage module and a communication module. Among them, the processing module can be used to control and manage the actions of the coding device 1100, for example, it can be used to support the coding device 1100 to perform the steps performed by the above-mentioned acquisition unit 1101, coding unit 1102, quantization unit 1103 and sending unit 1104. The storage module can be used to support the coding device 1100 to store program codes and data, etc. The communication module can be used to support the communication between the coding device 1100 and other devices, such as communication with wireless access devices.
[0140] In the case of using integrated units, the decoding device 1200 may include a processing module, a storage module and a communication module. Among them, the processing module can be used to control and manage the actions of the decoding device 1200, for example, it can be used to support the decoding device 1200 to perform the steps performed by the above-mentioned receiving unit 1201, decoding unit 1202 and reconstruction unit 1203. The storage module can be used to support the decoding device 1200 to store program codes and data, etc. The communication module can be used to support the communication between the decoding device 1200 and other devices, such as communication with wireless access devices.
[0141] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can 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, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices such as a radio frequency circuit, a Bluetooth chip and a Wi-Fi chip.
[0142] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 5 A dedicated chip for invasive brain-computer interface with the structure shown.
[0143] The embodiment of the present application also provides an electronic device, including 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 codes, and the computer program codes include 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.
[0144] An embodiment of the present application also provides a computer storage medium, in which computer instructions are stored. 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.
[0145] The embodiments of the present application also provide a computer program product. When the computer program product is run on a computer, the computer executes the above-mentioned related steps to implement the encoding method or decoding method executed by the electronic device in the above-mentioned embodiments.
[0146] In addition, an embodiment of the present application also provides a device, which may 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 execution instructions, and when the device is running, the processor may execute the computer execution instructions stored in the memory so that the chip executes the encoding method or decoding method executed by the electronic device in the above-mentioned method embodiments.
[0147] 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.
[0148] 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 assigned to 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.
[0149] In the several embodiments provided in the present 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, 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.
[0150] The units described as separate components may or may not be physically separated, 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 different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0151] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0152] 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, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0153] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope 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 pulse signal based on the comparison result of the spectrum energy corresponding to the second pulse signal and the preset threshold.
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
Cited By
Codebook matching method and device for voice coding quantization, equipment and storage medium
CN117238301A
Encoding method, decoding method, encoding apparatus and decoding apparatus
EP4668684A1
Encoding method, decoding method, encoding apparatus and decoding apparatus
WO2024199132A1
