Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a sleep posture recognition device and method based on a cardiac shock signal, which can recognize the sleep posture of a user and can not expose privacy due to the input of a video.
In order to achieve the above object, the sleep posture recognition method based on a ballistocardiogram signal of the present invention comprises the following steps: s1: acquiring a core impact signal; s2: judging the relation between the amplitude of the cardiac shock signal and a set threshold value; s3: adjusting the waveform characteristics of the heart impact signal; s4: inputting the waveform features into an integrated logistic regression classifier; s5: outputting 4 different sleeping postures; s6, counting and calculating the time ratio of each sleeping posture, and sending a self-defined reminding message to the client.
Further, in step S2, if the amplitude of the ballistocardiogram signal is greater than the set threshold, it indicates that the body of the user is moving, and the ballistocardiogram signal is acquired again.
Further, in step S3, the waveform characteristics include an amplitude mean value of the waveform, a respiratory rate, a ratio of cycles of inspiration and expiration, a power spectrum band amplitude integral of the waveform, and a band amplitude extremum, and the amplitude mean value of the waveform is obtained by averaging 32 times of down-sampled signal segments of the S1 central impulse signal with 1 min.
Further, the waveform power spectrum band integration is set as that the power spectrum value of the original signal of 1min is obtained by the periodic spectrum, and 5 spectrum features of P1, P2, P3, P4 and P5 are obtained by summing the power spectrums in 5 intervals of (01 ], (12 ], (23], (34], (48).
Furthermore, the extreme value of the frequency band amplitude is a frequency spectrum value obtained by adopting 4096-point FFT transformation, and then a local maximum value within 0-8Hz is taken.
The invention also provides a sleep posture recognition device based on the cardiac shock signal, which is designed for implementing the sleep posture recognition method based on the cardiac shock signal.
Further, the signal conditioning circuit further comprises an RC filter circuit.
Has the advantages that: the invention adopts a sleep posture recognition device based on the heart attack signal, the recognition device detects the heart attack signal of a user during sleeping through a sensing front-end module, then analyzes the heart attack signal waveform characteristics of the heart attack signal in a sleep posture recognition method based on the heart attack signal, and outputs the sleep posture of a client by utilizing an integrated logistic regression classifier, thereby avoiding the problem of client privacy disclosure caused by video monitoring.
Examples
As shown in fig. 1, the sleep posture recognition apparatus based on ballistocardiogram signals according to the present invention includes a sensingfront end module 100, aconditioning circuit 101, and amicroprocessor 102, wherein the sensingfront end module 100 includes ahousing 1010 and apiezoelectric ceramic 1011 disposed on thehousing 1010, wherein thehousing 1010 is made of PP plastic material, and thepiezoelectric ceramic 1011 is adhered to an inner surface of an upper cover of thehousing 1010 by using a specific glue. Thepiezoelectric ceramic 1011 is used as a signal collector and can convert the pressure signal into an electric signal, namely, the obtained pressure signal is output to a corresponding processor (microprocessor) in the form of a voltage or current signal; the sensingfront end module 100 is placed under the mattress near the chest location to acquire the individual's cardiac shock signal.
Theconditioning circuit 101 includes an RC filter circuit, and is electrically connected to the sensing front-end module 100 (specifically, piezoelectric ceramic), and the RC filter circuit is configured to filter noise interference in an electrical signal generated by the piezoelectric ceramic; the conditioning circuit further includes an analog-to-digital converter for converting the electrical signal of the piezoelectric ceramic into a digital signal, wherein the analog-to-digital converter selects ADS1118 as an example in this embodiment and sets the sampling frequency to 250 Hz.
The microprocessor is used for receiving the digital signals of the analog-to-digital converter, executing the sleep posture extraction step, and sending the calculation result to the mobile phone client through the Bluetooth by using the self-contained radio frequency module. The microprocessor in the invention can be CC2640, CC2640R2F, CC2650, STM32 and the like.
The invention also provides a sleep posture identification method based on the heart attack signal, as shown in fig. 2, comprising the following steps:
step S1: a ballistocardiogram signal is acquired. The heart attack signal acquired by the sleep posture recognition device based on the heart attack signal is shown in the attached figure 3 of the invention, and the original signal is specifically a digitized signal acquired by using the sleep posture recognition device based on the heart attack signal. The heart impact signal comprises information of individual heart pulsation, thoracic movement and body movement caused by respiratory movement, and the like, the heart impact signal is obtained by real-time online measurement, and a sleep posture state obtained by a camera record obtained by a synchronously monitored polysomnograph is used as a segment division mark of the heart impact signal.
Step S2: and judging the relationship between the amplitude of the cardiac shock signal and the set threshold value. When the amplitude of the signal of the sleeping individual to be tested exceeds the threshold THmove, the serious body movement is considered to occur, and the step eliminates the interference signal segment (removes the change of the heart impact signal caused by the body movement) through the identification of the serious body movement. The threshold value THmove can be set, the amplitude of the signal of the sleeping individual to be tested in fig. 3 is generally between 2.14 and 2.16, and the threshold value THmove can be set to a value higher than 3 times of the amplitude.
Step S3: and regulating the waveform characteristics of the core impact signal. The waveform features extracted in this step include: the waveform amplitude mean value, the respiratory frequency, the cycle ratio of inspiration and expiration, the power spectrum band amplitude integral of the waveform, and the band amplitude extreme value.
Wherein, the amplitude average value of the waveform is that the 1min signal length of the original signal waveform is sampled by 32 times and then averaged. For example, 32 times the amplitude of each heartbeat waveform within 1min in fig. 3, and averaging.
The maximum value point BMax or the minimum value point BMin in the respiratory cycle is extracted by adopting a differential threshold value method according to the respiratory frequency characteristics, and the respiratory rate is further calculated according to the sampling rate. Specifically, the number and sampling rate of sampling points in the sampling point interval corresponding to two consecutive maximum points BMax or two consecutive minimum points BMin are found, for example: when the sampling rate is 1 second 0.05 x 104The number of sampling points in the sampling point interval between two continuous maximum points BMax or minimum points BMin is 0.08 x 104Then the respiration rate is about 0.6 times/second (0.05 x 10)4/0.08*104)。
As shown in fig. 4, the ratio of inhalation to exhalation periods is characterized by inhalation being the rise (from Bmin-Bmax) and exhalation being the fall (from Bmax-Bmin) of the waveform, and their ratio being defined as the ratio of the inhalation rise and exhalation fall.
The waveform power spectrum band integration is set as that a period map (Periodogram) obtains power spectrum values for 1min of original heart attack signals (such as waveforms in fig. 3), and as shown in fig. 5, 5 spectral features including P1, P2, P3, P4 and P5 are obtained by summing power spectrums in 5 intervals such as (01 ], (12 ], (23], (34], (48).
The extreme value of the frequency band amplitude is a frequency spectrum value obtained by adopting 4096 points to the original heart shock signal through FFT (fast Fourier transform), and then a local maximum value within 0-8Hz is taken.
Step S4: the waveform features are input to an integrated logistic regression classifier. The 9 features obtained by waveform feature extraction in step S103 (the 9 features include 5 spectral features of the aforementioned P1, P2, P3, P4, and P5, and the amplitude mean, respiratory rate, cycle ratio of inspiration and expiration, and band amplitude extremum of the waveform), and the waveform features form the original data set a. Obtaining a plurality of small data sets of the same size by randomly replacing samples; each small data set adopts logistic regression training to form a weak classifier, and the data quantity in each small data set is 10% of that in the original data set A. The number T of the weak classifiers is selected to be 6 (namely, the small data sets are randomly selected for 6 times), and the recognized sleeping posture types are 4 types: left, right, prone, supine (i ═ 1,2,3, 4).
In step S5, the probability value p (xi) output by each pairwise classifier represents the probability of being classified into the category i. The final sleep posture decision rule obtained by the combination of every two classifiers is as follows:
wherein, T is the number of classifiers and represents the probability value obtained under the jth classifier corresponding to the category i.
To illustrate steps S4 and S5, as shown in table 1, 6 classifiers are respectively performed for one test sample as follows: each classifier outputs only two resulting values, e.g. classifier 1 outputs only classification probability values for lying left and lying right. The final g (x) ═ 2 is the final classification of the sample as right decubitus.
TABLE 1
And step S6, counting the time ratio of each sleep posture, and sending a self-defined reminding message to the client. For example, when the user continuously recognizes the right-lying state for a certain period of time in step S5, the cumulative right-lying time and the ratio are transmitted to the client.
In addition, if the recognition results of the sleep posture recognition results in the step S5 do not match each other for a continuous period of time T1, a category with a large proportion is selected as the final category in the period of time (as shown in table 1, each category has the right recumbent with the largest proportion probability as the final category).
Sending a self-defined reminding message, specifically setting a preset sleep posture conversion frequency for a user in a self-defined way, and setting the occurrence posture conversion frequency to be higher than an upper threshold TH1 (a lower threshold TH2 can also be set for posture conversion frequency embodiment).
The equipment end automatically sends alarm information to a guardian, wherein the equipment end sends the alarm information by sending a message code to the server end through the equipment end and downloading the message code to each terminal monitoring interface through the server; or the device end shares the appointed client end in the appointed range through a Bluetooth mode.
In summary, the invention adopts the mode of acquiring and analyzing the heart impact signal or the sleeping posture of the user, and the mode of monitoring the video is not used any more to detect the sleeping posture of the user, thereby protecting the privacy of the user.
The above detailed description merely describes preferred embodiments of the present invention and does not limit the scope of the invention. Without departing from the spirit and scope of the present invention, it should be understood that various changes, substitutions and alterations can be made herein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims and their equivalents. The scope of the invention is defined by the claims.