A finger tip PPG and edge computing-based respiratory abnormality detection and early warning method
Patent Information
- Application Number
- CN202610890327.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-08-28
AI Technical Summary
[0004]然而,现有PPG呼吸率估计方案仍存在若干不足
[0036](1) By using frame-level quality gating, low-quality PPG data such as finger removal, jitter, excessive pressure, saturation, zero value and flat segment are blocked outside the model window, which focuses on reducing the misjudgment of low-quality signals.
Smart Images

Figure CN122642845A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for detecting and warning of respiratory abnormalities based on fingertip PPG and edge computing. Background Technology
[0002] Respiratory rate and respiratory status are important indicators for evaluating human physiological condition. Traditional respiratory monitoring typically relies on chest straps, nasal airflow monitoring, carbon dioxide monitoring, pressure sensors, bedside monitoring devices, or polysomnography devices. While these devices offer high accuracy in medical settings, they still suffer from drawbacks in home, mobile, portable, or prolonged wear scenarios, including bulkiness, insufficient wearing comfort, complex deployment, and limited real-time mobile monitoring capabilities.
[0003] Photoplethysmography (PPG) signals can reflect changes in blood volume through points such as the fingertips, wrists, or ears. Human respiration causes amplitude modulation, baseline drift, and changes in pulse interval in PPG signals; therefore, PPG signals can be used for respiratory rate estimation and respiratory status identification. Existing research already includes technical solutions for estimating continuous respiratory rate using PPG, screening low-quality windows using quality indices, performing respiratory-related identification using machine learning or deep learning models, and monitoring vital signs on edge devices or mobile terminals.
[0004] However, existing PPG respiratory rate estimation schemes still have several shortcomings. First, PPG signals are easily affected by finger pressure, contact status, motion artifacts, ambient light, sensor saturation, and local flat segments. If low-quality signals are directly fed into the model, it is easy to cause misjudgments. Second, the single-window method is difficult to balance rapid response and stable confirmation. Short windows are easily affected by spurious peaks, resulting in false alarms, while long windows may retain information from the old window after state switching. Third, existing methods mostly focus on continuous respiratory rate estimation, and the output results may not be suitable for on-site alarm control at the microcontroller end. Fourth, fast and slow breathing are asymmetrically represented in the PPG waveform. If the same confirmation logic is used, it is easy to cause confusion between fast and slow breathing or for normal states to be covered by abnormal states. Fifth, during the switching of breathing states, finger re-application, or detection phase switching, the old data residue in the sliding window may cause the underlying window to continue outputting abnormal labels, thereby directly triggering false alarms from the local alarm module.
[0005] Therefore, there is an urgent need for a fingertip PPG respiratory abnormality graded early warning method for edge real-time early warning scenarios. Based on the existing PPG respiratory rate estimation, this method introduces quality gating, dual-window asymmetric fusion, and alarm freeze protection to prevent low-quality signals, single-window spurious peaks, and old window remnants from state switching from directly triggering alarms. Summary of the Invention
[0006] The present invention provides a respiratory abnormality detection and early warning method based on fingertip PPG and edge computing to solve the problems existing in the prior art.
[0007] The technical solutions adopted in this invention are as follows:
[0008] A respiratory anomaly detection and early warning method based on fingertip PPG and edge computing includes the following steps:
[0009] S1: Acquire fingertip photoplethysmography (PPG) signal data frame;
[0010] S2: Perform frame-level quality gating and finger contact status judgment on the data frame; if it is determined that the finger is in a stable contact state and the signal quality is qualified, execute S3; if it is determined that the finger is not in a stable contact state or the signal quality is insufficient, output the observation state or low quality state accordingly, and prohibit entering S3.
[0011] S3: Construct a first time window and a second time window, where the first time window is a short window and the second time window is a long window, and the duration of the first time window is shorter than the duration of the second time window; classify the respiratory state of the signals within the two time windows respectively to obtain the short window respiratory classification label corresponding to the first time window and the long window respiratory classification label corresponding to the second time window; the respiratory classification labels include slow breathing classification labels, normal breathing classification labels, and fast breathing classification labels;
[0012] S4: Based on the fast breathing strong confirmation, slow breathing guard confirmation, and normal protection, a dual-window asymmetric fusion is performed to obtain the fused state; among which...
[0013] Fast breathing is strongly confirmed as follows: When both the short window breathing classification label and the long window breathing classification label are fast breathing classification labels, fast breathing rule gating is introduced for additional confirmation. If the fast breathing alarm condition is met, the fast breathing alarm status is output; otherwise, the fast breathing warning status or observation status is output.
[0014] Slow breathing protection is defined as follows: when the long window breathing classification label is the slow breathing classification label, slow breathing rule gating and short window normal protection are introduced for additional confirmation. When the slow breathing alarm conditions are met, the slow breathing alarm status is output; otherwise, the slow breathing warning status or observation status is output.
[0015] Normal protection is as follows: when the short window breathing classification label continuously outputs the normal breathing classification label, the long window slow breathing classification label is prohibited from triggering the slow breathing alarm state alone; when the normal breathing confirmation condition is met, the normal breathing confirmation state is output, and the abnormal continuous count and alarm hold state are cleared.
[0016] S5: During the detection process, the system performs protective judgments on changes in finger contact status, signal quality status, and detection phase. When a finger is detected to be removed, re-contacted, or the detection phase is switched, the alarm freeze protection flag is set, the historical window label, historical fusion status, abnormal continuous count, and alarm hold status are cleared, and the local alarm module is prohibited from starting within a preset freeze protection time. When a low-quality status is detected, the abnormal continuous count and alarm update are paused, and the low-quality window results are prohibited from participating in the abnormal alarm confirmation. If the low-quality status continues to reach the preset conditions, the historical output results of the corresponding time window are cleared.
[0017] S6: Combine the triggering result of the alarm freeze protection with the fusion status to output the final graded status; the final graded status includes normal breathing confirmation status, fast breathing warning status, fast breathing alarm status, slow breathing warning status, slow breathing alarm status, observation status, low quality status or switch protection status, and drives the local alarm module in the fast breathing alarm status or slow breathing alarm status.
[0018] Furthermore, the frame-level quality gating includes:
[0019] Calculate the amplitude range, number of saturation points, number of abrupt changes between adjacent sampling points, length of consecutive zero values, and length of consecutive flat segments of the data frame;
[0020] If the amplitude range is less than the preset amplitude threshold, or the number of saturation points is greater than the preset saturation threshold, or the number of abrupt changes between adjacent sampling points is greater than the preset abrupt change threshold, or the length of consecutive zero values is greater than the preset zero value threshold, or the length of consecutive flat segments is greater than the preset flatness threshold, then the data frame is determined to be an invalid frame, and the invalid frame is not used to construct a time window.
[0021] Furthermore, the finger contact state determination includes three levels: finger separation state, finger possible contact state, and finger stable contact state.
[0022] When the finger is removed, the system outputs an observation status and prohibits entry into S3;
[0023] When fingers may be touching, the system accumulates valid frames, outputs the observation status, and does not trigger an alarm.
[0024] With the fingers in a stable contact position, the system executes S3.
[0025] Furthermore, the first time window is a short window of 32 seconds, the second time window is a long window of 64 seconds, and the first time window and the second time window are updated by sliding in 5-second increments.
[0026] Furthermore, the respiratory state classification is performed by a lightweight classification model deployed on an edge computing controller; the lightweight classification model is a random forest model, a decision tree model, a rule tree model, or a lightweight neural network model.
[0027] Furthermore, the rapid breathing rule gating includes:
[0028] Determine whether the energy proportion of the smooth waveform fast breathing frequency band in the second time window is not less than the preset fast breathing energy threshold, whether the fast breathing rule score in the second time window is not less than the preset long window fast breathing score threshold, whether the energy proportion of the trend slow breathing in the second time window is not greater than the preset slow trend threshold, whether the fast breathing rule score in the first time window is not less than the preset first time window fast breathing score threshold, and whether the dominant frequency of the first or second time window is located in the preset fast breathing frequency band.
[0029] Furthermore, the rapid breathing alarm conditions also include:
[0030] The confidence level of the fast breathing classification label output in the first time window is not less than the preset first time window fast breathing confidence threshold and the number of consecutive outputs is not less than the preset first time window fast breathing consecutive number of outputs. The confidence level of the fast breathing classification label output in the second time window is not less than the preset second time window fast breathing confidence threshold and the number of consecutive outputs is not less than the preset second time window fast breathing consecutive number of outputs. Furthermore, the fast breathing rule gating is satisfied within the current judgment period that meets the above continuous confirmation conditions.
[0031] Furthermore, the slow breathing rule gating includes:
[0032] Determine whether the proportion of slow breathing energy in the second time window is not less than the preset slow breathing trend threshold, or whether the slow breathing rule score in the second time window is not less than the preset slow breathing score threshold.
[0033] Furthermore, the slow breathing alarm conditions also include: the confidence level of the slow breathing classification label output by the second time window is not less than the preset second time window slow breathing confidence threshold and the number of consecutive occurrences is not less than the preset second time window slow breathing consecutive occurrences, and there is no normal protection interception.
[0034] Furthermore, in the normal protection, the short window breathing classification label is continuously output as a normal breathing classification label, specifically: the confidence level of the normal breathing classification label output in the first time window is not less than the preset normal confidence level threshold and the number of consecutive outputs is not less than the preset number of consecutive normal outputs.
[0035] The present invention has the following beneficial effects:
[0036] (1) By using frame-level quality gating, low-quality PPG data such as finger removal, jitter, excessive pressure, saturation, zero value and flat segment are blocked outside the model window, which focuses on reducing the misjudgment of low-quality signals.
[0037] (2) By asymmetric fusion of short and long windows, the short window is used to improve the response speed, the long window is used to stabilize the confirmation of anomalies, and the fast and slow breathing differential confirmation conditions are used to reduce false alarms in a single window.
[0038] (3) By using fast breathing strong confirmation gating, slow breathing guard confirmation and normal breathing protection mechanism, a differentiated strategy is adopted for fast breathing and slow breathing to reduce the risk of normal breathing being misjudged as fast breathing by pseudo-fast peak and slow breathing alone covering the normal state in a long window.
[0039] (4) A complete alarm protection system is formed by idle state alarm lock, detection phase switching freeze protection, continuous confirmation and alarm holding mechanism. During the state switching phase, the local alarm module is forcibly observed and closed to shield false alarms caused by old window residue.
[0040] (5) By separating the warning state and the confirmed alarm state, the warning state is only used to display prompts, while the alarm state drives the local alarm module. This retains early risk prompts and reduces alarm interference in the non-confirmed abnormal stage.
[0041] (6) A closed-loop output is formed by a local buzzer, wired serial port and wireless communication module, so that the system can complete real-time data acquisition, edge recognition, on-site alarm and remote display without relying on the cloud. It is suitable for portable health monitoring, home-based auxiliary monitoring and early warning of respiratory abnormalities. Attached Figure Description
[0042] Figure 1 This is a block diagram of the overall architecture of the present invention.
[0043] Figure 2 This is a schematic diagram of the respiratory abnormality detection method of the present invention.
[0044] Figure 3 This is a flowchart of the tiered early warning and alarm state machine.
[0045] Figure 4 This is a schematic diagram of the alarm freeze protection timing.
[0046] Figure 5 This is a comparison diagram of the effects of the method of the present invention and the existing single-window method. Detailed Implementation
[0047] The invention will now be further described with reference to the accompanying drawings.
[0048] This embodiment uses a portable fingertip PPG respiratory abnormality detection device as the application example. The overall system architecture is as follows: Figure 1 As shown, the hardware mainly includes a fingertip PPG acquisition module, an edge computing control module, a local alarm module, and a wired / wireless display module. Among them,
[0049] The fingertip PPG acquisition module uses the JFC103 fingertip PPG sensor and outputs real-time data frames to the edge computing controller via the UART interface. The data frames contain multiple continuous PPG sampling points and can carry auxiliary physiological information such as heart rate and blood oxygen.
[0050] The edge computing controller uses the GD32H759I series microcontroller as the core computing carrier to run complete quality gating, status judgment, signal preprocessing, feature extraction, lightweight classification and fusion early warning algorithms;
[0051] The local alarm module uses an active buzzer, which is connected to the edge computing controller through a general input / output interface to output differentiated local anomaly prompts;
[0052] The wired / wireless display module includes a PC serial port display terminal and a Bluetooth serial port transmission unit, which can receive respiratory grading results, heart rate, blood oxygen and alarm status data output by the edge computing controller, and realize remote visual display and historical record.
[0053] After the system is powered on, the edge computing controller first completes the initialization of serial communication, hardware timers, general input / output interfaces, buzzer drivers and communication modules, outputs system startup status information, and then enters the real-time data reception and processing loop, continuously parsing data frames from the fingertip PPG acquisition module.
[0054] For each received PPG data frame, the system first performs frame-level quality gating detection, calculating five quality indicators for that frame: amplitude range, number of saturation points, number of abrupt changes between adjacent sampling points, length of consecutive zero values, and length of consecutive flat segments. The amplitude range is calculated by the difference between the maximum and minimum values of the sampling points within a single frame. Saturation points are sampling points whose amplitudes are close to the sensor output boundary. Abrupt changes between adjacent sampling points are counted by the number of times the amplitude difference between adjacent sampling points exceeds a preset jump threshold. The length of consecutive zero values is the number of sampling points with continuously zero amplitudes, and the length of consecutive flat segments is the number of consecutive sampling points with amplitude fluctuations less than a preset flatness threshold.
[0055] If a single frame of data meets any of the following conditions: amplitude range is less than a preset amplitude threshold, number of saturation points is greater than a preset saturation threshold, number of abrupt changes between adjacent sampling points is greater than a preset abrupt change threshold, length of consecutive zero values is greater than a preset zero threshold, or length of consecutive flat segments is greater than a preset flatness threshold, then the frame is determined to be an invalid frame. Invalid frames will not enter the subsequent time window construction and classification calculation process and will be discarded directly. Frame-level quality gating can block low-quality data caused by finger removal, shaking, excessive pressure, signal saturation, motion artifacts, etc., from entering the model processing flow, reducing the risk of misjudgment caused by low-quality signals at the source. The relevant mechanism can be found in [reference needed]. Figure 2 The frame-level quality gating part in the system.
[0056] Based on frame-level quality gating, the system synchronously maintains a three-level finger-fitting state machine: finger-off state, finger-potential-fitting state, and finger-stable-fitting state. The system initially operates in the finger-off state, where local alarms are disabled, historical data caches are cleared, and only signal detection and status waiting are performed. When a preset number of valid frames appear consecutively, the system enters the finger-potential-fitting state. In this state, valid data is accumulated and window preheating cache is performed, but no local alarms are triggered; only an observation status prompt is output. When the accumulated number of valid frames reaches a stable threshold, the system enters the finger-stable-fitting state, formally initiating dual-time-window breathing state classification and final state fusion calculation. If a preset number of invalid frames appear consecutively in any state, the system will gradually revert to lower-level states until it returns to the finger-off state, simultaneously clearing historical anomaly counts, window classification labels, and alarm hold states to avoid false alarms caused by finger detachment, shaking, or re-fitting processes.
[0057] When the system is in a stable finger-fitting state, the edge computing controller performs online preprocessing on the valid PPG data entering the processing flow, sequentially completing soft limiting, sliding deDC removal, waveform smoothing, trend extraction, and envelope extraction operations. Soft limiting is used to suppress abnormal spikes in the signal, limiting sampling points exceeding the reasonable physiological range to a preset amplitude range; sliding deDC removal weakens the sensor baseline bias and slow drift through the sliding baseline estimation method, highlighting the periodic changes caused by respiratory modulation; waveform smoothing uses a moving average algorithm to filter the deDC-removed waveform, enhancing the periodic modulation characteristics related to breathing to obtain a smooth waveform; trend extraction extracts the ultra-low frequency baseline change component in the signal through low-pass filtering to obtain a trend waveform, which is used to reflect the slow physiological changes related to slow breathing; envelope extraction obtains the amplitude envelope of the PPG signal through peak connection or Hilbert transform, resulting in an envelope waveform, which is used to reflect the amplitude modulation characteristics caused by breathing. After preprocessing, the system simultaneously obtains multiple signals of the original waveform, smoothed waveform, trend waveform, and envelope waveform, providing a data foundation for subsequent feature construction and rule score calculation.
[0058] The system constructs two sliding time windows of different scales: a first time window (32 seconds) for rapidly capturing changes in respiratory status, and a second time window (64 seconds) for stabilizing and confirming abnormal respiratory states. Both time windows slide and update in approximately 5-second increments, updating the data within each window after each complete slide and performing subsequent feature extraction and classification calculations. This collaborative design of the long and short windows balances state response speed with anomaly confirmation stability, resolving the contradiction between rapid response and low false alarms that is difficult to achieve simultaneously with single-window methods. The dual-window collaborative mechanism can be referenced from [reference needed]. Figure 2 The dual-time-window collaborative component.
[0059] Within each window update cycle, the system extracts features from multiple waveforms in the first and second time windows, and calculates multi-dimensional features such as respiratory-related frequency domain energy, dominant frequency, rule score, trend energy ratio, heart rate statistics, and quality statistics.
[0060] The respiratory state label definition and the frequency band for rule feature extraction are used for different purposes. In the respiratory state label definition, slow breathing can be defined as a respiratory rate of less than 12 bpm, normal breathing can be defined as 12–20 bpm, and fast breathing can be defined as greater than 20 bpm. The above label definitions are used for sample annotation, interpretation of classification results, and description of the final classification state.
[0061] During the rule feature extraction process, the system can calculate the respiratory-related frequency band energy within the range of 6–24 bpm, and divide it into slow breathing-related frequency bands, normal breathing-related frequency bands, and fast breathing-related frequency bands according to the needs of edge-end rule calculation. In one embodiment, 6–12 bpm can be used as the slow breathing-related frequency band, 12–18 bpm as the normal breathing-related frequency band, and 18–24 bpm as the fast breathing-related frequency band, for calculating the window energy ratio and rule score. The rule feature extraction frequency band is only used for edge-end frequency domain feature construction and rule score calculation, and is not equivalent to the medical or application classification boundary of the final respiratory state label. Therefore, the frequency band energy within the range of 18–20 bpm can be used as early trend of fast breathing or evidence of fast breathing to participate in rule gating, but whether to output a fast breathing warning or alarm still needs to be determined by combining dual-window classification labels, confidence level, fast breathing rule gating, number of consecutive confirmations, and alarm freeze protection.
[0062] For the three candidate states of slow breathing, normal breathing, and fast breathing, the system calculates the energy proportion of the envelope waveform, the energy proportion of the smooth waveform, and the energy proportion of the trend waveform in the corresponding frequency band, respectively, and calculates the rule score for the corresponding candidate state using a weighted energy ratio method. The calculation formula is as follows:
[0063] RuleScore(k)=0.25×env_k_ratio+0.35×smooth_k_ratio+0.40×trend_k_ratio,
[0064] In the formula, env_k_ratio is the energy ratio of the envelope waveform in the frequency band corresponding to candidate state k, smooth_k_ratio is the energy ratio of the smooth waveform in the frequency band corresponding to candidate state k, and trend_k_ratio is the energy ratio of the trend waveform in the frequency band corresponding to candidate state k. The value of k corresponds to the three states of slow breathing, normal breathing, and fast breathing.
[0065] The above formulas can be used to calculate the SlowScore, NormalScore, and FastScore of the slow breathing rule, respectively. The SlowScore is used to characterize the evidence strength of the slow breathing-related frequency bands within the window, the NormalScore is used to characterize the evidence strength of the normal breathing-related frequency bands within the window, and the FastScore is used to characterize the evidence strength of the fast breathing-related frequency bands within the window.
[0066] The aforementioned rule score is not the final alarm determination result, but serves two purposes: first, it serves as one of the input features of the lightweight edge AI model to participate in model inference; second, it serves as the gating condition of the final fusion state machine to participate in abnormal state confirmation.
[0067] For time windows of different lengths, the system constructs differentiated input feature sets. For the first time window of 32 seconds, the system uses three types of rule scores—SlowScore, NormalScore, and FastScore—as core features, combined with features such as trend energy proportion, envelope dominant frequency, smooth waveform frequency band proportion, heart rate statistics, and quality statistics to form the input feature set for the short window model, focusing on rapidly sensing changes in respiratory status. For the second time window of 64 seconds, the system uses FastScore and SlowScore as core features, combined with features such as smooth waveform dominant frequency, fast respiratory frequency band energy proportion, and trend slow respiratory energy proportion to form the input feature set for the long window model, focusing on stabilizing and confirming abnormal respiratory states.
[0068] The aforementioned multi-dimensional feature inputs are deployed in a lightweight classification model of the edge computing controller to complete the classification inference of breathing states. The lightweight classification model can take various forms such as random forest, decision tree, rule tree, or lightweight neural network. After being trained on an offline dataset, it is deployed to the edge computing controller in a lightweight format adapted to the operation of the microcontroller.
[0069] After inference, the model outputs breathing classification labels and three probability results for each time window. The breathing classification labels include slow breathing, normal breathing, and fast breathing; the three probability results correspond to the probabilities of slow breathing, normal breathing, and fast breathing, respectively. To facilitate integer processing on the microcontroller side, the three probabilities can be converted to integer values in the range of 0 to 1000, and the maximum value among the three probabilities is used as the confidence score of the classification result for that window. It should be noted that the classification labels and confidence scores output by the lightweight model are only preliminary window-level judgment results and are not directly equivalent to the final alarm state. They need to be input into the final fusion state machine for multi-dimensional comprehensive judgment.
[0070] The final fusion state machine employs a dual-window asymmetric fusion strategy, combining the output results of the first and second time windows, classification confidence, rule scores, low-quality gating results, normal protection conditions, number of consecutive acknowledgments, and frozen protection status to comprehensively determine the final output state. The asymmetric acknowledgment mechanism can be referenced from [reference needed]. Figure 2 The asymmetric confirmation of fast and slow breathing in the text, and the overall state transition logic can be found by referring to... Figure 3 As shown.
[0071] For rapid breathing, the system employs a strong confirmation strategy, performing rapid breathing rule gating verification only when both the first and second time windows output rapid breathing classification labels. In this embodiment, rapid breathing rule gating includes: the proportion of rapid breathing frequency band energy in the smooth waveform of the second time window is not less than 0.550, the rapid breathing rule score of the second time window is not less than 0.500, the proportion of slow breathing energy in the trend of the second time window is not greater than 0.350, the rapid breathing rule score of the first time window is not less than 0.420, and at least one of the dominant frequency of the first time window envelope, the dominant frequency of the first time window trend, or the dominant frequency of the second time window smooth waveform is within the range of 18–24 bpm.
[0072] By using the above multi-dimensional constraints, misjudgments caused by false peaks and octave peaks in normal breathing or slow breathing stages that are further divided into three sub-frequency bands can be effectively suppressed.
[0073] During the rapid breathing state confirmation process, if both windows output rapid breathing labels but the continuous confirmation requirement has not yet been met, the system outputs a rapid breathing warning state, providing a warning only on the display and not triggering a local buzzer alarm. When the confidence level of the rapid breathing classification label output by the first time window is not less than 800 and the consecutive satisfaction count is not less than 3 times, and the confidence level of the rapid breathing classification label output by the second time window is not less than 780 and the consecutive satisfaction count is not less than 3 times, and the rapid breathing rule gating is met within the current judgment period, the system enters the rapid breathing alarm pending confirmation state. The above window-level continuous confirmation constitutes the first level of anti-shake mechanism. Based on this, a second level of anti-shake verification is required through abnormal alarm counting. When the abnormal alarm count accumulates to a preset threshold of 2 times, the fusion state machine finally outputs a rapid breathing alarm state, driving the local alarm module to start. If the rapid breathing rule gating is not fully met, or there is a conflict in the classification results of the two windows, the system outputs a rapid breathing warning state or observation state, without triggering a local alarm.
[0074] For slow breathing, the system employs a strategy combining safeguard confirmation and normal protection. Slow breathing is typically characterized by a low dominant frequency, a strong trend of slow change, and a high slow breathing rule score. When the second time window outputs a slow breathing classification label, the system does not directly trigger a slow breathing alarm. Instead, it first verifies the slow breathing rule gating: when the proportion of trending slow breathing energy in the second time window is not less than 0.600, or the slow breathing rule score in the second time window is not less than 0.580, it is considered that the evidence of slow breathing is strong.
[0075] The system also includes a normal protection mechanism to prevent the normal state from being mistakenly overwritten due to residual historical data from long windows. When the first time window continuously outputs a high-confidence normal breathing classification label (i.e., the confidence level of the first time window's normal breathing classification label is not less than 800 and the condition is met at least twice consecutively), the system activates normal protection, prohibiting the slow breathing classification result of the second time window from triggering a slow breathing alarm state independently. If the first time window outputs a slow breathing classification label, and the confidence level of the slow breathing classification label is not less than 800 and the condition is met at least twice consecutively, it is determined that there is also evidence supporting slow breathing in the short window. When the second time window outputs a slow breathing classification label, the slow breathing rule gating is met, and there is no normal protection interception, the system confirms the slow breathing alarm according to two scenarios: the first scenario is that the confidence level and the number of consecutive confirmations of the slow breathing classification label in the second time window both reach the preset requirements; the second scenario is that the first time window also outputs a slow breathing classification label, and the confidence level and the number of consecutive confirmations of the slow breathing classification label in the first time window both reach the preset requirements, while the slow breathing classification label in the second time window reaches the preset strong confidence requirement. When any of the above conditions are met, the final fusion state machine outputs a slow breathing alarm state, driving the local alarm module to start.
[0076] For normal breathing states, the system is configured with a normal confirmation and alarm deactivation mechanism. When a high-confidence normal breathing classification label is continuously output in the first time window, or when both the first and second time windows output normal breathing classification labels, and no abnormal gating conditions for rapid or slow breathing are met, the system outputs a normal breathing confirmation status, simultaneously clears the continuous counts of rapid and slow breathing abnormalities, the alarm count, and the warning hold status, and disables the local alarm module. Therefore, the normal breathing classification result not only serves as a basis for physiological state determination but also provides protection by clearing abnormalities, deactivating alarms, and suppressing false alarms related to slow breathing.
[0077] The system is equipped with an alarm freeze protection mechanism to prevent false alarms caused by residual old data in the sliding window during the detection phase switching process. The relevant timing logic can be found in [reference needed]. Figure 4 As shown.
[0078] In this embodiment, the detection phase switching does not refer to the inspiratory or expiratory phases in the human respiratory cycle, but rather to the phase changes that occur between the system detection process, experimental modes, or candidate respiratory states. Detection phase switching can be triggered in two ways:
[0079] One type is triggered by external input, that is, the host computer, mobile terminal or debugging command sends a mode or stage flag to the edge computing controller to realize the switching between normal breathing test, fast breathing test, slow breathing test or idle stage;
[0080] Another type is automatically triggered by the system's internal state machine, where the system automatically identifies changes in the detection phase based on the finger's contact state and signal quality. Internal triggering conditions include: the finger state recovering from a finger-off or low-quality state to a stable finger-contact state; the signal quality recovering from low quality to a valid signal and re-meeting the window calculation conditions; the system transitioning from an idle or observation state to a formal detection state; or the detection phase flag being reset. For common short- and long-window classification result conflicts, short-term changes in candidate breathing states, or abnormal states returning to normal, the system can enter an observation state or switch to a protection state for transient suppression, but it does not necessarily perform complete historical window label and historical fusion state clearing.
[0081] When the aforementioned external triggering conditions or internal complete freeze triggering conditions occur, the edge computing controller immediately clears the historical window classification labels, historical fusion states, continuous counts of rapid breathing abnormalities, continuous counts of slow breathing abnormalities, and alarm counts, and enters a freeze protection period of a preset duration. In this embodiment, the freeze protection duration is preferably set to 40 seconds. During the freeze protection period, the system forcibly outputs the observation state or the switch protection state. Even if the bottom-level first time window or second time window outputs rapid breathing or slow breathing classification labels due to old data residue, the local alarm module remains closed. In addition, during the idle state, low-quality state, low-confidence state, observation state, switch protection state, or freeze protection period, the system does not trigger local alarms and does not accumulate abnormal continuous counts. When the signal quality recovers, the finger re-enters a stable contact state, and the window calculation conditions are met, the system restarts the continuous confirmation count.
[0082] The system's final output status includes: normal breathing confirmation status, rapid breathing warning status, rapid breathing alarm status, slow breathing warning status, slow breathing alarm status, observation status, low-quality status, and switching protection status. The warning status is only used for risk indication on the display and does not drive the local buzzer; the alarm status is a confirmed abnormal status after multi-layer verification and can drive the local buzzer to output an alarm indication.
[0083] The local alarm module is implemented using a non-blocking state machine, with different alarm rhythms corresponding to different anomaly types: a short-cycle, high-frequency, fast-paced buzzer is used in the rapid breathing alarm state, while a long-cycle, low-frequency, slow-paced buzzer is used in the slow breathing alarm state. The buzzer state is updated based on the system time base, without using long-term blocking delays, thus not affecting the real-time operation of PPG data reception, window updates, and model inference. When the final state returns to the normal breathing confirmation state, enters the observation state, enters the low-quality state, enters the switching protection state, enters the idle state, or enters the freeze protection period, the system immediately shuts down the local buzzer.
[0084] The edge computing controller can output detection results via a wired serial port or a wireless communication module. In this embodiment, a Bluetooth serial port module is used for wireless transmission. The edge computing controller periodically or when its status changes sends data frames containing respiratory grading results, heart rate, blood oxygen saturation, and alarm status. In one embodiment, the data frame format is exemplified by "RESULT,SLOW_ALARM,HR=83,SPO2=99,BUZZER=ON", which is then parsed by a mobile Bluetooth serial port assistant or mobile application to display the Chinese status, heart rate, blood oxygen saturation, and alarm status.
[0085] The PC can receive raw waveforms, smoothed waveforms, trend waveforms, and final status data via serial port to build a real-time waveform display interface. Wired and wireless display terminals only perform display and recording functions and do not participate in core algorithm calculations. The entire detection and early warning process can be completed locally in a closed loop on the edge computing controller.
[0086] In the test and verification embodiment, self-collected fingertip PPG data and publicly available datasets can be used to construct training and verification samples. Traditional continuous respiratory rate estimation methods and single-window three-classification methods are compared with the quality gating, dual-window asymmetric fusion, and alarm freeze protection scheme of this embodiment. The comparison results can be found in [reference needed]. Figure 5 As shown. The verification results can demonstrate the technical effectiveness of this solution from three dimensions:
[0087] First, low-quality windows are judged as low-quality states or observation states, and abnormal classification is not forced, which effectively suppresses misjudgments caused by low-quality signals.
[0088] Second, after the asymmetric fusion of long and short windows, the false alarms of rapid breathing caused by short-term spurious peaks are significantly suppressed, reducing the false alarm probability of the single-window method.
[0089] Third, the observation status is output and the buzzer alarm is disabled during the switching of the detection phase or the conflict of window results, so as to avoid the residual data of the old window directly triggering false alarms.
[0090] In a set of publicly available datasets, the average absolute error of the traditional continuous breathing rate regression method is approximately 4.39 bpm. After reconstructing the task into three categories—slow breathing, normal breathing, and fast breathing—and combining multi-source data fusion training, the accuracy of the publicly available dataset test can be improved from approximately 53.13% to approximately 74.10%, verifying the technical advantages of this solution for edge real-time early warning scenarios.
[0091] It should be understood that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Those skilled in the art can adjust or replace the model of the fingertip PPG acquisition module, the type of edge computing controller, the time window length, the quality gating threshold, the fast and slow breathing judgment parameters, the freeze protection duration, and the alarm rhythm based on the principles of the present invention. As long as the technical concepts of fingertip PPG edge quality gating, dual-window asymmetric fusion, alarm freeze protection, hierarchical early warning, and local wireless alarm closed loop are adopted, they should all fall within the protection scope of the present invention.
[0092] The above description is only a preferred embodiment of the present invention. It should be noted that those skilled in the art can make several improvements without departing from the principle of the present invention, and these improvements should also be considered within the scope of protection of the present invention.
Claims
1. A method for detecting and warning of respiratory abnormalities based on fingertip PPG and edge computing, characterized in that: Includes the following steps: S1: Acquire fingertip photoplethysmography (PPG) signal data frame; S2: Perform frame-level quality gating and finger contact status judgment on the data frame; if it is determined that the finger is in a stable contact state and the signal quality is qualified, execute S3; if it is determined that the finger is not in a stable contact state or the signal quality is insufficient, output the observation state or low quality state accordingly, and prohibit entering S3. S3: Construct a first time window and a second time window, where the first time window is a short window and the second time window is a long window, and the duration of the first time window is shorter than the duration of the second time window; classify the respiratory state of the signals within the two time windows respectively to obtain the short window respiratory classification label corresponding to the first time window and the long window respiratory classification label corresponding to the second time window; the respiratory classification labels include slow breathing classification labels, normal breathing classification labels, and fast breathing classification labels; S4: Based on the fast breathing strong confirmation, slow breathing guard confirmation, and normal protection, a dual-window asymmetric fusion is performed to obtain the fused state; among which... Fast breathing is strongly confirmed as follows: When both the short window breathing classification label and the long window breathing classification label are fast breathing classification labels, fast breathing rule gating is introduced for additional confirmation. If the fast breathing alarm condition is met, the fast breathing alarm status is output; otherwise, the fast breathing warning status or observation status is output. Slow breathing protection is defined as follows: when the long window breathing classification label is the slow breathing classification label, slow breathing rule gating and short window normal protection are introduced for additional confirmation. When the slow breathing alarm conditions are met, the slow breathing alarm status is output; otherwise, the slow breathing warning status or observation status is output. Normal protection is as follows: when the short window breathing classification label continuously outputs the normal breathing classification label, the long window slow breathing classification label is prohibited from triggering the slow breathing alarm state alone; when the normal breathing confirmation condition is met, the normal breathing confirmation state is output, and the abnormal continuous count and alarm hold state are cleared. S5: During the detection process, when a finger is detected to be removed or the detection phase is switched, the alarm freeze protection is executed, the historical window label, historical fusion status, abnormal continuous count and alarm hold status are cleared, the observation status or the protection status is forced to be output, and the local alarm module is prohibited from starting; when a low quality status is detected, the abnormal continuous count is paused, the low quality status is output and the local alarm module is prohibited from starting. S6: Combine the triggering result of the alarm freeze protection with the fusion status to output the final graded status; the final graded status includes normal breathing confirmation status, fast breathing warning status, fast breathing alarm status, slow breathing warning status, slow breathing alarm status, observation status, low quality status or switch protection status, and drives the local alarm module in the fast breathing alarm status or slow breathing alarm status.
2. The respiratory anomaly detection and early warning method based on fingertip PPG and edge computing as described in claim 1, characterized in that: The frame-level quality gating includes: Calculate the amplitude range, number of saturation points, number of abrupt changes between adjacent sampling points, length of consecutive zero values, and length of consecutive flat segments of the data frame; If the amplitude range is less than the preset amplitude threshold, or the number of saturation points is greater than the preset saturation threshold, or the number of abrupt changes between adjacent sampling points is greater than the preset abrupt change threshold, or the length of consecutive zero values is greater than the preset zero value threshold, or the length of consecutive flat segments is greater than the preset flatness threshold, then the data frame is determined to be an invalid frame, and the invalid frame is not used to construct a time window.
3. The respiratory anomaly detection and early warning method based on fingertip PPG and edge computing as described in claim 1, characterized in that: The finger contact state judgment includes three levels: finger separation state, finger possible contact state, and finger stable contact state. When the finger is removed, the system outputs an observation status and prohibits entry into S3; When fingers may be touching, the system accumulates valid frames, outputs the observation status, and does not trigger an alarm. With the fingers in a stable contact position, the system executes S3.
4. The respiratory anomaly detection and early warning method based on fingertip PPG and edge computing as described in claim 1, characterized in that: The first time window is a short window of 32 seconds, and the second time window is a long window of 64 seconds. The first time window and the second time window are updated by sliding in 5-second increments.
5. The respiratory anomaly detection and early warning method based on fingertip PPG and edge computing as described in claim 1, characterized in that: The respiratory state classification is performed by a lightweight classification model deployed on an edge computing controller; the lightweight classification model is a random forest model, a decision tree model, a rule tree model, or a lightweight neural network model.
6. The respiratory anomaly detection and early warning method based on fingertip PPG and edge computing as described in claim 1, characterized in that: The rapid breathing rule gating includes: Determine whether the energy proportion of the smooth waveform fast breathing frequency band in the second time window is not less than the preset fast breathing energy threshold, whether the fast breathing rule score in the second time window is not less than the preset long window fast breathing score threshold, whether the energy proportion of the trend slow breathing in the second time window is not greater than the preset slow trend threshold, whether the fast breathing rule score in the first time window is not less than the preset first time window fast breathing score threshold, and whether the dominant frequency of the first or second time window is located in the preset fast breathing frequency band.
7. The respiratory anomaly detection and early warning method based on fingertip PPG and edge computing as described in claim 6, characterized in that: The rapid breathing alarm conditions also include: The confidence level of the fast breathing classification label output in the first time window is not less than the preset first time window fast breathing confidence threshold and the number of consecutive outputs is not less than the preset first time window fast breathing consecutive number of outputs. The confidence level of the fast breathing classification label output in the second time window is not less than the preset second time window fast breathing confidence threshold and the number of consecutive outputs is not less than the preset second time window fast breathing consecutive number of outputs. Furthermore, the fast breathing rule gating is satisfied within the current judgment period that meets the above continuous confirmation conditions.
8. The respiratory anomaly detection and early warning method based on fingertip PPG and edge computing as described in claim 1, characterized in that: The slow breathing rule gating includes: Determine whether the proportion of slow breathing energy in the second time window is not less than the preset slow breathing trend threshold, or whether the slow breathing rule score in the second time window is not less than the preset slow breathing score threshold.
9. The respiratory anomaly detection and early warning method based on fingertip PPG and edge computing as described in claim 8, characterized in that: The slow breathing alarm conditions also include: the confidence level of the slow breathing classification label output by the second time window is not less than the preset second time window slow breathing confidence threshold and the number of consecutive occurrences is not less than the preset second time window slow breathing consecutive occurrences, and there is no normal protection interception.
10. The respiratory anomaly detection and early warning method based on fingertip PPG and edge computing as described in claim 1, characterized in that: In the normal protection, the short window breathing classification label is continuously output as a normal breathing classification label. Specifically, the confidence level of the normal breathing classification label output in the first time window is not less than the preset normal confidence level threshold and the number of consecutive outputs is not less than the preset number of consecutive normal outputs.