A binarized neural network sleep apnea detection method for wearable devices

By constructing a binary neural network based on single-lead electrocardiogram signals, and combining feature extraction and hardware-aware network structure search, the problems of high computational load and decreased accuracy in sleep apnea detection on wearable devices are solved, and real-time detection is achieved on resource-constrained devices.

CN122478466APending Publication Date: 2026-07-31SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTHEAST UNIV
Filing Date
2026-06-17
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing deep learning models suffer from problems such as large number of parameters, high computational cost, and high power consumption when used for sleep apnea detection on wearable devices, making them difficult to deploy directly. Furthermore, the large gradient estimation error during backpropagation of binary neural networks leads to a decrease in accuracy.

Method used

By constructing a binary neural network based on single-lead ECG signals, and combining ECG feature extraction, optimal gradient approximation function selection, hardware sensing network structure search, and quantization error reduction, a lightweight detection scheme is designed, which is suitable for resource-constrained wearable devices.

Benefits of technology

It enables real-time sleep apnea detection on microcontroller-level wearable devices, reducing model storage and computation while improving detection accuracy and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122478466A_ABST
    Figure CN122478466A_ABST
Patent Text Reader

Abstract

This invention discloses a binarized neural network method for sleep apnea detection in wearable devices, comprising: acquiring a single-lead electrocardiogram (ECG) signal during the user's sleep; performing R-peak detection on the ECG segment, extracting the RR interval sequence and R-wave amplitude sequence, and generating fixed-length temporal features through anomaly suppression and equal-interval resampling; selecting the optimal gradient approximation function; determining a binarized convolutional neural network structure that satisfies the target hardware constraints; reducing quantization error during binarization training through full-precision pre-training initialization, quantization-aware normalization, and a quantization error loss function; deploying the trained binarized convolutional neural network to a wearable device or edge device, and outputting the sleep apnea discrimination result corresponding to the target time slice through bit packing and bitwise operations. This invention maintains the accuracy of sleep apnea detection while also considering lightweight model, low power consumption, and hardware deployability, making it suitable for wearable sleep monitoring devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of edge intelligent medical devices and relates to physiological signal processing and neural network technology, specifically to a binary neural network sleep apnea detection method for wearable devices. Background Technology

[0002] Obstructive sleep apnea is a common sleep-disordered breathing phenomenon characterized by recurrent episodes of apnea or hypopnea during sleep, which can reduce sleep quality and increase the risk of cardiovascular disease. Traditional polysomnography (PSG) devices are complex and expensive, making them unsuitable for long-term, continuous screening and wearable monitoring in a home setting.

[0003] Single-lead ECG signals can be continuously acquired using devices such as ECG patches, wristbands, or chest straps. The RR interval and R wave amplitude can reflect information about autonomic nervous system regulation, changes in thoracic impedance, and heart rate variability caused by apnea events. Therefore, automated sleep apnea detection methods based on single-lead ECG signals have good practical application value.

[0004] In recent years, deep learning models such as convolutional neural networks, recurrent neural networks, and Transformers have been applied to sleep apnea detection tasks. While these models have high recognition accuracy, they typically suffer from large parameter counts, high computational costs, and high power consumption, making them difficult to deploy directly on resource-constrained wearable devices such as microcontrollers.

[0005] Binarizing neural networks by constraining weights and activations to +1 or -1 allows bitwise operations to replace multiplication, significantly reducing model storage and computational overhead. However, the binarization sign function is non-differentiable, easily leading to gradient estimation errors during backpropagation. Furthermore, binarization causes loss of weight and activation information; directly binarizing a full-precision network typically results in a decrease in accuracy. Therefore, a lightweight detection method is needed for sleep apnea detection that balances model accuracy, storage requirements, computational efficiency, and hardware deployment performance. Summary of the Invention

[0006] Purpose of the invention: In order to overcome the shortcomings of the existing technology, a binary neural network sleep apnea detection method for wearable devices is provided. It provides a lightweight detection scheme that combines ECG feature construction, selection of optimal gradient approximation function based on evaluation criteria, hardware-aware binary network structure search with model storage limit as constraint, and reduction of quantization error, so that the sleep apnea detection model can run in real time on resource-constrained wearable or edge devices.

[0007] Technical Solution: To achieve the above objectives, this invention provides a binary neural network sleep apnea detection method for wearable devices, comprising the following steps:

[0008] S1: Acquire single-lead ECG signals during the user's sleep period, and extract ECG segments of preset duration centered on the target time slice to be judged;

[0009] S2: R-peak detection is performed on ECG segments, RR interval sequences and R-wave amplitude sequences are extracted, and fixed-length temporal features are generated through abnormal suppression and equal-interval resampling;

[0010] S3: Considering the limited computing and storage resources of wearable devices, multiple candidate gradient approximation functions are selected. The binary convolutional neural network is trained or evaluated using the candidate gradient approximation functions respectively. The optimal gradient approximation function is selected based on the evaluation standard with the highest accuracy in sleep apnea detection.

[0011] S4: Using the upper limit of model storage as a constraint, a genetic algorithm is used to select, cross over, and mutate candidate structures of the binary convolutional neural network to determine the binary convolutional neural network structure that meets the target hardware constraints, wherein at least some convolutional layers in the binary convolutional neural network use binary weights and binary activations.

[0012] S5: Based on the optimal gradient approximation function and the binary convolutional neural network structure determined in step S4, the quantization error during the binary training process is reduced through full-precision pre-training initialization, quantization-aware normalization, and quantization error loss function.

[0013] S6: Deploy the trained binary convolutional neural network to wearable or edge devices, and output the sleep apnea discrimination result corresponding to the target time slice through bit packing and bitwise operations.

[0014] Further, step S2 includes:

[0015] A1: Perform R-peak detection on the extracted ECG segments to obtain the time position of the R-peak;

[0016] A2: Calculate the RR interval sequence based on the time positions of adjacent R peaks, and extract the R peak amplitude value to obtain the R wave amplitude value sequence;

[0017] A3: Median filtering is applied to the RR interval sequence to suppress outliers and physiological noise;

[0018] A4: Since the time position of the R peak is not uniformly distributed, cubic interpolation is used to resample the RR interval sequence and the R wave amplitude sequence into a fixed-length time series feature.

[0019] Furthermore, the candidate gradient approximation functions in step S3 include the Hard Tanh function, the Learnable Tanh function, the Piecewise function, the FFT function, and the IEE function.

[0020] Furthermore, in step S4, the first convolutional layer of the binarized convolutional neural network retains full-precision activation, while the remaining convolutional layers use binarized weights and binarized activation.

[0021] Further, step S4 includes:

[0022] B1: Set the target hardware constraint, which is the upper limit of model storage;

[0023] B2: Define the candidate network structure search space, which includes at least one of the following: number of convolutional layer channels, kernel size, number of network layers, activation function, and dropout rate;

[0024] B3: Randomly generate a population of candidate network structures and remove candidate structures that do not meet the target hardware constraints;

[0025] B4: Based on the optimal gradient approximation function determined in step S3, train or quickly evaluate the candidate network structure, and use the sleep apnea detection accuracy as the fitness evaluation criterion.

[0026] B5: Perform selection, crossover, and mutation operations on candidate network structures with high fitness to generate a new population of candidate network structures; repeat architecture evaluation, selection, crossover, and mutation until the number of iterations or convergence conditions are reached, and output a binary convolutional neural network structure that meets the hardware constraints.

[0027] Furthermore, the binary convolutional neural network obtained in step B5 is an inverted pyramid structure, meaning that the early convolutional layers have a wider number of channels, while the number of channels in the deeper convolutional layers gradually narrows.

[0028] Further, step S5 includes:

[0029] C1: Train the full-precision network corresponding to the target binary convolutional neural network structure determined in step S4, and use the full-precision network for pre-training initialization;

[0030] C2: Based on the average absolute value of the weights in each convolutional layer, map the full-precision weights to +1 or -1 to initialize the binary convolutional neural network.

[0031] C3: A quantization-aware normalization module is set before the binarization sign function. The quantization-aware normalization module is used to linearly adjust the tensor to be binarized, including scaling and translation parameters. In one embodiment, the scaling parameter is initialized to 1 and the translation parameter is initialized to 0, and updated through backpropagation along with other trainable parameters of the binarized convolutional neural network. This quantization-aware normalization module enables the distribution of the tensor to be binarized to better adapt to the threshold of the sign function, thereby reducing the information loss caused by binarization.

[0032] C4: Construct the total loss function, which includes a classification loss function and a quantization error loss function, wherein the quantization error loss function is used to constrain the difference between the full-precision weights or activations and their binary representations; in one embodiment, the quantization error loss function includes a weight quantization error term and an activation quantization error term, and adjusts their contribution to the total loss function by corresponding weight coefficients.

[0033] Further, step S6 includes:

[0034] D1: Export the trained binary convolutional neural network parameters as a parameter file that can be read by edge devices;

[0035] D2: Compress and store the 32 binary weights into a 32-bit integer, achieving bit-packed storage;

[0036] D3: In the reasoning process, XNOR operation and counting operation are used to replace multiplication and accumulation operation;

[0037] D4: Perform local inference on the input ECG features and output the judgment result of sleep apnea or normal breathing.

[0038] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0039] 1. This invention constructs fixed-length ECG timing features by using the RR interval and R wave amplitude, which can identify sleep apnea events using a single-lead ECG signal, making it suitable for continuous data acquisition scenarios using wearable devices.

[0040] 2. This invention improves the stability of binarized network training by comparing and evaluating multiple candidate gradient approximation functions and selecting the optimal gradient approximation function suitable for the binarized sleep apnea detection task based on the detection accuracy.

[0041] 3. After selecting the optimal gradient approximation function, this invention uses a hardware-aware genetic algorithm to search for a binary convolutional neural network structure suitable for 1-bit inference, thus avoiding the suboptimal structure problem caused by directly compressing the full-precision network.

[0042] 4. This invention reduces the information loss caused by binarization by using full-precision pre-training initialization, quantization perception normalization, and quantization error loss function, thereby further improving detection accuracy while maintaining lightweight design.

[0043] 5. This invention reduces model storage, computational load, and inference energy consumption through bit packing, XNOR operation, and counting operation, enabling real-time sleep apnea detection on microcontroller-level wearable devices. Attached Figure Description

[0044] Figure 1Flowchart for a binarized neural network sleep apnea detection method for wearable devices;

[0045] Figure 2 Here is a flowchart of the electrocardiogram (ECG) signal feature extraction process;

[0046] Figure 3 Flowchart for selecting the optimal gradient approximation function;

[0047] Figure 4 Flowchart for searching hardware-aware neural network architectures;

[0048] Figure 5 Flowchart for reducing quantization error;

[0049] Figure 6 Flowchart for edge device bit-packing inference deployment;

[0050] Figure 7 This is a structural diagram of a binary convolutional neural network. Detailed Implementation

[0051] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.

[0052] like Figure 1 As shown, this embodiment provides a binary neural network sleep apnea detection method for wearable devices, including the following steps:

[0053] S1: ECG signal preprocessing

[0054] Acquire single-lead ECG signals during the user's sleep period, and extract ECG segments of preset duration centered on the target time slice to be judged;

[0055] In this embodiment, single-lead ECG signals can be collected by an ECG patch, chest strap, wristband, or bedside monitoring terminal. The target time slice can be 1 minute, and the preset duration can be 5 minutes, so that the ECG context before and after the minute to be judged can participate in the judgment.

[0056] S2: ECG Feature Extraction

[0057] R-peak detection was performed on ECG segments, and RR interval and R-wave amplitude sequences were extracted. Fixed-length temporal features were generated through abnormal suppression and equal-interval resampling.

[0058] like Figure 2 As shown, step S2 in this embodiment includes:

[0059] A1: Perform R-peak detection on the extracted ECG segments to obtain the time position of the R-peak;

[0060] A2: Calculate the RR interval sequence based on the time positions of adjacent R peaks, and extract the R peak amplitude value to obtain the R wave amplitude value sequence;

[0061] A3: Median filtering is applied to the RR interval sequence to suppress outliers and physiological noise;

[0062] A4: Since the time position of the R peak is not uniformly distributed, cubic interpolation is used to resample the RR interval sequence and the R wave amplitude sequence into a 3Hz uniform time series feature.

[0063] S3: Selection of the optimal gradient approximation function

[0064] like Figure 3 As shown, considering the limited computing and storage resources of wearable devices, multiple candidate gradient approximation functions are selected. The binary convolutional neural network is trained or evaluated using the candidate gradient approximation functions respectively, and the optimal gradient approximation function is selected based on the evaluation standard with the highest accuracy in sleep apnea detection.

[0065] Candidate gradient approximation functions include Hard Tanh function, Learnable Tanh function, Piecewise function, FFT function and IEE function, as shown in formulas (1) to (5);

[0066] (1)

[0067] (2)

[0068] (3)

[0069] (4)

[0070] (5)

[0071] In this embodiment, the IEE function is determined as the optimal gradient approximation function to approximate the backpropagation gradient of the binarized sign function. The IEE function can maintain good gradient locality near weak amplitude inputs and provide non-zero gradients over a wide input range, thereby reducing gradient mismatch and improving the convergence stability of the binarized network.

[0072] In the comparative experiments of this embodiment, the validation set of the Apnea-ECG dataset was used for evaluation. The IEE function achieved a detection accuracy of 91.53%, which is higher than Hard Tanh (91.04%), Learnable Tanh (90.77%), Piecewise (90.70%), and FFT (90.68%). This result shows that the IEE function has the best gradient approximation effect in this task, and therefore it was selected as the preferred gradient approximation function.

[0073] S4: Hardware-Aware Neural Network Architecture Search

[0074] With the upper limit of model storage as a constraint, a genetic algorithm is used to select, cross over and mutate candidate structures of binary convolutional neural networks to determine the binary convolutional neural network structure that meets the target hardware constraints, wherein at least some convolutional layers in the binary convolutional neural network use binary weights and binary activations;

[0075] In this embodiment, the first convolutional layer of the binary convolutional neural network retains full-precision activation, while the remaining convolutional layers use binary weights and binary activation.

[0076] like Figure 4 As shown, step S4 in this embodiment includes:

[0077] B1: Set the target hardware constraint, which is the upper limit of model storage;

[0078] B2: Define the candidate network structure search space, which includes at least one of the following: number of convolutional layer channels, kernel size, number of network layers, activation function, and dropout rate;

[0079] B3: Randomly generate a population of candidate network structures and remove candidate structures that do not meet the target hardware constraints;

[0080] B4: Based on the optimal gradient approximation function determined in step S3, train or quickly evaluate the candidate network structure, and use the sleep apnea detection accuracy as the fitness evaluation criterion.

[0081] B5: Perform selection, crossover, and mutation operations on candidate network structures with high fitness to generate a new population of candidate network structures; repeat architecture evaluation, selection, crossover, and mutation until the number of iterations or convergence conditions are reached, and output a binary convolutional neural network structure that meets the hardware constraints.

[0082] In this embodiment, the binarized convolutional neural network obtained by the search is an inverted pyramid structure, meaning that the early convolutional layers have a wider number of channels, while the number of channels gradually narrows in the deeper convolutional layers. The specific structure of the binarized convolutional neural network in this embodiment is as follows: Figure 7 As shown.

[0083] This inverted pyramid structure design aligns with the characteristics of apnea detection based on ECG features (i.e., RR interval and amplitude). In these time-series signals, shallow features capture crucial short-term physiological dynamics: the RR interval reflects heart rate variability between successive heartbeats, influenced by autonomic nervous activity during respiratory events; while the R-wave amplitude is modulated by respiratory effort and apnea-related changes in thoracic impedance. However, aggressive 1-bit quantization inevitably leads to severe truncation and information loss of these key features. To compensate for the weakened representational capacity of single channels, the model deploys wider channels in the initial layer, constructing a higher-dimensional and more redundant feature space. This allows the model to capture and preserve subtle morphological changes in the ECG signal before performing deep nonlinear transformations. Therefore, this "wide shallow, narrow deep" design effectively alleviates the information bottleneck caused by binarization, prioritizing the preservation of high-resolution, morphologically rich information in the input features, which is crucial for accurate apnea detection under strong quantization constraints.

[0084] S5: Reduced quantization error

[0085] Based on the optimal gradient approximation function and the binary convolutional neural network structure determined in step S4, the quantization error during the binary training process is reduced through full-precision pre-training initialization, quantization-aware normalization, and quantization error loss function.

[0086] like Figure 5 As shown, step S5 includes:

[0087] C1: Train the full-precision network corresponding to the target binary convolutional neural network structure determined in step S4, and use the full-precision network for pre-training initialization;

[0088] C2: Based on the average absolute value of the weights in each convolutional layer, map the full-precision weights to +1 or -1 to initialize the binary convolutional neural network.

[0089] C3: A quantization-aware normalization module is set before the binarization sign function, as shown in formula (6). The quantization-aware normalization module is used to linearly adjust the tensor to be binarized, which includes scaling parameters and translation parameters. In this embodiment, the scaling parameters are initialized to 1 and the translation parameters are initialized to 0, and are updated through backpropagation together with other trainable parameters of the binarization convolutional neural network. The quantization-aware normalization module can make the distribution of the tensor to be binarized more adaptable to the threshold of the sign function, thereby reducing the information loss caused by binarization.

[0090] (6)

[0091] Adjustment principle: Quantization-aware normalization performs an affine transformation on the input tensor by introducing a learnable scaling parameter α and a bias parameter β. This allows for dynamic adjustment of its distribution range and central location, resulting in a transformed... The values ​​are distributed as symmetrically as possible on both sides of the threshold (0) of the binarization symbol function to avoid a large number of values ​​being concentrated on the same side and all being quantized to +1 or -1. This data-driven adjustment method can effectively reduce feature truncation and information loss caused by 1-bit quantization and improve the binarization model's ability to represent the original signal.

[0092] C4: Construct the total loss function, which includes a classification loss function and a quantization error loss function. The quantization error loss function is used to constrain the difference between the full-precision weights or activations and their binary representations. In this embodiment, the quantization error loss function includes a weight quantization error term and an activation quantization error term, and their contribution to the total loss function is adjusted by the corresponding weight coefficients.

[0093] In this embodiment, the total loss function is established as shown in formula (7):

[0094] (7)

[0095] It should be noted that the first convolutional layer can retain full-precision activation to avoid premature loss of weak amplitude changes and fine-grained morphological information in the ECG signal at the input; the remaining convolutional layers can use binarized weights and binarized activation, thereby reducing the model storage and computational load.

[0096] S6: Edge Device Inference

[0097] The trained binary convolutional neural network is deployed to wearable or edge devices, and the sleep apnea discrimination results corresponding to the target time slice are output through bit packing and bitwise operations.

[0098] like Figure 6 As shown, step S6 includes:

[0099] D1: Export the trained binary convolutional neural network parameters as a parameter file that can be read by edge devices;

[0100] D2: Compress and store the 32 binary weights into a 32-bit integer, achieving bit-packed storage;

[0101] D3: In the reasoning process, XNOR operation and counting operation are used to replace multiplication and accumulation operation;

[0102] D4: Perform local inference on the input one-minute ECG features and output the judgment result of sleep apnea or normal breathing.

[0103] In this embodiment, the binarized convolutional neural network can be deployed on the STM32F767 platform, with model parameters occupying approximately 4.29KB. The single inference time for one minute of ECG features is approximately 562ms, and the energy consumption for a single inference is approximately 0.36J.

[0104] Exemplary experiments based on the publicly available Apnea-ECG dataset show that the binarization model of this invention can maintain high detection accuracy while significantly reducing model size and computational cost; cross-dataset experiments based on the UCDDB dataset show that this invention has a certain generalization ability and is suitable for home sleep monitoring and wearable edge medical scenarios.

Claims

1. A binarized neural network sleep apnea detection method for wearable devices, characterized in that, Includes the following steps: S1: Acquire single-lead ECG signals during the user's sleep period, and extract ECG segments of preset duration centered on the target time slice to be judged; S2: R-peak detection is performed on ECG segments, RR interval sequences and R-wave amplitude sequences are extracted, and fixed-length temporal features are generated through abnormal suppression and equal-interval resampling; S3: Considering the limited computing and storage resources of wearable devices, multiple candidate gradient approximation functions are selected. The binary convolutional neural network is trained or evaluated using the candidate gradient approximation functions respectively. The optimal gradient approximation function is selected based on the evaluation standard with the highest accuracy in sleep apnea detection. S4: Using the upper limit of model storage as a constraint, a genetic algorithm is used to select, cross over, and mutate candidate structures of the binary convolutional neural network to determine the binary convolutional neural network structure that meets the target hardware constraints, wherein at least some convolutional layers in the binary convolutional neural network use binary weights and binary activations. S5: Based on the optimal gradient approximation function and the binary convolutional neural network structure determined in step S4, the quantization error during the binary training process is reduced through full-precision pre-training initialization, quantization-aware normalization, and quantization error loss function. S6: Deploy the trained binary convolutional neural network to wearable or edge devices, and output the sleep apnea discrimination result corresponding to the target time slice through bit packing and bitwise operations.

2. The binarized neural network sleep apnea detection method for wearable devices according to claim 1, wherein, Step S2 includes: A1: Perform R-peak detection on the extracted ECG segments to obtain the time position of the R-peak; A2: Calculate the RR interval sequence based on the time positions of adjacent R peaks, and extract the R peak amplitude value to obtain the R wave amplitude value sequence; A3: Median filtering is applied to the RR interval sequence to suppress outliers and physiological noise; A4: Since the time position of the R peak is not uniformly distributed, cubic interpolation is used to resample the RR interval sequence and the R wave amplitude sequence into a fixed-length time series feature.

3. The binarized neural network sleep apnea detection method for wearable devices according to claim 1, wherein, The candidate gradient approximation functions in step S3 include the Hard Tanh function, the Learnable Tanh function, the Piecewise function, the FFT function, and the IEE function.

4. The binarized neural network sleep apnea detection method for wearable devices according to claim 1, characterized in that, In step S4, the first convolutional layer of the binarized convolutional neural network retains full-precision activation, while the remaining convolutional layers use binarized weights and binarized activation.

5. The binarized neural network sleep apnea detection method for wearable devices according to claim 1, characterized in that, Step S4 includes: B1: Set the target hardware constraint, which is the upper limit of model storage; B2: Define the candidate network structure search space, which includes at least one of the following: number of convolutional layer channels, kernel size, number of network layers, activation function, and dropout rate; B3: Randomly generate a population of candidate network structures and remove candidate structures that do not meet the target hardware constraints; B4: Based on the optimal gradient approximation function determined in step S3, train or quickly evaluate the candidate network structure, and use the sleep apnea detection accuracy as the fitness evaluation criterion. B5: Perform selection, crossover, and mutation operations on candidate network structures with high fitness to generate a new population of candidate network structures; repeat architecture evaluation, selection, crossover, and mutation until the number of iterations or convergence conditions are reached, and output a binary convolutional neural network structure that meets the hardware constraints.

6. The binarized neural network sleep apnea detection method for wearable devices according to claim 5, characterized in that, The binary convolutional neural network obtained in step B5 is an inverted pyramid structure, meaning that the early convolutional layers have a wider number of channels, while the number of channels in the deeper convolutional layers gradually narrows.

7. The binarized neural network sleep apnea detection method for wearable devices according to claim 1, characterized in that, Step S5 includes: C1: Train the full-precision network corresponding to the target binary convolutional neural network structure determined in step S4, and use the full-precision network for pre-training initialization; C2: Based on the average absolute value of the weights in each convolutional layer, map the full-precision weights to +1 or -1 to initialize the binary convolutional neural network. C3: Set up a quantization-aware normalization module before the binarization sign function. The quantization-aware normalization module is used to linearly adjust the tensor to be binarized, including scaling and translation parameters. C4: Construct the total loss function, which includes a classification loss function and a quantization error loss function. The quantization error loss function is used to constrain the difference between the full-precision weights or activations and their binary representations.

8. The binarized neural network sleep apnea detection method for wearable devices according to claim 1, characterized in that, Step S6 includes: D1: Export the trained binary convolutional neural network parameters as a parameter file that can be read by edge devices; D2: Compress and store the 32 binary weights into a 32-bit integer, achieving bit-packed storage; D3: In the reasoning process, XNOR operation and counting operation are used to replace multiplication and accumulation operation; D4: Perform local inference on the input ECG features and output the judgment result of sleep apnea or normal breathing.