A method and device for detecting respiratory rate and heart rate
The chest motion signals are processed through millimeter wave radar and principal component analysis method, which solves the inconvenience of contact detection and the wireless signal attenuation problems of non-contact detection, and realizes long-distance, long-term and accurate breathing and heartbeat frequency detection.
Patent Information
- Application Number
- CN202210486629.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-05-06
AI Technical Summary
In the prior art, contact detection equipment brings inconvenience to users. The non-contact detection method has problems such as attenuation of wireless signal and limited detection range, and it is impossible to accurately extract tiny heartbeat motion signals.
Millimeter wave radar is used for contactless detection, transmitting and receiving reflected signals through frequency modulation continuous waves, combining principal component analysis method and second-order derivative operation, chest motion signals are processed to extract respiration and heartbeat frequencies.
It realizes long-distance and long-term detection under normal user action, accurately extracts breathing and heartbeat frequencies, avoids noise interference, and enhances signal strength.
Smart Images

Figure CN114983354B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vital sign signal detection, and in particular to a method and device for detecting respiratory rate and heart rate. Background Art
[0002] Current technologies for detecting vital sign signals (primarily respiration and heartbeat) are primarily categorized into contact and non-contact measurement. Contact measurement, such as electrocardiogram (ECG) monitors used in medicine, requires not only fixed, immovable electrode patches attached to the user's skin for long-term use, but also requires the user to carry a recorder and batteries. While these devices provide accurate and precise data, their operation is complex and requires numerous precautions, creating inconvenience for the user and making them unsuitable for daily, long-term monitoring. Furthermore, many wearable devices currently offer contact measurement, such as smart bracelets, which use electrical sensors to measure basic heart rate parameters, and chest straps, which employ a piezoelectric device attached to the chest to calculate respiration based on the expansion and contraction of the piezoelectric sensor. However, these devices all require direct contact between the measuring device and the skin, creating discomfort and inconvenience for daily use.
[0003] Non-contact detection methods generally employ computer vision detection devices based on optical signals and wireless sensing devices. The former uses thermal cameras or RGB cameras to capture facial videos and calculate heart rate by analyzing facial heat changes. However, these optical methods require strict lighting conditions, are highly sensitive to lighting conditions, and pose privacy concerns. The latter detects respiration and heart rate by transmitting wireless signals into the target space and capturing changes in the reflected signal caused by chest movement. This method is more reliable than other non-contact methods under varying external conditions (such as light and temperature). However, due to wireless signal attenuation and multidirectional propagation, wireless sensing has certain limitations: it can only detect relatively obvious motion trajectories and breathing movements, but cannot detect subtle heartbeat movements. Furthermore, its sensing range is limited to 1-0.8 meters, which is required for fine-grained signal detection, such as heartbeat movement. Simultaneously detecting both respiration and heartbeat significantly restricts the subject's range of movement, making it unsuitable for long-term, comprehensive daily monitoring.
[0004] Therefore, there is an urgent need for a breathing and heartbeat detection method that can not only achieve non-contact detection to ensure daily convenience for users, but also compensate for wireless signal attenuation, accurately extract breathing and heartbeat movements, and perform long-distance and long-term detection. Summary of the Invention
[0005] In view of this, an embodiment of the present invention provides a method and device for detecting respiratory rate and heart rate to eliminate or improve one or more defects in the prior art, overcome the inconvenience brought to users by contact detection in daily life, the attenuation of wireless signals in non-contact detection, the inability to detect small motion signals (such as heartbeat signals) and the limited detection range.
[0006] The technical solutions of the present invention are as follows:
[0007] In one aspect, the present invention provides a method for detecting respiratory rate and heart rate, the method comprising:
[0008] The millimeter-wave radar transmits a frequency-modulated continuous wave toward the chest of the target user and receives the reflected signal;
[0009] Mixing the reflected signal with the frequency modulated continuous wave (FMCW) to obtain a target signal; performing spectrum analysis on the target signal frame by frame to obtain signal strengths within different distance ranges, and taking the distance range with significantly stronger signal strength as the chest cavity location range;
[0010] A principal component analysis method is used to obtain a principal component of the target signal as a chest motion signal, and an optimization operation is performed on the chest motion signal, wherein the optimization operation at least includes phase extraction, phase unwrapping, and moving average filtering;
[0011] Obtaining the target user's respiratory rate by calculating the main frequency of the chest motion signal;
[0012] A second-order derivative operation is performed on the chest cavity motion signal after the optimization operation to obtain a heartbeat acceleration signal, a heartbeat beat segmentation method is used to divide the heartbeat beats of the acceleration signal, and the heartbeat frequency is calculated based on the heartbeat beats.
[0013] In some embodiments, the target signal is enhanced using a minimum variance distortionless response beamformer.
[0014] In some embodiments, obtaining the target user's respiratory rate by calculating the dominant frequency of the chest motion signal includes:
[0015] Performing filtering processing on the chest cavity motion signal using fast Fourier transform, retaining the main frequency and two frequency bands adjacent to the main frequency on both sides, and discarding the remaining frequency bands;
[0016] Applying inverse Fourier transform to the main frequency and two frequency bands adjacent to the main frequency to obtain a time domain signal in complex form;
[0017] The phase of the time domain signal is calculated and expanded into a continuous phase, and the slope of the continuous phase is linearly fitted to obtain the respiratory frequency.
[0018] In some embodiments, performing a second-order derivative operation on the chest motion signal after the optimization operation to obtain a heartbeat acceleration signal includes:
[0019] The second-order derivative is calculated numerically using a second-order differentiator. The second-order derivative expression is:
[0020]
[0021] Among them, is the second-order derivative of a certain chest motion signal sample point, is the sample value at a distance i from the sample point in the time series, and i takes a value of at least 0, ±1, ±2, ±3; h is the time interval between consecutive sample points.
[0022] In some embodiments, the learning process of the heartbeat segmentation method includes:
[0023] Acquire a training sample set, wherein the training sample set includes a plurality of samples, each sample includes a sample acceleration signal of a heartbeat, and perform training on the sample acceleration signal to segment the heartbeat beat;
[0024] An initial neural network model is obtained, the sample acceleration signal is used as input, and the heartbeat is used as output. The initial neural network model is trained using the training sample set to obtain the heartbeat segmentation method.
[0025] In some embodiments, the initial neural network model is a convolutional neural network model, which includes a continuous one-dimensional convolution layer and a maximum pooling layer.
[0026] In some embodiments, when the initial neural network model is trained using the training sample set, the loss function used in the training is:
[0027] Loss = L2(T) + α*1 / M;
[0028] Wherein, L2 is the L2 norm, T is the convolution kernel, α is the tuning parameter, and M is the value output by the maximum pooling layer.
[0029] In some embodiments, training the initial neural network model using the training sample set further includes:
[0030] The parameters of the initial neural network model are updated by back propagation using the gradient descent method to obtain the heartbeat segmentation method.
[0031] On the other hand, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described above when executing the program.
[0032] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the program implements the steps of the above-described method when executed by a processor.
[0033] The beneficial effects of the present invention are at least:
[0034] The present invention provides a method for detecting respiratory rate and heart rate, which uses millimeter wave radar to perform non-contact detection on the human chest cavity, collects signals related to breathing and heartbeat, and identifies respiratory rate and heartbeat rate, thereby achieving long-term detection of respiratory rate and heartbeat rate while ensuring the normal movement of the user; uses principal component analysis to process the target signal after millimeter wave radar mixing, effectively extracts chest motion signals, analyzes and obtains the rules of chest motion signals, avoids interference from multiple other reflection signals in adjacent reflection areas, and ensures the accuracy of long-distance detection. The main frequency of the chest motion signal is calculated to obtain the respiratory frequency, the second-order derivative of the chest motion signal is calculated and separated to obtain the acceleration signal of the heartbeat, and the acceleration signal is segmented into heartbeat beats based on computer learning to calculate the heartbeat frequency. The detection method provided by the present invention can not only be applied to the detection of vital sign signals in the fields of medical care, health monitoring, etc., but also can realize long-distance human body detection and target search.
[0035] Furthermore, a minimum variance distortion-free corresponding beamformer is used to process multi-channel millimeter wave signals to enhance the signals, compensate for signal attenuation, and achieve long-distance detection.
[0036] Additional advantages, objects, and features of the present invention will be set forth in part in the following description and will in part become apparent to those skilled in the art upon examination of the following or may be learned by practice of the present invention. The objects and other advantages of the present invention may be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as in the accompanying drawings.
[0037] Those skilled in the art will understand that the purposes and advantages that can be achieved by the present invention are not limited to the above specific descriptions, and the above and other purposes that can be achieved by the present invention will be more clearly understood based on the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention. In the drawings:
[0039] Figure 1 1 is a flow chart of the steps of a method for detecting respiratory rate and heart rate in one embodiment of the present invention.
[0040] Figure 21 is a flow chart of a method for detecting respiratory rate and heart rate in one embodiment of the present invention.
[0041] Figure 3 FIG. 4 is a spectrum diagram of a target signal in one embodiment of the present invention.
[0042] Figure 4 2 is a schematic diagram showing the comparison of waveforms before and after the moving average filtering operation in one embodiment of the present invention.
[0043] Figure 5 FIG. 1 is a flow chart of steps of a method for calculating respiratory rate according to an embodiment of the present invention.
[0044] Figure 6 1 is a flow chart of the learning steps of the heartbeat segmentation method in one embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0046] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, the accompanying drawings only show structures and / or processing steps closely related to the solutions according to the present invention, while other details that are not closely related to the present invention are omitted.
[0047] It should be emphasized that the term "include / comprises" when used herein refers to the existence of features, elements, steps or components, but does not exclude the existence or addition of one or more other features, elements, steps or components.
[0048] It should also be noted that, unless otherwise specified, the term "connection" herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0049] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0050] It should be emphasized here that the step marks mentioned below do not limit the order of the steps, but it should be understood that the steps can be executed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be executed simultaneously.
[0051] In order to overcome the inconvenience caused by contact detection of respiratory rate and heart rate to the user's daily activities, as well as the problems of wireless signal attenuation in non-contact detection, inability to detect small motion signals (such as heartbeat signals) and limited detection range, the present invention provides a method for detecting respiratory rate and heart rate, such as Figure 1 As shown, the method includes the following steps S101 to S105:
[0052] Step S101: The millimeter wave radar transmits a frequency modulated continuous wave to the chest of the target user and receives the reflected signal.
[0053] Step S102: Mix the reflected signal and the frequency modulated continuous wave to obtain a target signal; perform spectrum analysis on the target signal frame by frame to obtain signal strengths within different distance ranges, and take the distance range with significantly stronger signal strength as the chest cavity location range.
[0054] Step S103: principal component analysis is used to obtain the principal component of the target signal as the chest motion signal, and an optimization operation is performed on the chest motion signal. The optimization operation at least includes phase extraction, phase unwrapping, and moving average filtering.
[0055] Step S104: obtaining the target user's breathing frequency by calculating the main frequency of the chest motion signal.
[0056] Step S105: performing a second-order derivative operation on the chest motion signal after the optimization operation to obtain a heartbeat acceleration signal, dividing the acceleration signal into heartbeat beats using a heartbeat beat segmentation method, and calculating the heartbeat frequency based on the heartbeat beats.
[0057] In this embodiment, Figure 2 FIG. 1 is a flow chart of a method for detecting respiratory rate and heart rate.
[0058] In step S101, the millimeter-wave radar operates in the millimeter-wave band, where millimeter waves refer to the frequency range of 30 to 300 GHz and a wavelength of 1 to 10 mm. Millimeter-wave radar can distinguish and identify small targets and multiple targets simultaneously, and has imaging capabilities. It is compact, low-cost, operates in all-weather and all-day mode, and is not easily affected by the environment, achieving the long-term detection function required by the present invention.
[0059] Frequency Modulated Continuous Wave (FMCW) is a common technology in radar signal design. From a time-domain perspective, its waveform exhibits a linear frequency variation over time within a frequency sweep cycle. The reflected signal after reflection from a target has a frequency difference with the transmitted signal. By measuring this frequency difference, the distance between the target and the signal transmitter and receiver can be determined, thereby capturing changes in target motion.
[0060] For example, a single-transmitter, single-receiver radar is used for processing, and a frequency-modulated signal is generated by a frequency synthesizer. The signal is transmitted by the transmitting antenna. The electromagnetic wave hits the target user's body and the reflected signal is called an echo signal. The echo signal is received by the receiving antenna and then mixed with the transmitted signal to obtain an intermediate frequency signal, which is the target signal.
[0061] Millimeter-wave radar can use an array of multiple antennas to collect signals from multiple channels. The signal transmitted toward the target user's chest, after reflection, contains breathing signals, heartbeat signals, and signals reflected from other tissues within the chest. The difference frequency signal generated by mixing the reflected signal with the transmitted signal is marked as the target signal. The target signal is generated by reflections from certain tissues and organs in the user's chest. Therefore, the reflected signals should be concentrated near the chest.
[0062] In some embodiments, the target signal is enhanced using a minimum variance distortionless response beamformer.
[0063] The millimeter-wave radar receiver uses an antenna array design to acquire multiple channels, receive multiple signal waveforms, and form a signal array to achieve signal enhancement. After receiving the signal matrix from the antenna array, it is necessary to determine the steering vector to achieve the alignment and fusion of the multi-channel signal phase information. To prevent distance positioning errors, the MVDR (Minimum Variance Distortionless Response) minimum variance distortion-free response technology is used for correction: while ensuring that the signal is distortion-free, the weight of the steering vector is adjusted to minimize the output power of the antenna array signal, that is, the total power is minimized while the effective signal power remains unchanged. The constraint condition is expressed as:
[0064]
[0065] Among them, min is the minimum function, w is the weight of the steering vector, [] H represents the conjugate transpose, R x is the spatial signal correlation covariance matrix, θ s is the possible angle range, usually [-60°, +60°], α(θ s ) is the steering vector corresponding to each angle, and st is the abbreviation for subject to, which represents the constraint condition. The Lagrange multiplier method is then used to calculate the steering vector w, which replaces the single steering vector α(θ) corresponding to each angle. This aligns the antenna array's received signal matrix, ultimately calculating the enhanced reference signal waveform and suppressing noise signals.
[0066] In step S102, the difference frequency signal obtained by mixing the frequency modulated continuous wave (FMCW) emitted by the millimeter wave radar and the reflected signal received by the target user is used as the target signal. The phase change of the target signal is used to reflect the tiny vibration caused by the chest movement.
[0067] Spectrum analysis is an analysis method that replaces the signal with changes in the time domain with the frequency domain. In this example, the target signal is subjected to spectrum analysis and its spectrum diagram is obtained, such as Figure 3 As shown in the figure, the horizontal axis of the spectrum graph represents time, and the vertical axis represents distance range. Specifically, spectrum analysis can be performed using a distance FFT (Fast Fourier Transform). In the spectrum graph, lighter or brighter colors indicate stronger signal strength and energy. Therefore, the distance range of the chest cavity is determined by determining the maximum energy band.
[0068] When a millimeter-wave radar is operating, while maintaining a constant millimeter-wave beam coverage angle, the beam coverage increases with distance. This results in the reflected signal containing not only chest motion signals but also reflections from multiple reflection areas near the chest, such as the abdominal cavity and other human organs. Similarly, the spectrum obtained in step S102 reflects this issue, with some low-intensity signals with weak energy and dark colors. These low-intensity signals are reflections from other reflection areas near the chest.
[0069] Therefore, in step S103, principal component analysis (PCA) is performed using PCA (Principal Component Analysis) to obtain the desired chest motion signal and remove interference from other noise signals. In this embodiment, signals at n distances within a period of time in the spectrogram are randomly selected to construct a data matrix. The covariance matrix is calculated to obtain eigenvectors. The target signal is then decomposed into signals in multiple orthogonal dimensions. The orthogonal dimension corresponding to the largest eigenvector is selected, and the target signal is mapped onto the selected dimension to obtain the chest motion signal, thereby extracting the principal components.
[0070] In this embodiment, the millimeter wave radar receiving end is an antenna array composed of 8 antenna units. The principal component data of steps S101 to S103 are subjected to phase extraction and phase unwrapping operations to achieve accurate motion tracking, and the following is obtained: Figure 3 The waveform diagram on the left clearly shows that the waveform after phase expansion has data drift. Therefore, a moving average filter operation is performed to filter out high-frequency disturbances in the time series and retain useful low-frequency trends, thereby enhancing the chest motion signal and eliminating phase drift. Figure 4 The waveform diagram on the right is shown. Figure 4 The signal waveform on the left is obtained after the moving average filtering operation.
[0071] In step S104, the chest movement is mainly composed of respiratory movement and heartbeat movement. The chest movement signal can be understood as the superposition of the respiratory signal and the heartbeat signal. However, since the amplitude of the respiratory movement is relatively obvious and the amplitude of the heartbeat movement is weak, the chest movement signal is directly used as the respiratory movement signal. The breathing frequency can be obtained by calculating the main frequency of the chest movement signal.
[0072] In step S104, since the chest motion signal primarily reflects the frequency characteristics of respiratory motion, this embodiment directly uses the chest motion signal to calculate the respiratory frequency. The respiratory frequency can be obtained by calculating the dominant frequency of the chest motion signal. This embodiment uses a phase slope-based method to calculate dominant frequency information. Considering that the chest motion signal contains only a single dominant frequency, this frequency can be accurately measured by performing linear regression on the phase of the complex time domain signal.
[0073] In some embodiments, as Figure 5 As shown, in step S104, the respiratory frequency of the target user is obtained by calculating the main frequency of the chest motion signal, which includes the following steps S201 to S203:
[0074] Step S201: Perform filtering processing on the chest cavity motion signal using fast Fourier transform, retain the main frequency and the two frequency bands adjacent to the main frequency, and discard the remaining frequency bands.
[0075] The Fast Fourier Transform (FFT) is a highly efficient algorithm that performs time-to-frequency domain analysis, converting otherwise difficult-to-process time-domain signals into easily analyzable frequency-domain signals (the signal's spectrum). Other frequency bands may represent chest motion signals generated within the chest cavity in addition to respiratory motion, or other interfering signals such as noise generated during data processing. Therefore, this step primarily processes the transformed frequency-domain signal to filter the chest motion signal and eliminate interference from non-periodic motion and noise.
[0076] Step S202: performing inverse Fourier transform on the main frequency and two frequency bands adjacent to the main frequency to obtain a time domain signal in complex form.
[0077] After FFT operation and filtering, the inverse Fourier transform operation is performed on the main frequency and the two frequency bands adjacent to the main frequency on both sides, and the frequency domain signal is converted into a time domain signal for calculation. The complex form z = a + bi is used to directly reflect the amplitude and phase information, which is convenient for calculation in this embodiment.
[0078] Step S203: Calculate the phase of the time domain signal and expand it into a continuous phase, and obtain the respiratory frequency by linearly fitting the slope of the continuous phase.
[0079] When calculating the phase of a time domain signal, the inverse tangent function is used. At this time, the phase extracted from the phase diagram is the wrapped phase value wrapped in a periodic phase interval, not the actual phase, causing the phase to be folded. At this time, some points in the phase diagram will jump, so a phase unwrapping operation is required to restore the original phase value from the periodic interval.
[0080] After phase expansion, the continuous phase is obtained, and the continuous phase conforms to the linear change law. At the same time, it is necessary to ensure that the difference between the two phases is less than π, thereby avoiding the phase being folded in the calculation formula. This causes phase jumps at certain points.
[0081] In step S105, it is known from step S104 that the chest displacement caused by respiratory motion is several orders of magnitude greater than the chest displacement caused by cardiac motion. Therefore, when performing a fast Fourier transform operation, the amplitude of the second harmonic and higher harmonics of the respiratory signal is still greater than the amplitude of the heartbeat signal, so that the filtered phase signal is still affected by the respiratory motion, thereby masking the heartbeat signal and making it impossible to effectively extract the heartbeat signal and calculate the frequency. Considering that respiration is usually slow and stable compared to the heartbeat, and cardiac motion is a rapid contraction of muscles, the acceleration signal can be used to separate the respiratory signal and the heartbeat signal. According to the functional relationship between displacement and acceleration, the second-order derivative of the chest motion displacement signal is calculated to obtain the acceleration signal. The obtained signal, which is proportional to the acceleration but not proportional to the displacement, is used to suppress the influence of the respiratory motion and emphasize the heartbeat signal, thereby achieving separation of the heartbeat signal.
[0082] In some embodiments, in step S105, performing a second-order derivative operation on the chest motion signal after the optimization operation to obtain a heartbeat acceleration signal includes:
[0083] The second-order derivative of the chest motion signal is calculated numerically using a second-order differentiator. The expression of the second-order derivative is:
[0084]
[0085] Among them, is the second-order derivative of a certain chest motion signal sample point, is the sample value at a distance i from the sample point in the time series, and i takes a value of at least 0, ±1, ±2, ±3; h is the time interval between consecutive sample points.
[0086] Velocity causes displacement to change over time, so the combination of velocity and time produces displacement changes. Acceleration causes velocity to change over time, so the combination of acceleration and time produces velocity changes. Conversely, the first-order derivative of displacement with respect to time gives the average velocity, and the first-order derivative of velocity with respect to time gives the average acceleration, so the second-order derivative of displacement with respect to time gives acceleration. It should be noted that the above supplementary explanations are based on popular physics and mathematical concepts and do not involve multidimensionality, position vectors, and other topics.
[0087] In some embodiments, in step S105, Figure 6 As shown, the learning process of the heartbeat segmentation method includes steps S301 to S302:
[0088] Step S301: obtaining a training sample set, wherein the training sample set includes a plurality of samples, each sample including a sample acceleration signal of a heartbeat, and performing training on the sample acceleration signal to segment the heartbeat beat.
[0089] Step S302: obtaining an initial neural network model, taking the sample acceleration signal as input and the heartbeat as output, and using the training sample set to train the initial neural network model to obtain a heartbeat segmentation method.
[0090] In some embodiments, the initial neural network model is a convolutional neural network model, which includes a continuous one-dimensional convolution layer and a maximum pooling layer.
[0091] Each convolutional layer in a convolutional neural network (CNN) consists of several convolutional units. The parameters of each convolutional unit are optimized through the back-propagation algorithm. The purpose of the convolution operation is to extract different features of the input.
[0092] In this embodiment, after obtaining the heartbeat signal, since the heartbeat signal has obvious beat characteristics, a neural network-based image segmentation method is used to divide the heartbeat signal according to the beat characteristics, and then calculate the fine-grained heart rate according to the length of each beat.
[0093] A one-dimensional convolutional layer is constructed to learn a convolution kernel T as its template segment. The kernel size is 600, the stride is 1, and the zero padding is 300. A maximum pooling layer is constructed after the one-dimensional convolutional layer to capture the peak value of the one-dimensional convolutional layer output, that is, to obtain the maximum value of the convolutional structure. The peak value of the one-dimensional convolutional layer output occurs when the template segment aligns with a single heartbeat, so the number of peaks represents the number of heartbeats. The maximum pooling layer size is 800, and the stride is 100.
[0094] To obtain the optimal parameters for the convolution kernel T to minimize the error, the error function is trained. The error is the difference between the true heartbeat value of the sample label and the heartbeat segmented by the heartbeat segmentation method. The heartbeat segmented by the heartbeat segmentation method is actually the repeated segment of the heartbeat signal data separated above and input into the model. The input heartbeat data is recorded as input data D.
[0095] In the form of convolution, the error function expression is:
[0096] e(i)=|D i -T| 2 =|D i | 2 +|T| 2 -2|D i *T|; (3)
[0097] Among them, e(i) is the error function, D is the input data, T is the template fragment corresponding to the convolution kernel, and i represents the dimension of the data.
[0098] As shown in the expression, since the input data D is fixed data and represents the heartbeat signal separated above, minimizing the error can be achieved by maximizing the convolution |Di*T| while minimizing T. As mentioned above, the template segment T is the convolution kernel, and the convolution |Di*T| is the output of the convolution layer. Therefore, the error function can be designed as the inverse of the convolution kernel size and the convolution layer's convolution result. Using the convolutional neural network (CNN) constructed above, the optimal convolution kernel, i.e., the template segment T, is learned and the neural network is trained to minimize the error function. This solves the problem of segmenting heartbeat signals.
[0099] The learned minimized template segment T is input into the neural network and convolved with the input heartbeat signal. This is then passed through a max pooling layer to obtain the maximum values of the pooling layer's output. These maximum values can be understood as the locations where the segmented segments have the highest degree of match with the template segments, i.e., the locations where individual heartbeats occur after segmenting the heartbeat signal, thereby determining the number of heartbeats. Therefore, the heartbeat frequency can be obtained by selecting the time period for which the heartbeat frequency needs to be calculated and calculating the number and length of heartbeats in the selected period.
[0100] In some embodiments, in step S105, the initial neural network model is trained using the training sample set, and the loss function used in the training is:
[0101] Loss=L2(T)+α*1 / M; (4)
[0102] Among them, L2 is the L2 norm, T is the convolution kernel, α is the tuning parameter, and M is the value output by the maximum pooling layer.
[0103] The neural network uses a certain indicator as a clue to find the optimal weight parameters, and this indicator is the loss function.
[0104] In some embodiments, in step S105, the initial neural network model is trained using a training sample set, and the step also includes: using a gradient descent method to perform back propagation to update the parameters of the initial neural network model to obtain a heartbeat segmentation method.
[0105] Gradient descent is a commonly used optimization algorithm in neural networks. It uses gradients for backpropagation, continuously iterates, updates weights, and bias parameters to find the lowest point of loss, ultimately converging the model and achieving better results.
[0106] In calculus, the gradient is the process of finding the partial derivatives of a multivariate function with respect to its parameters and writing these derivatives as vectors. Geometrically, the gradient is the point where the function's change increases most rapidly. Therefore, the gradient descent method seeks to find the function's minimum value by following the direction opposite to the gradient vector, where the gradient decreases most rapidly.
[0107] In this example, the model is optimized using stochastic gradient descent (SGD). SGD updates the parameters for each training example, performing an update with each execution and performing the update quickly. Frequent updates result in high variance between parameters, causing the loss function to fluctuate with varying strengths, which helps discover new and potentially better local minima.
[0108] In summary, the present invention provides a method for detecting respiratory rate and heart rate, which uses millimeter wave radar to perform non-contact detection on the human chest cavity, collects signals related to breathing and heartbeat, and identifies respiratory rate and heartbeat, so as to achieve long-term detection of respiratory rate and heartbeat while ensuring the normal action of the user; the principal component analysis method is used to process the target signal after the millimeter wave radar mixing, effectively extracts the chest motion signal, analyzes and obtains the law of the chest motion signal, avoids interference from other multiple adjacent reflection area reflection signals, and ensures the accuracy of long-distance detection. The main frequency of the chest motion signal is calculated to obtain the respiratory frequency, the second-order derivative of the chest motion signal is calculated and separated to obtain the acceleration signal of the heartbeat, and the acceleration signal is segmented into heartbeat beats based on computer learning and the heartbeat frequency is calculated. The detection method provided by the present invention can not only be applied to the detection of vital sign signals in the fields of medical care, health monitoring, etc., but also can realize long-distance human body detection and target search.
[0109] Furthermore, a minimum variance distortion-free corresponding beamformer is used to process multi-channel millimeter wave signals to enhance the signals, compensate for signal attenuation, and achieve long-distance detection.
[0110] Corresponding to the above method, the present invention also provides an electronic device, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device / system implements the steps of the method described above.
[0111] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer-readable storage medium may be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the art.
[0112] It should be understood by those skilled in the art that the various exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is specifically performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0113] It should be understood that the present invention is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted. In the above embodiments, several specific steps are described and illustrated as examples. However, the method of the present invention is not limited to the specific steps described and illustrated. Those skilled in the art may make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present invention.
[0114] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or replace features of other embodiments.
[0115] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for detecting respiratory rate and heart rate, characterized in that: include: The millimeter-wave radar transmits a frequency-modulated continuous wave toward the chest of the target user and receives the reflected signal; Mixing the reflected signal with the frequency modulated continuous wave (FMCW) to obtain a target signal; performing spectrum analysis on the target signal frame by frame to obtain signal strengths within different distance ranges, and taking the distance range with significantly stronger signal strength as the chest cavity location range; A principal component analysis method is used to obtain a principal component of the target signal as a chest motion signal, and an optimization operation is performed on the chest motion signal, wherein the optimization operation at least includes phase extraction, phase unwrapping, and moving average filtering; The chest motion signal after the optimization operation is filtered using a fast Fourier transform, retaining the main frequency and two frequency bands adjacent to the main frequency on both sides, and discarding the remaining frequency bands; the main frequency and the two frequency bands adjacent to the main frequency are subjected to an inverse Fourier transform to obtain a time domain signal in complex form; the phase of the time domain signal is calculated and expanded into a continuous phase, and the slope of the continuous phase is linearly fitted to obtain the breathing frequency of the target user; A second-order derivative operation is performed on the chest motion signal after the optimization operation to obtain a heartbeat acceleration signal, a heartbeat beat segmentation method based on a convolutional neural network is used to divide the heartbeat beats of the acceleration signal, and the heartbeat frequency is calculated based on the heartbeat beats; the convolutional neural network includes a continuous one-dimensional convolution layer and a maximum pooling layer.
2. The method for detecting respiratory rate and heart rate according to claim 1, wherein: The target signal is enhanced using a minimum variance distortionless response beamformer.
3. The method for detecting respiratory rate and heart rate according to claim 1, wherein: Performing a second-order derivative operation on the chest cavity motion signal after the optimization operation to obtain a heartbeat acceleration signal includes: The second-order derivative is calculated numerically using a second-order differentiator. The second-order derivative expression is: ; in, is the second-order derivative of a certain chest motion signal sample point, is the sample value with a distance i from the sample point in the time series, where i takes values of 0, ±1, ±2, and ±3; h is the time interval between consecutive sample points.
4. The method for detecting respiratory rate and heart rate according to claim 1, wherein: The learning process of the heartbeat segmentation method includes: Acquire a training sample set, wherein the training sample set includes a plurality of samples, each sample includes a sample acceleration signal of a heartbeat, and perform training on the sample acceleration signal to segment the heartbeat beat; An initial neural network model is obtained, the sample acceleration signal is used as input, and the heartbeat is used as output. The initial neural network model is trained using the training sample set to obtain the heartbeat segmentation method.
5. The method for detecting respiratory rate and heart rate according to claim 4, characterized in that: When the initial neural network model is trained using the training sample set, the loss function used in the training is: Loss=L2(T)+α*1 / M; Wherein, L2 is the L2 norm, T is the convolution kernel, α is the tuning parameter, and M is the value output by the maximum pooling layer.
6. The method for detecting respiratory rate and heart rate according to claim 5, characterized in that: The initial neural network model is trained using the training sample set, further comprising: The parameters of the initial neural network model are updated by back propagation using the gradient descent method to obtain the heartbeat segmentation method.
7. An electronic device comprising a processor and a memory, characterized in that: The memory stores computer instructions, and the processor is configured to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the method according to any one of claims 1 to 6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Electrocardiosignal identification and classification method based on Kernel-CNN
CN110522444A
Emotion monitoring technology for intelligent old-age care
CN113796862A
Spectrum estimation method based on Doppler radar heartbeat detection
CN113951856A