A baby sleep automatic recognition feedback method and system

CN122531727APending Publication Date: 2026-08-07ANHUI RUIJI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI RUIJI INTELLIGENT TECH CO LTD
Filing Date
2026-04-27
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0004]本发明的目的在于提供一种婴幼儿睡眠自动识别反馈方法及系统,用于解决现有监护设备识别精度低、反馈滞后且无法实现环境自适应调节的技术问题

Benefits of technology

第一,本发明通过多模态传感器阵列的协同部署和高精度时间同步机制,实现了生理信号与环境信号的全面采集,该部署方式既适用于固定式婴儿床,也适用于移动式婴儿车,拓宽了产品的使用场景。压电陶瓷传感器、三维加速度传感器、温湿度传感器、光照传感器和驻极体麦克风的组合配置,覆盖了婴幼儿睡眠监测所需的核心参数。主控单元采用STM32F407微控制器,通过DMA方式实现多通道数据的并行采集与时间戳标记,确保各模态数据的时间对齐精度在1ms以内,为后续多模态融合提供了精准对齐的数据基础。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122531727A_ABST
    Figure CN122531727A_ABST
Patent Text Reader

Abstract

The application discloses a kind of infant sleep automatic identification feedback method and system, belong to infant monitoring technical field.The method includes through data acquisition module, physiological signal and environmental signal of baby in sleep process are collected, and it is differentially preprocessed, obtain physiological time series data and environmental parameter, based on sleep state identification module, the sign feature and environmental context feature of physiological time series data and environmental parameter are extracted, and sign feature and environmental context feature are fused, based on fusion feature, infant sleep state is identified, obtain current sleep state, based on feedback execution module, according to the current sleep state of infant and the preset comfort threshold range, environmental control instruction is calculated, according to environmental control instruction, the corresponding feedback operation of driving associated terminal equipment is executed.The present application realizes the accurate identification of infant sleep state and the adaptive optimization of sleep environment, significantly improves the sleep quality and care efficiency of infant.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of infant and toddler monitoring technology, specifically to an automatic sleep recognition and feedback method and system for infants and toddlers. Background Technology

[0002] The quality of an infant's sleep directly affects their growth and development, the maturation of their immune system, and the development of their nervous system. However, infants cannot accurately express their discomfort during sleep verbally. Traditional infant monitoring devices, such as audio or video monitors, can only transmit audio-visual information unidirectionally to the caregiver, who then subjectively assesses the infant's condition and decides whether to intervene. This approach not only increases the caregiver's mental burden but also results in a delayed response, making it difficult to optimize the infant's sleep environment in a timely and accurate manner.

[0003] In existing technologies, some smart mattresses or monitoring devices have been proposed. For example, piezoelectric sensors detect heart rate or body movement and trigger an alarm based on a preset simple threshold. However, these methods typically rely on only a single-dimensional physiological signal, failing to adequately consider environmental factors. Furthermore, simple threshold judgments struggle to accurately distinguish complex sleep stages (such as body movement during light sleep versus wakefulness), leading to high false alarm rates and an inability to provide refined environmental adaptive adjustments. In addition, the raw signals collected by sensors often contain various noises, including power frequency interference, motion artifacts, and environmental noise, which can severely impact the accuracy of subsequent sleep state recognition if used directly. How to perform targeted preprocessing of multimodal sensor signals to extract high-quality, clean signals is a critical problem that current technology urgently needs to solve. Summary of the Invention

[0004] The purpose of this invention is to provide an automatic sleep recognition and feedback method and system for infants and young children, which solves the technical problems of low recognition accuracy, delayed feedback, and inability to achieve environmental adaptive adjustment in existing monitoring devices.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: An automatic sleep recognition and feedback method for infants and young children includes: Step S1: Collect physiological and environmental signals of the infant during sleep through the data acquisition module, and perform differential preprocessing to obtain standardized physiological time-series data and environmental parameters; Step S2: Extract physiological time series data and environmental parameters, as well as environmental context features, based on the sleep state recognition module. Then, fuse the physiological time series data and environmental context features, and use the fused features to identify the infant's sleep state to obtain the infant's current sleep state. Step S3: Based on the current sleep state of the infant and toddler and the preset comfort threshold range, the feedback execution module calculates the environmental control command and drives the associated terminal device to perform the corresponding feedback operation according to the environmental control command.

[0006] Furthermore, in step S1, the physiological signals include the original vibration signals, triaxial acceleration data, and environmental noise signals; the environmental signals include temperature and humidity data and light intensity data.

[0007] Further, in step S1, the differentiation process includes: The original vibration signal was filtered using a Chebyshev Type I bandpass filter. After the filtering was completed, adaptive wavelet threshold denoising was performed, followed by normalization to obtain the pre-processed piezoelectric signal. For triaxial acceleration data, the resultant acceleration is calculated, and a sliding window midpoint filter is used to remove isolated impulse noise. A dynamic threshold is calculated based on the mean and standard deviation of the resultant acceleration within the historical window. Adaptive threshold segmentation is performed based on the dynamic threshold, and the motion interval and static interval are normalized respectively to obtain the preprocessed motion signal. The temperature, humidity and light data are smoothed by exponential weighted moving average filtering, and then normalized to obtain the environmental parameter vector. For environmental noise signals, a recursive averaging algorithm based on minimum statistics is used to estimate the noise power spectrum and perform Wiener filtering. The short-time energy of the filtered signal is calculated frame by frame and converted into decibel values. Finally, normalization is performed to obtain the preprocessed noise signal. The preprocessed piezoelectric signals, body motion signals, and noise signals are spliced ​​together in the time dimension to form physiological time-series data.

[0008] Further, in step S2, the physiological time-series data and environmental parameters are extracted based on the sleep state recognition module, and the physiological characteristics and environmental context features are fused. The fused features are then used to identify the infant's sleep state. Specifically: The sleep state recognition module has a built-in dual-stream feature extraction network and a sleep state classification network. The dual-stream feature extraction network extracts physiological time-series data and environmental parameters, as well as the physical characteristics and environmental context features. The physical characteristics and environmental context features are fused in a multimodal manner, and the fused features are input into the sleep state classification network to recognize the sleep state of infants and young children.

[0009] Furthermore, based on a dual-stream feature extraction network, physiological time-series data and environmental parameters are extracted to obtain vital signs and environmental context features, specifically: The dual-stream feature extraction network includes a first network and a second network; Multi-scale features of physiological time-series data are extracted through the multi-scale temporal convolution module of the first network. This multi-scale temporal convolution module employs four parallel convolutional branches with kernel sizes of [sizes to be filled in]. The outputs of each branch are spliced ​​together and then passed through... Convolutional dimensionality reduction yields multi-scale features; The first network uses a bidirectional long short-term memory network module to take multi-scale features as input, extracts temporal dependency features through forward and backward long short-term memory networks, and performs time-dimensional average pooling. Channel attention weights are generated through the adaptive channel attention module of the first network, and then multiplied element-wise with the features after average pooling in the time dimension, and residual connections are added to obtain the vital signs features. The environmental parameter vector is mapped to environmental context features through a multilayer perceptron in the second network.

[0010] Furthermore, multimodal fusion of vital signs and environmental context features is performed, specifically as follows: The multi-head cross-attention submodule uses vital signs as queries and environmental context features as keys and values. It calculates the fusion features after environmental modulation through multiple attention heads, and obtains the cross-attention fusion features by using residual connections and layer normalization. The adaptive gating fusion submodule concatenates the vital signs, environmental context features, and cross-attention fusion features, and then generates gating weights through a gating network. The gating weights are then multiplied element-wise with the cross-attention fusion features to obtain the optimized fusion features.

[0011] Furthermore, the fused features are input into a sleep state classification network for infant sleep state recognition, specifically as follows: The optimized fusion features are input into the sleep state classification network. The probability distribution of infants and young children in various sleep states is calculated through two hidden layers and one output layer. The category corresponding to the maximum probability is taken as the current sleep state.

[0012] Further, in step S3, the feedback execution module calculates environmental control instructions based on the infant's current sleep state and a preset comfort threshold range, and drives the associated terminal device to execute corresponding feedback operations according to the environmental control instructions, specifically: Based on the current sleep state, query the comfort mapping table to obtain the corresponding ideal temperature and humidity range, light limit, and noise limit; The confidence index is calculated based on the probability distribution. When the confidence index is less than the preset threshold, the control command of the previous cycle remains unchanged. otherwise: Based on the deviation between the current ambient temperature and the ideal temperature range, the PID controller calculates the temperature adjustment amount and generates the target temperature command. Based on the deviation between the current ambient humidity and the ideal humidity range, the humidity adjustment amount is calculated by the PID controller, and the target humidity command is generated. When the current lighting or noise exceeds the corresponding limit, generate a command to dim the lights or play a masking noise command. When the current sleep state is an awake state and the continuous duration exceeds the preset threshold, a lullaby or white noise is selected to be played based on the crying detection result, and the playback stops when the state is not awake. The control commands are encapsulated in JSON format and sent to the associated terminal devices via Wi-Fi / MQTT, ZigBee, Bluetooth, or infrared protocols, and a command debouncing, merging, and acknowledgment retransmission strategy is adopted.

[0013] The present invention also provides an automatic sleep recognition and feedback system for infants and young children, applied to the above-mentioned automatic sleep recognition and feedback method for infants and young children, comprising: a data acquisition module, a sleep state recognition module and a feedback execution module connected in sequence; The data acquisition module is used to collect physiological and environmental signals of infants during sleep, and to perform differentiated preprocessing to obtain standardized physiological time-series data and environmental parameters. The sleep state recognition module is used to extract physiological time-series data and environmental parameters, as well as the vital signs and environmental context features, and to fuse the vital signs and environmental context features. Based on the fused features, the sleep state of infants and young children is recognized to obtain the current sleep state of the infants and young children. The feedback execution module is used to calculate environmental control instructions based on the infant's current sleep state and a preset comfort threshold range, and drive the associated terminal device to perform corresponding feedback operations according to the environmental control instructions.

[0014] Furthermore, the data acquisition module includes a differential preprocessing module and a multimodal sensor array deployed around the infant bed and stroller. The multimodal sensor array is connected to the differential preprocessing module, and the differential preprocessing module is connected to the sleep state recognition module.

[0015] Furthermore, the multimodal sensor array includes a piezoelectric ceramic sensor, a three-dimensional accelerometer, a temperature and humidity sensor, a light sensor, and an electret microphone; When applied to an infant bed, the piezoelectric ceramic sensor is built into the center of a rigid support plate under the mattress, the three-dimensional acceleration sensor is set at the corner of the mattress, the temperature and humidity sensor and the light sensor are deployed 50cm above the infant bed, and the electret microphone is deployed on the side of the bed away from the infant's head. When applied to strollers, the piezoelectric ceramic sensor is built under the stroller seat cushion or inside the stroller body structure, the three-dimensional acceleration sensor is built under the stroller seat cushion or in the backrest, the temperature and humidity sensor and the light sensor are deployed above or on the side of the stroller canopy, and the electret microphone is deployed on the side of the stroller away from the infant's head. The piezoelectric ceramic sensor, three-dimensional accelerometer, temperature and humidity sensor, light sensor, and electret microphone are connected to the differential preprocessing module.

[0016] In summary, the present invention has at least one of the following beneficial technical effects: First, this invention achieves comprehensive acquisition of physiological and environmental signals through the collaborative deployment of a multimodal sensor array and a high-precision time synchronization mechanism. This deployment method is applicable to both fixed cribs and mobile strollers, broadening the product's usage scenarios. The combined configuration of piezoelectric ceramic sensors, three-dimensional accelerometers, temperature and humidity sensors, light sensors, and electret microphones covers the core parameters required for infant sleep monitoring. The main control unit uses an STM32F407 microcontroller, which achieves parallel acquisition and timestamping of multi-channel data through DMA, ensuring that the time alignment accuracy of each modality's data is within 1ms, providing a precise data foundation for subsequent multimodal fusion.

[0017] Secondly, this invention designs differentiated preprocessing operations for different types of sensor signals based on their physical characteristics and noise sources, significantly improving signal quality. For piezoelectric signals, Chebyshev bandpass filtering combined with adaptive wavelet thresholding is used for denoising. The threshold is dynamically determined based on Stein unbiased likelihood estimation, avoiding information loss or noise residue caused by fixed thresholds and effectively preserving the waveform characteristics of heartbeat and respiration. For body movement signals, adaptive threshold segmentation based on sliding window statistics is introduced. The threshold is dynamically calculated based on the mean and standard deviation of historical data, which can adaptively distinguish between static and dynamic intervals, adapting to the differences in body movement intensity among different infants. For environmental signals, exponentially weighted moving average filtering is used, which suppresses instantaneous fluctuations while preserving trend changes, with minimal computational cost, making it suitable for embedded implementation. For noise signals, recursive average noise estimation based on minimum statistics and Wiener filtering are used, which can adaptively track non-stationary noise environments and improve the accuracy of sound activity detection under low signal-to-noise ratio conditions. These differentiated preprocessing operations work together to provide a high-quality data foundation for sleep state recognition.

[0018] Third, this invention constructs an innovative dual-stream feature extraction network, in which the first network comprises a multi-scale temporal convolution module, a bidirectional long short-term memory network module, and an adaptive channel attention module. The multi-scale temporal convolution module employs four parallel convolutional branches with kernel sizes of 1×3, 1×10, 1×30, and 1×60, corresponding to capturing physiological patterns at four different time scales: instantaneous changes in heart rate, respiratory cycle, duration of body movement, and transitions between sleep stages, thus possessing clear physiological significance. The bidirectional long short-term memory network module performs temporal modeling of multi-scale features, capturing the transition patterns between sleep stages and effectively distinguishing between the transition from deep sleep to light sleep and the increase in body movement before wakefulness. The adaptive channel attention module generates channel weights through a lightweight fully connected network, dynamically enhancing the expression of key physiological features while using residual connections to preserve original features and avoid excessive information suppression by the attention mechanism. The collaborative work of these three modules enables the first network to accurately extract discriminative physiological features.

[0019] Fourth, this invention proposes a multimodal feature fusion method based on multi-head cross-attention and adaptive gating. The multi-head cross-attention submodule uses physiological features as queries and environmental features as keys and values. It calculates the modulation weights of environmental information on physiological features through multiple attention heads, enabling the model to dynamically adjust its understanding of physiological signals according to the current environmental conditions. For example, it pays more attention to changes in respiratory rate in high-temperature environments and reduces sensitivity to slight body movements in noisy environments. The adaptive gating fusion submodule inputs the original physiological features, environmental features, and fused features into the gating network to generate dynamic gating weights. When there is a conflict between environmental features and physiological features, the indirect influence of environmental features is reduced; when the fused features are consistent with the original physiological features, the fused features are retained, achieving an adaptive balance of multi-source information. Compared to traditional feature concatenation or fixed-weight fusion, this fusion method significantly improves the robustness and generalization ability of the model.

[0020] Fifth, this invention designs a closed-loop feedback control mechanism based on state perception. A dynamic mapping relationship between sleep state and environmental parameters is established through a comfort mapping table, enabling environmental adjustment strategies to adapt to different sleep states. For example, lower temperature and light levels are maintained during deep sleep, while slightly higher light levels are allowed during wakefulness to facilitate caregiver intervention. A confidence assessment unit is introduced, calculating a confidence index based on probability distribution, and adjustments are made only when the recognition result is reliable, effectively avoiding erroneous adjustments due to misidentification. A PID controller is used to continuously adjust temperature and humidity, combined with a dead-zone control strategy, acting only when parameters deviate from the ideal range, avoiding temperature fluctuations and energy waste caused by frequent start-stop cycles in traditional constant temperature control. Threshold triggering is used to control light and noise, with simple and reliable logic. A soothing audio trigger unit is added, which adaptively plays different types of audio based on crying detection results when the wakefulness state continues for an extended period, achieving personalized soothing intervention.

[0021] Sixth, this invention realizes a complete closed-loop control system from perception to decision-making to execution. The data acquisition module continuously collects environmental parameters and provides real-time feedback, the sleep state recognition module outputs a new sleep state every 15 seconds, and the feedback execution module dynamically adjusts the environment according to the state changes. The adjusted environmental parameters are then sensed by the acquisition module and may change the infant's sleep state, forming a closed-loop optimization. For example, when an infant transitions from deep sleep to light sleep, a slightly higher ambient temperature may cause discomfort. After detecting the light sleep state, the system will appropriately lower the temperature to help the infant maintain sleep or return to deep sleep. This closed-loop adjustment mechanism can adaptively maintain the optimal sleep environment. Attached Figure Description

[0022] Figure 1 This is a schematic diagram of the method flow of the present invention; Figure 2 This is a block diagram of the system structure of the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0024] like Figure 2 As shown, the present invention provides an automatic sleep recognition and feedback system for infants and young children, comprising: a data acquisition module, a sleep state recognition module, and a feedback execution module connected in sequence; The data acquisition module is used to collect physiological and environmental signals of infants during sleep, and to perform differentiated preprocessing to obtain standardized physiological time-series data and environmental parameters. The sleep state recognition module is used to extract physiological time-series data and environmental parameters, as well as the vital signs and environmental context features, and to fuse the vital signs and environmental context features. Based on the fused features, the sleep state of infants and young children is recognized to obtain the current sleep state of the infants and young children. The feedback execution module is used to calculate environmental control instructions based on the infant's current sleep state and a preset comfort threshold range, and drive the associated terminal device to perform corresponding feedback operations according to the environmental control instructions.

[0025] The data acquisition module includes a differential preprocessing module and a multimodal sensor array deployed around the infant bed. The multimodal sensor array is connected to the differential preprocessing module, and the differential preprocessing module is connected to the sleep state recognition module.

[0026] The differentiated preprocessing module can be deployed in the main control unit, which is an STM32F407VET6 microcontroller.

[0027] The multimodal sensor array includes a piezoelectric ceramic sensor, a three-dimensional accelerometer, a temperature and humidity sensor, a light sensor, and an electret microphone. The sensors are described below: 1. Piezoelectric ceramic sensor (heartbeat and respiration monitoring) (1) Installation location and method: When used in infant cribs, the sensor body is embedded in the center of a rigid support plate under the infant mattress (corresponding to the infant's chest and abdomen area). The rigid support plate is made of 5mm thick aluminum alloy plate, with a 1mm thick silicone pad attached to the surface to cushion local pressure.

[0028] The sensor is fixed to the lower surface of the support plate with M3 screws. Thermal grease is applied to the bottom of the sensor to enhance the mechanical coupling with the support plate and ensure effective transmission of micro-vibrations.

[0029] The output shielded cable extends along the edge of the support plate and connects to the external signal conditioning circuit through a waterproof connector. The cable length should not exceed 1.5m to reduce signal attenuation and electromagnetic interference.

[0030] When applied to strollers, the sensor body is built into the stroller seat cushion or inside the stroller structure (corresponding to the infant's chest and abdomen area). It can be flexibly packaged to fit the stroller structure, ensuring effective transmission of vibrations in the areas in contact with the infant's body.

[0031] (2) Connection method: The shielded cable connects to the signal conditioning circuit board. The signal conditioning circuit includes: Charge Amplifier: A TI OPA129 ultra-low bias current operational amplifier is used to form the charge amplifier stage, converting the charge signal output by the sensor into a voltage signal. Feedback Capacitor Feedback resistor time constant The corresponding lower cutoff frequency .

[0032] Second-order Butterworth low-pass filter: Cutoff frequency The OPA2134 operational amplifier is used to filter out high-frequency noise.

[0033] Output buffer stage: voltage follower, output to the main control unit ADC after impedance matching.

[0034] The conditioned analog signal is fed into the ADC channel (PA0) of the STM32F407 main control unit. The ADC is configured with 12-bit resolution, a sampling rate of 100Hz, and continuous acquisition using DMA loop mode.

[0035] 2. Three-dimensional accelerometer (body motion monitoring) (1) Installation location and method: The sensor is soldered onto a flexible printed circuit board (FPC), which measures 20mm x 20mm and is 0.2mm thick.

[0036] When used in cribs, the flexible circuit board is embedded in the interlayer at the corner of the mattress (corresponding to the side of the infant's hip) and fixed between the mattress foam and spring layers with double-sided adhesive, ensuring that the sensor moves with the vibration of the mattress.

[0037] When applied to strollers, the flexible circuit board is built into the stroller seat cushion or backrest (corresponding to the infant's hips or back) and fixed to the stroller structure with double-sided tape or clips to ensure that the sensor moves with the stroller's vibration.

[0038] (2) Connection method: The sensor via I 2 The C interface connects to the main control unit: SCL connects to PB6, SDA connects to PB7, and the pull-up resistor is 4.7kΩ to 3.3V.

[0039] The sensor interrupt pin INT1 is connected to the main controller's external interrupt line PB8 for data ready interrupt.

[0040] Configuration register: Set the data output rate to 50Hz, measurement range ±2g (optimized to ±2g based on infant movement amplitude to improve resolution), disable FIFO mode, and use continuous update mode.

[0041] Each time the master controller receives an interrupt, it communicates via I... 2 C reads 6 bytes of data (16 bits each for X, Y, and Z) and appends a hardware timer count as a timestamp.

[0042] 3. Temperature and humidity sensor (environmental monitoring) Model: Sensirion SHT30 (1) Installation location and method: The sensor is soldered onto a small PCB, which measures 15mm x 15mm.

[0043] When used in a crib, it should be installed on a bracket 50cm above the infant's sleeping surface to avoid direct sunlight and interference with breathing airflow.

[0044] When used on strollers, install it above or to the side of the stroller canopy and secure it with clips or magnets, ensuring that the sensor faces the ambient space.

[0045] A ventilation shield (1mm aperture metal mesh) is attached to the back of the PCB to prevent foreign objects from entering.

[0046] (2) Connection method: I 2 C-interface connection to the main controller: SCL connects to PB10, SDA connects to PB11, pull-up resistor is 4.7kΩ.

[0047] The sensor is located at address 0x44 and is configured for periodic acquisition mode. It triggers a measurement every 2 seconds and reads 6 bytes of data each time (16 bits each for temperature and humidity, and 8 bits each for CRC checksum).

[0048] 4. Light sensor (environmental monitoring) (1) Installation location and method: It shares the same PCB with the temperature and humidity sensor, with the photosensitive side facing upwards.

[0049] (2) Connection method: I 2 C interface (shares bus with temperature and humidity sensor, but with different address): ADDR pin is grounded, address 0x23.

[0050] Configured to continuous high-resolution mode (1 lx resolution, 120ms measurement time), a measurement is triggered every 1 second, and 2 bytes of data are read.

[0051] 5. Electret microphone (for ambient noise monitoring) (1) Installation location and method: The sensor is soldered onto a small PCB, which measures 10mm x 10mm.

[0052] When used in a crib, install it on the side of the sleeping surface (at least 40cm away from the infant's head) to avoid interference from breathing sounds at close range.

[0053] When used on strollers, install it on the side of the stroller or on the push handle (at least 40cm away from the infant's head), and cover the outside with windproof sponge to avoid wind noise interference.

[0054] The PCB faces the center of the room, the microphone hole faces outwards, and the exterior is covered with windproof foam.

[0055] (2) Connection method: PDM interface connection to the main controller: DATA pin connected to PC2, CLK pin connected to PC3.

[0056] The main control unit's internal PDM filter configuration is: decimation factor 64, output PCM sampling rate 16kHz.

[0057] Accumulate 160 PCM samples every 10ms, calculate short-time energy, and convert it to decibel value.

[0058] like Figure 1As shown, the present invention also provides an automatic sleep recognition and feedback method for infants and young children, applied to the above-mentioned automatic sleep recognition and feedback system for infants and young children, comprising: Step S1: Collect physiological and environmental signals of the infant during sleep through the data acquisition module, and perform differential preprocessing to obtain standardized physiological time-series data and environmental parameters; Step S2: Extract physiological time series data and environmental parameters, as well as environmental context features, based on the sleep state recognition module. Then, fuse the physiological time series data and environmental context features, and use the fused features to identify the infant's sleep state to obtain the infant's current sleep state. Step S3: Based on the current sleep state of the infant and toddler and the preset comfort threshold range, the feedback execution module calculates the environmental control command and drives the associated terminal device to perform the corresponding feedback operation according to the environmental control command.

[0059] The three steps will now be explained in detail: In step S1, physiological and environmental signals of the infant during sleep are collected through a data acquisition module, and differential preprocessing is performed to obtain standardized physiological time-series data and environmental parameters, specifically: First, it should be noted that the physiological signals include raw vibration signals, triaxial acceleration data, and environmental noise signals; the environmental signals include temperature and humidity data and light intensity data.

[0060] The differential preprocessing will be explained in detail below, including the following: 1. Piezoelectric signal preprocessing Original vibration signal The data comes from an ADC with a 100Hz sampling rate, containing 5 sampling points every 50ms. In actual batch processing, multiple frames need to be accumulated, but for simplicity, preprocessing is done in 50ms frames. However, the algorithm requires historical data, therefore it internally maintains state variables. The specific processing steps include: (1) Bandpass filtering Filter type: 4th-order Chebyshev Type I bandpass filter; Passband: 0.8Hz~5Hz; Passband ripple: 0.5dB; Implementation method: Direct Form II Transposed (DFII) is used, and the filter coefficients are pre-calculated and stored in Flash.

[0061] Input: 5 sampling points within the current 50ms. Assume that each frame requires sufficient historical data for independent filtering. In practice, a sliding window is used, and the filter state is updated each time a new sampling point arrives. A more practical implementation: The main controller immediately filters each ADC sample received, and the filtered data is stored in a circular buffer. During preprocessing, the data from the most recent 50ms is retrieved from the buffer.

[0062] Filtered output: ; (2) Adaptive wavelet threshold denoising Wavelet base: sym8 (possesses approximate symmetry, suitable for biological signal processing); Number of decomposition layers: 5; Implementation process: Take the most recent N filtered samples from the buffer (N is a power of 2, for example, 512 points, corresponding to 5.12 seconds of data, to meet the length required for wavelet transform).

[0063] Perform Discrete Wavelet Transform (DWT) on the N-point signal using the Mallat algorithm to obtain the detail coefficients. and approximation coefficients .

[0064] For each layer Estimate the noise standard deviation: ; Thresholds for each layer are calculated based on Stein unbiased likelihood estimation (SURE). : For detail factor After sorting, calculate the risk function: definition Sorting yields .

[0065] Calculate the risk vector: ; Find the minimum risk corresponding to Then the threshold .

[0066] Soft thresholding is applied to the detail coefficients of each layer: ; Perform inverse discrete wavelet transform (IDWT) to reconstruct the signal. .

[0067] Since wavelet transform requires the entire data segment, this operation is performed once every N points (e.g., 5.12 seconds), outputting N points of denoised data. In real-time systems, an overlap-save method can be used to achieve continuous processing, for example, processing once every 50ms, processing the latest N points of data each time, and only outputting the results of the last 50ms.

[0068] (3) Normalization right Perform min-max normalization to map to the [0, 1] interval: ; in To prevent division by zero, in practice, maximum and minimum values ​​are calculated using a sliding window (e.g., maximum and minimum values ​​over the past 5 seconds) to adapt to signal changes.

[0069] Output the normalized piezoelectric signal for the current 50ms. .

[0070] 2. Preprocessing of body movement signals Raw triaxial acceleration data The data is collected every 20ms, and preprocessing is performed every 50ms. The specific steps include: (1) Calculation of resultant acceleration For each triaxial data point received, calculate: ; Store the combined acceleration in a circular buffer.

[0071] (2) Median filtering The combined acceleration sequence is filtered by a median of length 5 (corresponding to a 100ms window): ; Real-time implementation uses a sliding window, updating the window with each new point.

[0072] (3) Adaptive threshold segmentation Maintain the resultant acceleration data within a historical window and calculate the mean. and standard deviation .

[0073] Dynamic threshold: ; In the formula, Take 1.5.

[0074] For each ,like If it is, then it is marked as a dynamic interval; otherwise, it is marked as a static interval.

[0075] (4) Normalization Normalize the dynamic and static intervals separately: Static interval: Mapped to [0, 0.3]; Body movement interval: mapped to [0.3, 1]; Output normalized body motion signal .

[0076] 3. Environmental signal preprocessing: Temperature and humidity are collected every 2 seconds, and light intensity is collected every 1 second. This includes the following steps: (1) Exponentially weighted moving average filtering For each newly collected raw value (With timestamp), update smoothing value: ; in This is the last update time.

[0077] Initial value: During the first data collection, .

[0078] For moments when no new data is collected, the previous smoothing value is maintained.

[0079] (2) Normalization Temperature normalization: ,in .

[0080] Humidity normalization: .

[0081] Illumination normalization: (Assume light intensity above 1000 lx is considered strong light, and normalize it to [0, 1]).

[0082] Output environment parameter vector It changes over time.

[0083] 4. Noise signal preprocessing The electret microphone outputs 16kHz PCM data. Preprocessing is performed in 50ms cycles, and the specific steps are as follows: (1) Wiener filtering (noise suppression) The noise power spectrum is estimated using a recursive averaging algorithm based on minimum statistics, specifically as follows: For input signal The frame is divided into frames with a length of 30ms (480 points) and a frame shift of 10ms (160 points), using a Hamming window.

[0084] Perform an FFT (512 points) on each frame to obtain the power spectrum. For frame index.

[0085] Noise power spectrum estimation Minimum tracking method is used: At each frequency point Maintaining the past Minimum power spectrum of the frame: ; Noise estimation is ,in .

[0086] Calculate the posterior signal-to-noise ratio Prior signal-to-noise ratio The judgment-guided method was used for estimation.

[0087] Calculate Wiener gain: ; A gain is applied to the spectrum of each frame, and then the time-domain signal is recovered by IFFT to obtain the enhanced signal. .

[0088] (2) Decibel value extraction For the enhanced signal, it is also divided into frames, and the short-time energy of each frame is calculated: ; Converted to decibels: ; For each 50ms period, the maximum decibel value of all frames within that period is taken as the noise decibel value for that period. .

[0089] (3) Normalization Map the decibel values ​​to [0, 1]: ; in (Quiet environment) (Noisy environment).

[0090] The preprocessed piezoelectric signals, body motion signals, and noise signals are spliced ​​together in the time dimension to form physiological time-series data.

[0091] In step S2, the physiological time-series data and environmental parameters are extracted from the sleep state recognition module, along with their physical characteristics and environmental context features. These physical characteristics and environmental context features are then fused, and the infant's sleep state is identified based on the fused features. Specifically: The sleep state recognition module incorporates a dual-stream feature extraction network, a multimodal feature fusion module, and a sleep state classification network, which will be described in detail below: I. Two-stream feature extraction network The core of the sleep state recognition module is a dual-stream feature extraction network. Its design idea is to design special feature extraction networks for the dynamic temporal characteristics of physiological time series data and the static vector characteristics of environmental parameters, then perform multimodal fusion of the extracted features, and finally output the sleep state through a classification network.

[0092] The two-stream feature extraction network consists of a first network and a second network: First network: Input is physiological time-series data The output is physical characteristics. ; Second network: Input is an environment parameter vector The output is environmental context features. ; Feature dimension set to , This allows physical characteristics to dominate, while environmental characteristics provide supplementary contextual information.

[0093] Next, the first network and the second network will be introduced separately: 1. First Network: Multi-scale Spatiotemporal Feature Extraction Network The design goal of the first network is to fully extract the spatiotemporal features from physiological time-series data. Targeting the characteristics of infant sleep physiological signals, this invention proposes a multi-scale spatiotemporal feature extraction network, which consists of three core modules: a multi-scale temporal convolution module, a bidirectional long short-term memory network module, and an adaptive channel attention module. The innovative improvement of this design compared to existing technologies lies in: capturing physiological patterns at different time scales through multi-scale convolution, modeling the transition patterns between sleep stages through the bidirectional long short-term memory network, and enhancing the expression of key physiological features through adaptive channel attention. These three modules work synergistically to accurately identify complex sleep state changes in infants. The three modules are described in detail below: (1) Multi-scale temporal convolution module The input to the multi-scale temporal convolution module is physiological time-series data. This module employs four parallel convolutional branches, each using a different sized kernel, to capture physiological patterns at different time scales: Branch 1: Small-scale convolution kernel, size is The receptive field corresponds to 0.15 seconds (3 points × 50ms / point), used to capture instantaneous changes in heart rate and respiration. Branch 2: Mesoscale convolution kernel, size is The receptive field corresponds to 0.5 seconds (10 points × 50 ms / point) and is used to capture local patterns of the respiratory cycle. Branch 3: Large-scale convolution kernel, size is The receptive field corresponds to 1.5 seconds (30 points × 50 ms / point), used to capture the duration characteristics of body movement events. Branch 4: Ultra-large scale convolutional kernel, size is Each receptive field corresponds to 3 seconds (60 points × 50ms / point) and is used to capture transition patterns during sleep stage transitions.

[0094] The convolution operation for each branch is defined as follows: ; in, Indicates the kernel size as The one-dimensional convolution operation is set with 32 kernels, a stride of 1, and padding using the same method to keep the time dimension unchanged. This represents the linear rectification activation function. Indicates the first Output feature maps of each branch.

[0095] The output feature maps of the four branches are concatenated along the channel dimension: ; in, This indicates a channel splicing operation, where 128 channels are obtained from 4 branches × 32 convolutional kernels.

[0096] To fuse multi-scale features and reduce dimensionality, a [missing information] is added after stitching. Convolutional layers: ; in, The number of convolutional kernels is set to 64 for cross-channel feature fusion and dimensionality compression.

[0097] (2) Bidirectional Long Short-Term Memory Network Module Features extracted by multi-scale temporal convolution modules While it contains rich local temporal patterns, it fails to model the temporal dependencies between sleep stages. For example, a deep sleep state is usually followed by a light sleep state, and an increased body movement often precedes a wakefulness state. These state transition patterns are crucial for accurately identifying the current sleep state. Therefore, this invention introduces a bidirectional long short-term memory network module to capture these temporal dependencies.

[0098] The input to the bidirectional long short-term memory network module is It is viewed as a sequence of 600 time steps, with each time step having a feature dimension of 64. The bidirectional long short-term memory network consists of two sub-networks: the forward long short-term memory network and the backward long short-term memory network.

[0099] Forward Long Short-Term Memory Network arrive The internal state update formula for the forward processing sequence is: ; ; ; ; ; ; in, Indicates the first Input features at each time step, This indicates the hidden state of the previous time step. This indicates the cell state at the previous time step. , , These represent the activation values ​​of the input gate, forget gate, and output gate, respectively. Indicates the state of candidate cells. This represents element-wise multiplication. This represents the Sigmoid function. This represents the hyperbolic tangent function. The hidden state dimension is set to 64.

[0100] Backward Long Short-Term Memory Networks arrive The reverse processing sequence, whose internal state update formula is similar to that of the forward network, yields the backward hidden state. .

[0101] The final hidden state at each time step is formed by concatenating the forward and backward hidden states: ; To obtain a global representation of the entire sequence, this invention employs average pooling in the time dimension: ; in, This represents the temporal dependency features extracted through a bidirectional long short-term memory network.

[0102] (3) Adaptive Channel Attention Module Features extracted by multi-scale temporal convolutional modules and bidirectional long short-term memory network modules Although multi-scale information and temporal dependencies have been integrated, different feature channels contribute differently to sleep state recognition. For example, channels reflecting breathing patterns may contribute more during deep sleep, while channels reflecting body movement are more critical during wakefulness. Therefore, this invention introduces an adaptive channel attention module to dynamically adjust the weights of each feature channel.

[0103] The input to the adaptive channel attention module is This module first calculates the channel attention weights through two fully connected layers: ; ; in, This represents the weight matrix and bias term of the first fully connected layer, compressing the 128-dimensional features to 64 dimensions. and This represents the weight matrix and bias term of the second fully connected layer, mapping the 64-dimensional features back to 128 dimensions. This represents the Sigmoid function, mapping its output to... The interval is used to obtain the attention weight vector. .

[0104] Then, the attention weights are multiplied element-wise with the original features to obtain the weighted features: ; in, This indicates element-wise multiplication.

[0105] To enhance the network's expressive power, residual connections are added after attention-weighted processing: ; in, This represents the vital characteristics of the final output of the first network.

[0106] 2. Second Network: Contextual Feature Encoding Network The design goal of the second network is to extract high-dimensional contextual features from the environmental parameter vector. Although environmental parameters only have three dimensions, they have complex nonlinear relationships with sleep states. For example, excessively high or low temperatures can disrupt sleep, light intensity affects circadian rhythms, and humidity is related to breathing comfort. Therefore, this invention employs a multilayer perceptron to perform nonlinear mapping on environmental parameters to extract environmental contextual features.

[0107] The input to the second network is an environmental parameter vector. The network architecture contains three fully connected layers: First layer: Map the 3D input to 16D and apply the ReLU activation function: ; in, This represents the first-layer weight matrix. This represents the first-level bias term.

[0108] The second layer maps the 16-dimensional features to 32 dimensions and applies the ReLU activation function: ; in, This represents the second-layer weight matrix. This indicates the second-level bias term.

[0109] The third layer maps the 32-dimensional features to the final environmental context feature dimension. No activation function should be applied (to preserve linear output for easier subsequent fusion): ; in, This represents the third-layer weight matrix. This represents the third-level bias term.

[0110] II. Multimodal Feature Fusion Module The physical features output by the two-stream feature extraction network and environmental context features These features possess different dimensions, semantic levels, and levels of importance. Effectively fusing these two heterogeneous features is crucial to determining the accuracy of sleep state recognition. This invention proposes a multimodal feature fusion module based on a multi-head cross-attention mechanism and adaptive gating fusion. This module consists of two sub-modules: a multi-head cross-attention sub-module and an adaptive gating fusion sub-module.

[0111] 1. Multi-head cross-attention submodule The design idea of ​​the multi-head cross-attention submodule is to use physiological features as queries and environmental context features as keys and values. The attention mechanism is used to calculate the modulation weight of environmental information on physiological features, so that the model can dynamically adjust its understanding of physiological signals according to the current environmental conditions.

[0112] First, physical characteristics The query matrix is ​​obtained through linear projection. : ; in, This indicates that the projection matrix is ​​used to project 128-dimensional features onto a 64-dimensional space.

[0113] Environmental context features The bond matrix is ​​obtained through linear projection. Sum matrix : ; ; in, and These represent the key projection matrix and the value projection matrix, respectively, projecting 32-dimensional environmental features into a 64-dimensional space, aligned with the dimensions of the query matrix.

[0114] The multi-head attention mechanism extends the above projection operation to Size (in this invention) Each head independently computes attention, and then the results are concatenated. For the first head... Size: ; in, , , ,and , ,satisfy , .

[0115] The attention output for each head is calculated as follows: ; in, Calculate the similarity between the query and the key, and divide by... Scaling is used to prevent gradient vanishing. The similarity is normalized into attention weights, and finally summed with the value matrix. Weighted summation yields the attention output .

[0116] Will The outputs of each entity are concatenated, and the final attention result is obtained through the output projection matrix: ; in, This indicates the output projection matrix, which maps the concatenated 64-dimensional features back to 128 dimensions.

[0117] To stabilize training, residual connections and layer normalization are used: ; in, The representation layer normalization operation normalizes the feature dimensions of each sample, accelerating model convergence.

[0118] 2. Adaptive Gating Fusion Submodule Fusion features output by multi-head cross-attention submodule Although environmental information has been incorporated, balancing the relationship between the original vital signs, environmental features, and fused features still requires fine-tuning. This invention proposes an adaptive gating fusion submodule, which dynamically adjusts the contribution weights of the three features through a gating mechanism.

[0119] The input to the gated fusion submodule consists of three parts: raw vital signs and features. Contextual features Cross-attention fusion features First, combine the three components: ; in, Dimension 128, Dimension 32, Dimension 128, after splicing 288.

[0120] Then, gating weights are generated through a gating network. : ; in, and This represents the weight matrix and bias term of the first fully connected layer, compressing the 288-dimensional features to 144 dimensions. This represents the GELU activation function, a smooth variant of ReLU, which is beneficial for gradient flow. and This represents the weight matrix and bias term of the second fully connected layer, which maps the 144-dimensional features to 128 dimensions. This represents the Sigmoid function, mapping its output to... The interval is used to obtain the gate weight vector. Each element represents the fused feature in the corresponding dimension. The proportion that should be retained.

[0121] Finally, the gating weights are multiplied element-wise with the fused features to obtain the final optimized fused features: ; III. Sleep State Classification Network After passing through the multimodal feature fusion module, optimized fused features are obtained. This feature integrates multi-scale physiological temporal features, environmental context features, and the interaction between the two, providing a comprehensive representation of the infant's sleep state within the current 30-second time window. The task of the sleep state classification network is to map this feature to specific sleep state categories, which will be explained in detail below: 1. Classification network structure The classification network uses a multilayer perceptron structure, consisting of two hidden layers and one output layer: First hidden layer: Maps the 128-dimensional features to 64 dimensions, applies the ReLU activation function and random deactivation: ; in, This represents the first-layer weight matrix. This represents the first-level bias term. This indicates that neurons are randomly deactivated with a probability of 0.3 to prevent overfitting.

[0122] Second hidden layer: Maps the 64-dimensional features to 32-dimensionality, applies the ReLU activation function and random deactivation: ; in, This represents the second-layer weight matrix. This indicates the second-level bias term.

[0123] Output layer: Maps the 32-dimensional features to 4 dimensions, corresponding to 4 sleep states, and applies the Softmax function to obtain the probability distribution: ; in, This represents the output layer weight matrix. Indicates the output layer bias term. The 4-dimensional logits are converted into a probability distribution, with the sum of each dimension being 1.

[0124] The final output 4-dimensional probability distribution These correspond to the probabilities of deep sleep, light sleep, REM sleep, and wakefulness, respectively. The system selects the category with the highest probability as the sleep state for the current time window. .

[0125] The training process of the above model will be explained in detail below: 1. Training dataset construction Constructing the training dataset is fundamental to ensuring model performance. This invention constructs the training dataset using the following steps: (1) Raw data collection Thirty healthy infants aged 0-12 months will be recruited for continuous multi-night sleep monitoring in a postpartum care center or home environment, with informed consent from their parents. Data will be collected from each infant for 3-5 nights, with 8-10 hours of continuous data collection each night. The data collection equipment will use the same sensor array and main control unit as the data acquisition module to ensure consistent data distribution.

[0126] (2) Data preprocessing and framing The raw signals were preprocessed according to the method described in the data acquisition module to obtain physiological time-series data. and environmental parameter vector A sliding window approach is used to divide continuous data into frames, with a window length of 30 seconds and a sliding step of 15 seconds (50% overlap). This overlapping frame division method can increase the number of training samples and at the same time make the transition between adjacent windows smoother, which is beneficial for the model to learn temporal dependencies.

[0127] (3) Labeling Two sleep technicians with over 3 years of clinical experience were hired to simultaneously view video recordings and polysomnography (as supplementary references) of infants and young children, and independently annotate the sleep state of each 30-second window. Annotation categories included: Deep sleep: regular breathing, no obvious body movement, and sluggish response to external stimuli; Light sleep state: breathing is slightly irregular, there are occasional slight body movements, and one is easily awakened; Rapid eye movement syndrome: rapid eye movements, irregular breathing, and subtle twitching of the face or limbs; Awake state: eyes open, obvious body movements, crying or vocalization; The consistency of the labeling results from the two technicians was assessed using Cohen's Kappa coefficient, requiring a Kappa ≥ 0.8. For windows with inconsistent labeling, a third senior technician arbitrated to determine the final label.

[0128] (4) Dataset partitioning All labeled samples were divided according to individual infants to avoid data from the same infant appearing in both the training and test sets. The specific ratio was: Training set: 20 infants and toddlers, accounting for approximately 70% of the total sample; Validation set: 5 infants and toddlers, accounting for approximately 15% of the total sample; Test set: 5 infants and toddlers, accounting for approximately 15% of the total sample; This individual-based approach allows for the assessment of the model's generalization ability to new individuals, which is more in line with real-world application scenarios.

[0129] (5) Data augmentation To improve the model's generalization ability and robustness, the following data augmentation strategies are applied to the training set: Time warp: Slight scaling (±5%) on physiological time-series data; Amplitude perturbation: Add Gaussian white noise with a signal-to-noise ratio of 20dB; Channel mask: Randomly set the data of a certain channel to zero to simulate sensor failure; The number of training samples after data augmentation is increased to 4 times that of the original samples.

[0130] The final training dataset contains approximately 300,000 labeled samples, each containing: enter: , ; Label: These correspond to deep sleep, light sleep, REM sleep, and wakefulness, respectively.

[0131] 2. Loss Function This invention uses a multi-class cross-entropy loss function as the optimization objective: ; in, Indicates batch size, Indicates an indicator function, when If the value is 1, then the value is 0; otherwise, the value is 0. The model represents the first Each sample is predicted as a category. The probability of.

[0132] To prevent overfitting, an L2 regularization term is added to the loss function: ; in, This represents all trainable parameters in the model. Represents the regularization coefficient, with values ​​ranging from 1 to 2. .

[0133] 3. Optimizer and Hyperparameter Settings The Adam optimizer is used for parameter updates, and the hyperparameter settings are as follows: Learning rate: initial value The cosine annealing strategy is used for dynamic adjustment. Batch size: 64; Training rounds: 100 rounds, each round fully traversing the training set once; Early stopping strategy: Stop training when the validation set loss does not decrease for 10 consecutive rounds, and save the model parameters with the best performance on the validation set.

[0134] 4. Model Evaluation Indicators The following metrics were used to evaluate the model performance on the test set: Accuracy: The proportion of correctly classified samples out of the total number of samples; Precision: For each category, the proportion of samples correctly predicted as belonging to that category out of the total number of samples correctly predicted as belonging to that category; Recall: For each category, the proportion of samples that were correctly predicted as belonging to that category out of the total number of samples that were actually belonging to that category; F1 score: the harmonic mean of precision and recall; Cohen's Kappa coefficient: measures the consistency between the classification result and the true label, taking into account random accuracy.

[0135] In step S3, the feedback execution module calculates environmental control instructions based on the infant's current sleep state and a preset comfort threshold range, and drives the associated terminal device to execute corresponding feedback operations according to the environmental control instructions, specifically: The comfort mapping table serves as the decision-making basis for the feedback execution module. Based on research findings in sleep medicine and infant physiology, it defines the optimal range of environmental parameters for different sleep states. The mapping table is stored as structured data in the system's non-volatile memory and can be personalized by the user through a mobile application. This invention provides an embodiment of a comfort mapping table, as shown in Table 1.

[0136] Table 1 Comfort Map

[0137] The calculation process for environmental control instructions will be explained next: The feedback execution module performs a control command calculation every 15 seconds (consistent with the output cycle of the sleep state recognition module), which includes the following sub-processes: 1. State confidence assessment First, according to the probability distribution Evaluate the confidence level of the current state identification. Define the confidence level metric: ; in, Take the maximum value. Take the second largest value. Greater than the preset threshold When the value is 0.3 (for example), the current state is considered reliable; otherwise, the state is considered ambiguous, and the control command of the previous cycle remains unchanged to avoid frequent erroneous adjustments.

[0138] 2. Ideal Environment Parameter Inquiry Based on current sleep state By querying the comfort mapping table, we can obtain the ideal environment parameter range: Temperature range: ; Humidity range: ; Lighting limit: ; Noise limit: .

[0139] 3. Obtaining current environmental parameters The most recent environmental parameter vector output from the data acquisition module Get the current environment parameters: Current temperature: (Inverse normalization is required); Current humidity: (Inverse normalization is required); Current lighting: (Inverse normalization is required); Current noise level: (from (Obtained from [source], requires inverse normalization). This invention provides an example of an inverse normalization formula (temperature): ; in This is the normalized temperature value. , .

[0140] 4. PID controller calculates the controlled quantity For continuously adjustable environmental parameters such as temperature and humidity, a PID controller is used to calculate the control input. Taking temperature as an example: Define temperature deviation: ; That is, the deviation is non-zero only when it exceeds the range, and the deviation is 0 when it is within the range (dead zone control).

[0141] Output of the PID controller (temperature control command): ; in, These are the proportional, integral, and differential coefficients, which are determined experimentally, for example... The integral term employs an anti-saturation integration (integral separation) strategy, pausing integration when the deviation is too large to prevent integral saturation. The derivative term uses actual differentiation (first-order low-pass filtering) to suppress noise amplification.

[0142] Similarly, humidity deviation is defined. ,calculate .

[0143] 5. Light and noise control Light and noise are controlled using threshold-triggered regulation: Light control: If If the command is executed, a "dim the lights" command will be generated; otherwise, no action will be taken.

[0144] Noise control: If If the noise level is below the threshold, a "play masking noise" command (such as white noise) is generated; otherwise, if white noise is currently playing and the noise level is below the threshold, a "stop playing" command is generated.

[0145] 6. Soothing audio trigger logic when (Awakening state) and duration When triggered, a soothing audio message plays. Duration Obtained by continuous counting of state sequences. A preset threshold (e.g., 300 seconds) is set. The selection of soothing audio can be adaptively adjusted based on the infant's age, preferences, and level of arousal: if the probability... If the level is high and accompanied by crying (identified by noise signal characteristics), play a lullaby; if there is only slight awakening, play gentle white noise.

[0146] The following section explains the specific process of generating and sending control commands: The feedback execution module converts the calculated control values ​​into specific device control commands and sends them to the terminal devices via the corresponding communication protocols. The system supports various terminal devices, including smart air conditioners, humidifiers / dehumidifiers, smart light bulbs, and smart speakers. Each device has a corresponding command format and communication interface.

[0147] 1. Command format definition All control instructions are uniformly encapsulated in JSON format, containing the following fields: device_id: A unique identifier for the target device; command_type: Command type, such as set_temperature, set_humidity, set_light, play_audio, stop_audio; value: Command parameters, such as target temperature value, on / off status, audio ID, etc.; timestamp: Command generation timestamp (milliseconds); Example: json { "device_id": "ac_001", "command_type": "set_temperature", "value": 24 "timestamp": 1648123456789 }; 2. Device Communication Protocol The following communication methods are used for different types of terminal devices: Smart air conditioners / humidifiers: Connect via Wi-Fi and use the MQTT protocol to publish commands to device topics. The MQTT server is deployed on a local gateway or in the cloud, and devices subscribe to the corresponding topics.

[0148] Smart bulbs: Support ZigBee or Bluetooth Mesh protocols, and convert commands via a gateway.

[0149] Smart speakers: They connect via Wi-Fi and use the manufacturer's REST API to control audio playback.

[0150] For traditional home appliances without network connectivity, control can be achieved via an infrared transmitter module (such as an IR Blaster). The system has a pre-stored infrared code library for common air conditioner brands, and selects and sends the corresponding code based on the calculated target temperature.

[0151] 3. Command Sending Strategy To prevent command storms and network congestion, the following sending strategy is adopted: Command debouncing: When the same command type is repeatedly sent by the same device within a short period of time (e.g., 30 seconds), it is sent only once.

[0152] Command merging: If the change in the control value calculated multiple times is not significant (e.g., the absolute value of the temperature adjustment is less than 0.5°C), no new command will be sent to avoid frequent start-ups and shutdowns of the equipment.

[0153] Confirm Retransmission: For critical commands (such as playing soothing audio), a response is required from the device. If there is no response, the data will be retransmitted up to 3 times.

[0154] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0155] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0156] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0157] Contents not described in detail in this specification are prior art known to those skilled in the art. It is hereby indicated that the above description is intended to help those skilled in the art understand this invention, but does not limit the scope of protection of this invention. Any equivalent substitutions, modifications, improvements, or simplifications of the above descriptions that do not depart from the essential content of this invention fall within the scope of protection of this invention.

Claims

1. An automatic sleep recognition and feedback method for infants and young children, characterized in that, include: Step S1: Collect physiological and environmental signals of the infant during sleep through the data acquisition module, and perform differential preprocessing to obtain standardized physiological time-series data and environmental parameters; Step S2: Extract physiological time series data and environmental parameters, as well as environmental context features, based on the sleep state recognition module. Then, fuse the physiological time series data and environmental context features, and use the fused features to identify the infant's sleep state to obtain the infant's current sleep state. Step S3: Based on the current sleep state of the infant and toddler and the preset comfort threshold range, the feedback execution module calculates the environmental control command and drives the associated terminal device to perform the corresponding feedback operation according to the environmental control command.

2. The automatic sleep recognition and feedback method for infants and young children according to claim 1, characterized in that, In step S1, the physiological signals include the original vibration signal, triaxial acceleration data, and environmental noise signal; the environmental signals include temperature and humidity data and light intensity data.

3. The automatic sleep recognition and feedback method for infants and young children according to claim 2, characterized in that, In step S1, the differentiation process includes: The original vibration signal was filtered using a Chebyshev Type I bandpass filter. After the filtering was completed, adaptive wavelet threshold denoising was performed, followed by normalization to obtain the pre-processed piezoelectric signal. For triaxial acceleration data, the resultant acceleration is calculated, and a sliding window midpoint filter is used to remove isolated impulse noise. A dynamic threshold is calculated based on the mean and standard deviation of the resultant acceleration within the historical window. Adaptive threshold segmentation is performed based on the dynamic threshold, and the motion interval and static interval are normalized respectively to obtain the preprocessed motion signal. The temperature, humidity and light data are smoothed by exponential weighted moving average filtering, and then normalized to obtain the environmental parameter vector. For environmental noise signals, a recursive averaging algorithm based on minimum statistics is used to estimate the noise power spectrum and perform Wiener filtering. The short-time energy of the filtered signal is calculated frame by frame and converted into decibel values. Finally, normalization is performed to obtain the preprocessed noise signal. The preprocessed piezoelectric signals, body motion signals, and noise signals are spliced ​​together in the time dimension to form physiological time-series data.

4. The automatic sleep recognition and feedback method for infants and young children according to claim 3, characterized in that, In step S2, the physiological time-series data and environmental parameters are extracted from the sleep state recognition module, along with their physical characteristics and environmental context features. These physical characteristics and environmental context features are then fused, and the infant's sleep state is identified based on the fused features. Specifically: The sleep state recognition module has a built-in dual-stream feature extraction network and a sleep state classification network. The dual-stream feature extraction network extracts physiological time-series data and environmental parameters, as well as the physical characteristics and environmental context features. The physical characteristics and environmental context features are fused in a multimodal manner, and the fused features are input into the sleep state classification network to recognize the sleep state of infants and young children.

5. The automatic sleep recognition and feedback method for infants and young children according to claim 4, characterized in that, Based on a dual-stream feature extraction network, physiological time-series data and environmental parameters are extracted to obtain vital signs and environmental context features, specifically: The dual-stream feature extraction network includes a first network and a second network; Multi-scale features of physiological time-series data are extracted through the multi-scale temporal convolution module of the first network. This multi-scale temporal convolution module employs four parallel convolutional branches with kernel sizes of [sizes to be filled in]. The outputs of each branch are spliced ​​together and then passed through... Convolutional dimensionality reduction yields multi-scale features; The first network uses a bidirectional long short-term memory network module to take multi-scale features as input, extracts temporal dependency features through forward and backward long short-term memory networks, and performs time-dimensional average pooling. Channel attention weights are generated through the adaptive channel attention module of the first network, and then multiplied element-wise with the features after average pooling in the time dimension, and residual connections are added to obtain the vital signs features. The environmental parameter vector is mapped to environmental context features through a multilayer perceptron in the second network.

6. The automatic sleep recognition and feedback method for infants and young children according to claim 5, characterized in that, Multimodal fusion of vital signs and environmental context features is performed as follows: The multi-head cross-attention submodule uses vital signs as queries and environmental context features as keys and values. It calculates the fusion features after environmental modulation through multiple attention heads, and obtains the cross-attention fusion features by using residual connections and layer normalization. The adaptive gating fusion submodule concatenates the vital signs, environmental context features, and cross-attention fusion features, and then generates gating weights through a gating network. The gating weights are then multiplied element-wise with the cross-attention fusion features to obtain the optimized fusion features.

7. The automatic sleep recognition and feedback method for infants and young children according to claim 6, characterized in that, The fused features are input into a sleep state classification network for infant sleep state recognition, specifically: The optimized fusion features are input into the sleep state classification network. The probability distribution of infants and young children in various sleep states is calculated through two hidden layers and one output layer. The category corresponding to the maximum probability is taken as the current sleep state.

8. The automatic sleep recognition and feedback method for infants and young children according to claim 7, characterized in that, In step S3, the feedback execution module calculates environmental control instructions based on the infant's current sleep state and a preset comfort threshold range, and drives the associated terminal device to execute corresponding feedback operations according to the environmental control instructions, specifically: Based on the current sleep state, query the comfort mapping table to obtain the corresponding ideal temperature and humidity range, light limit, and noise limit; The confidence index is calculated based on the probability distribution. When the confidence index is less than the preset threshold, the control command of the previous cycle remains unchanged. otherwise: Based on the deviation between the current ambient temperature and the ideal temperature range, the PID controller calculates the temperature adjustment amount and generates the target temperature command. Based on the deviation between the current ambient humidity and the ideal humidity range, the humidity adjustment amount is calculated by the PID controller, and the target humidity command is generated. When the current lighting or noise exceeds the corresponding limit, generate a command to dim the lights or play a masking noise command. When the current sleep state is an awake state and the continuous duration exceeds the preset threshold, a lullaby or white noise is selected to be played based on the crying detection result, and the playback stops when the state is not awake. The control commands are encapsulated in JSON format and sent to the associated terminal devices via Wi-Fi / MQTT, ZigBee, Bluetooth, or infrared protocols, and a command debouncing, merging, and acknowledgment retransmission strategy is adopted.

9. An automatic sleep recognition and feedback system for infants and young children, applied to the automatic sleep recognition and feedback method for infants and young children as described in any one of claims 1-8, characterized in that, include: The data acquisition module, sleep state recognition module, and feedback execution module are connected in sequence. The data acquisition module is used to collect physiological and environmental signals of infants during sleep, and to perform differentiated preprocessing to obtain standardized physiological time-series data and environmental parameters. The sleep state recognition module is used to extract physiological time-series data and environmental parameters, as well as the vital signs and environmental context features, and to fuse the vital signs and environmental context features. Based on the fused features, the sleep state of infants and young children is recognized to obtain the current sleep state of the infants and young children. The feedback execution module is used to calculate environmental control instructions based on the infant's current sleep state and the preset comfort threshold range, and drive the associated terminal device to perform corresponding feedback operations based on the environmental control instructions. The data acquisition module includes a differential preprocessing module and a multimodal sensor array deployed around the infant bed and stroller. The multimodal sensor array is connected to the differential preprocessing module, and the differential preprocessing module is connected to the sleep state recognition module.

10. An automatic sleep recognition and feedback system for infants and young children according to claim 9, characterized in that, The multimodal sensor array includes a piezoelectric ceramic sensor, a three-dimensional accelerometer, a temperature and humidity sensor, a light sensor, and an electret microphone; When applied to an infant bed, the piezoelectric ceramic sensor is built into the center of a rigid support plate under the mattress, the three-dimensional acceleration sensor is set at the corner of the mattress, the temperature and humidity sensor and the light sensor are deployed 50cm above the infant bed, and the electret microphone is deployed on the side of the bed away from the infant's head. When applied to strollers, the piezoelectric ceramic sensor is built under the stroller seat cushion or inside the stroller body structure, the three-dimensional acceleration sensor is built under the stroller seat cushion or in the backrest, the temperature and humidity sensor and the light sensor are deployed above or on the side of the stroller canopy, and the electret microphone is deployed on the side of the stroller away from the infant's head. The piezoelectric ceramic sensor, three-dimensional accelerometer, temperature and humidity sensor, light sensor, and electret microphone are connected to the differential preprocessing module.