Small sample respiratory disease pattern recognition method based on diffusion model

By adopting a small sample recognition method based on diffusion model in respiratory pattern recognition, data is generated using the radio frequency diffusion model and combined with the CNN-Transformer algorithm for feature analysis, the problems of data scarcity and low recognition accuracy under small samples are solved, and higher recognition accuracy and generalization ability are achieved.

CN119811684APending Publication Date: 2025-04-11CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202411896403.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The prior art faces the problems of data scarcity, environmental and individual differences in respiratory pattern recognition, and poor performance of machine learning and deep learning algorithms under small sample conditions.

Method used

A small sample respiratory disease pattern recognition method based on diffusion model is adopted, and a breathing pattern data is collected through Wi-Fi devices, and a diverse and high-quality RF time series data is generated using the RF diffusion model. The time series data is converted into two-dimensional images by combining the one-dimensional time series extraction algorithm and the Gram angle field method. The CNN-Transformer algorithm is used for multi-scale feature analysis and classification.

Benefits of technology

Effectively expand the data set, improve the accuracy and generalization ability of respiratory pattern recognition, solve the problems of low recognition accuracy under small sample conditions and insufficient generalization ability of model, and provide a more accurate and reliable solution for contactless respiratory pattern recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119811684A_ABST
    Figure CN119811684A_ABST
Patent Text Reader

Abstract

The invention provides a small sample respiratory disease pattern recognition method based on a diffusion model. The method comprises the following steps: firstly, for common respiratory disease types, collecting and classifying data of three respiratory modes: normal respiration, pause respiration and deep respiration which respectively correspond to respiratory diseases such as normal respiration, obstructive apnea and asthma in medicine; secondly, learning an internal distribution rule of data by using a radio frequency diffusion model, and generating diversified and high-quality radio frequency time sequence data on the basis of limited real samples so as to expand a data set; and thirdly, combining the generated data with real data, extracting an accurate respiration signal through a one-dimensional time sequence extraction algorithm, and converting a time sequence into a two-dimensional image by utilizing a Gramian Angle Field (GAF) method, so that the time dependency relationship of the time sequence is intuitively presented in the image. And finally, a convolutional neural network (CNN)-Transform deep learning model is adopted to carry out feature extraction and classification on the image data, and then multi-scale feature analysis and breathing mode recognition are carried out. According to the method, the recognition precision and generalization ability of the model are remarkably improved under the small sample condition, and an accurate and reliable solution is provided for non-contact breathing mode recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of realizing perception by using commercial Wi-Fi equipment, and specifically relates to a small sample respiratory disease pattern recognition method based on a diffusion model, which is used to realize non-contact accurate recognition of respiratory disease patterns by processing channel state information (CSI) signals, and is particularly suitable for efficient training and classification tasks under small sample conditions. Background Art

[0002] Breathing pattern is an important physiological characteristic that reflects human health. It is crucial for the diagnosis and monitoring of diseases such as chronic obstructive pulmonary disease and sleep apnea syndrome. Unlike single respiratory rate detection, accurate breathing pattern recognition can provide more comprehensive respiratory function information, help detect abnormalities early, and provide a scientific basis for disease prevention and intervention, thereby significantly improving health monitoring results and quality of life. At present, breathing pattern recognition is mainly divided into two categories: wearable and non-contact detection. Wearable devices, such as polysomnography and breathing belts, are inconvenient to carry and poorly adaptable to daily life, which seriously limits the possibility of their widespread application. Among non-contact methods, video-based technology is easily disturbed by lighting conditions and has the risk of privacy leakage, which limits its application scenarios. Solutions based on wireless technology have gradually become the focus of research due to their advantages such as effective privacy protection and insensitivity to light changes.

[0003] In the specific application field of wireless technology, the radar-based breathing pattern detection solution requires the deployment of complex hardware equipment, which increases the cost and difficulty of implementation; although the technology based on Radio Frequency Identification (RFID) can use the radio wave information reflected by the tag to achieve breathing detection, there is a security risk that the tag information can be illegally read and tampered with. In contrast, the breathing pattern recognition method based on commercial Wi-Fi equipment does not require additional hardware deployment and can be carried out based on the existing indoor Wi-Fi infrastructure. It has the advantages of low cost and strong universality. Among them, CSI has become the core of realizing Wi-Fi signal perception. By capturing the amplitude and phase changes of wireless signals during propagation, it can accurately reflect the tiny breathing activities of the human body, providing new technical support for contactless breathing detection.

[0004] Although CSI technology has brought new opportunities for respiratory pattern recognition, it still faces severe challenges. The main problems include: First, data collection is time-consuming and labor-intensive, and it is difficult to obtain a large number of high-quality data sets, which limits the training of respiratory pattern recognition models and seriously restricts the accuracy and generalization ability of the models; second, environmental and individual differences make the collected CSI data unstable, and traditional feature extraction methods are difficult to effectively apply; third, CSI perception relies on weak reflection signals, and respiratory information is easily masked by noise. Existing machine learning and deep learning algorithms perform poorly under small sample conditions.

[0005] In response to the above problems, this patent proposes a small sample respiratory disease pattern recognition method based on a diffusion model. First, for common respiratory disease types, data of three respiratory patterns are collected and classified: normal breathing, apnea and deep breathing, which correspond to normal breathing, obstructive apnea and asthma in medicine. Secondly, the radio frequency diffusion model is used to learn the intrinsic distribution law of the data, and diversified and high-quality radio frequency time series data are generated based on limited real samples to effectively expand the data set. Thirdly, the generated data is combined with the real small sample, and the respiratory signal is accurately extracted through the one-dimensional time series extraction algorithm, and the Gramian Angular Field (GAF) method is used to convert it into two-dimensional image data, so that the time dependency of the time series can be intuitively presented in the image. Finally, the CNN-Transformer algorithm is used to realize multi-scale feature analysis and classification, which significantly improves the recognition accuracy and generalization ability of the model under small sample conditions, and provides an accurate and reliable solution for respiratory pattern recognition. This method has the advantages of low cost and strong adaptability, is suitable for health monitoring and early diagnosis of diseases, and promotes the innovation and development of respiratory health technology. Summary of the invention

[0006] The purpose of the present invention is to provide a small sample breathing pattern recognition method based on a diffusion model to address the problem of scarce breathing data without the need for wearable devices and deployment of cameras. The diffusion model is used to expand data and combined with relevant algorithms to extract features, thereby improving the accuracy of breathing pattern recognition and providing technical support for non-contact breathing monitoring applications.

[0007] The present invention discloses a method for recognizing respiratory disease patterns in small samples based on a diffusion model, which specifically comprises the following steps:

[0008] Step 1: Collect data of three breathing patterns using Wi-Fi devices.

[0009] Under the IEEE 802.11n specification, if the Multiple Input Multiple Output (MIMO) system includes I transmitting antennas and J receiving antennas, the channel status information of each link obtained using the Intel5300 network card can be expressed as:

[0010]

[0011] Among them, H i,j (f, t) represents the channel frequency response (CFR) of the link between the i∈{1,2,…,I}th transmitting antenna and the j∈{1,2,…,J}th receiving antenna at time t and with a carrier frequency of f, which can be expressed as the superposition of multiple propagation paths:

[0012]

[0013] in, is the static component, which is a complex constant; a(f,t), e -j2πd(t)λ and d(t) are the dynamic components The complex attenuation, phase shift and reflection path length, e -jβ It is the time-varying phase offset caused by the asynchrony between the transmitter and the receiver. CSI is obtained by sampling the CFR, f = Δf·k, t = 1 / f s n, where Δf and f s Respectively represent the frequency interval and sampling rate, k∈{1,2,…,K} represents the subcarrier index, n∈{1,2,…,N} represents the data packet index, and N is the total number of data packets. After sampling, it becomes:

[0014]

[0015] Among them, H i,j (k,n) represents the CSI value of the nth data packet in the link between the kth subcarrier and the antenna pair (i,j).

[0016] Step 2: The collected data is preprocessed by link selection, amplitude and phase combination, and subcarrier selection.

[0017] First, calculate the average variance of the subcarrier amplitude of each link, denoted as W = {W i,j} I×J , where W i,j is the average variance of the subcarrier amplitude selected by the link between antenna pair (i, j). Finally, two Wi-Fi links with the largest average variance and the second largest Wi-Fi link are selected. The specific selection method is:

[0018]

[0019] Among them, (q 1 ,r 1 ) and (q 2 ,r 2 ) are the index values ​​of the selected links, and the CSIs of the selected links are and

[0020] Secondly, the CSI values ​​of the two selected links are divided to effectively eliminate some noise and time-varying phase offset in the original CSI amplitude. Subsequently, the amplitude and phase are smoothed using a Savitzky-Golay filter. The processed CSI ratio data can be expressed as:

[0021]

[0022] Among them, x k is the CSI ratio data of the kth subcarrier after filtering, and The nth data packet is respectively on the kth subcarrier and antenna pair (q 1 ,r 1 ) and (q 2 ,r 2 ) link CSI value.

[0023] Finally, the CSI ratio data is projected onto the projection axis [cosθsinθ] of the complex plane, and the projection angle θ is set to (0, π) with a step size of π / P. The candidate sequence generated by the K subcarrier projection is The short-term breathing-to-noise ratio (BNR) is used as the measurement standard. BNR is defined as the ratio of breathing energy to total energy. BNR is calculated for each candidate sequence in the projection matrix Y, and the threshold is set to 0.7 times the maximum BNR. The subcarriers with BNR higher than the threshold are selected. If S subcarriers are finally selected, then:

[0024] Y′=[y′ 1 ,…,y′ s ,…,y′ S ] T

[0025] Among them, y′ s It indicates that the candidate sequence corresponding to the matrix Y in the s-th subcarrier is selected as the final breathing pattern.

[0026] Step 3: Use the signal variational mode decomposition (VMD)-Hilbert-Huang transform (HHT) method to denoise the selected subcarriers to obtain a purer one-dimensional time series.

[0027] First, the original respiratory signal is decomposed into several modal components (Intrinsic Mode Functions, IMFs) by the VMD method:

[0028]

[0029] Among them, y s ′ is the s∈{1,2,…,S}th subcarrier of Y′, which is a discrete time sequence consisting of N values, M is the modal number, u m [n]=[u m [1],u m [2],…,u m [N]] is the mth modal component.

[0030] Secondly, construct a variational problem and decompose the original signal into M modal components. The goal is to minimize the sum of the estimated bandwidths of each mode, and the constraint is that the sum of all modes is equal to the original signal. Then the VMD constrained variational model is:

[0031]

[0032] Among them, Δ[·] represents the difference of n, represents the Hilbert transform, f m is the center frequency of the mth modal component. In order to calculate u m and f m , transform the constrained variational problem into an unconstrained variational problem, take advantage of the quadratic penalty term and the Lagrange multiplier method, and then combine the augmented Lagrangian to solve the variational problem to find the optimal solution:

[0033]

[0034] Among them, α is the penalty factor and λ is the Lagrange multiplier. Finally, the alternating direction method of multipliers (ADMM) is used to solve and obtain M modal components.

[0035] Next, the HHT is used to perform time-frequency analysis on each IMF, construct an analytical signal based on the original signal and its Hilbert transform, extract the instantaneous frequency and instantaneous energy, and thus obtain the energy distribution of each mode in different frequency ranges:

[0036]

[0037] Among them, z m [n] represents the analytical signal of the mth modal component, a m [n] and θ m [n] represents the instantaneous amplitude and instantaneous phase of the mth modal component, E m [n] and w m [n] represents the instantaneous energy and instantaneous frequency of the mth modal component. Since the respiratory frequency range is approximately 0.1-0.5 Hz, the modal components unrelated to breathing are removed by combining HHT time-frequency information analysis, and the remaining modal components are reconstructed.

[0038] Finally, the PCA algorithm is used to reduce the dimension of the selected subcarriers, and the ReliefF algorithm is combined to select the principal components. First, the covariance matrix is ​​calculated and the eigenvalues ​​and eigenvectors are obtained through singular value decomposition. Then, the principal components with a variance contribution rate of more than 99% are selected, and the weight of each subspace signal is calculated using the ReliefF algorithm. Finally, each subspace signal is combined with its weight to construct a one-dimensional time series.

[0039] Step 4: Use the RF diffusion model to generate diversified and high-quality RF time series data to effectively expand the data set. The training process includes two stages: forward destruction and reverse recovery. The forward destruction process simulates the degradation of the signal during transmission by gradually adding noise to the original data; the reverse recovery process gradually removes noise by training the generation model to restore high-quality samples close to the original signal. In the generation stage, the model uses the trained weights and conditional labels as input to generate new RF time series data.

[0040] First, convert the CSI data extracted in step 1 into a two-dimensional tensor Assume that the signal conforms to a certain distribution h 0 ~q(h 0 ), the forward destruction process will generate some random variables h 1 ,h 2 ,…h T Each diffusion step in this process destroys the original distribution in both time and frequency domains. Specifically, the forward diffusion process from step t-1 to t undergoes frequency domain blurring and time domain noise addition:

[0041]

[0042] in, represents Fourier transform, G t is the Gaussian convolution kernel, is Gaussian noise, α t∈(0,1) is a predefined parameter. Based on the convolution theorem, in order to avoid step iteration and reduce time complexity, the above formula can be converted into the following form:

[0043]

[0044] in, It is still a Gaussian convolution kernel. For ease of understanding, Respectively represent the signal h t-1 The forward process is a Markov chain. By recursively applying the above formula, we can get the original signal h 0 With h t Relationship:

[0045]

[0046] in, Therefore, the forward destruction process of any step can be completed quickly without iteration. t In h 0 The above follows a non-isotropic Gaussian distribution:

[0047]

[0048] in, vector It is composed of different weighting coefficients, each of which is multiplied and applied in the time dimension of the original signal to perform weighted adjustment. As the diffusion step does not increase, the original signal is gradually eliminated, and h t Eventually it converges to a closed form noise distribution.

[0049] The reverse recovery process is to reverse the damage, gradually eliminate the noise, and restore the original data distribution. t-1 |h t ) is still a Gaussian distribution, but it cannot be simply inferred, so a hierarchical diffusion transformer design (HDT) is used. HDT fully explores the time-frequency details by decoupling the spatiotemporal dimensions of the RF data. The attention mechanism-based module uses an enhanced transformer to extract RF features.

[0050] First, we learn a distribution that approximates the original distribution p by minimizing the divergence (Kullback-Leibler, KL) θ (h 0 ), but due to q(h 0 ) is difficult to calculate, so by maximizing the variational lower bound to approximate the distribution, the divergence optimization problem can be approximated as:

[0051]

[0052] Among them, q(h t-1 |h t ,h 0 ) represents the true reverse process, and p θ (h t-1 |h t ) represents the reverse process of model fitting. Therefore, the problem of reconstructing the original data distribution can be transformed into the problem of fitting the reverse process. Based on Bayes' theorem, it can be proved that q(h t-1 |h t ,h 0 ) in h t-1 The upper one follows a Gaussian distribution:

[0053]

[0054] Assume that p θ (h t-1 |h t ) is a Gaussian Markov process Therefore, the KL divergence of two Gaussian distributions can be simplified to:

[0055]

[0056] Finally, the parameterized model p θ (h t-1 |h t ) can be optimized by minimizing μ θ and After the training is completed, in the generation process, the trained weight μ θ and condition labels as input to generate new RF time series.

[0057] Step 5: The raw data extracted in step 1 are combined with the data generated by the RF diffusion model in step 4 and converted into a one-dimensional time series through steps 2 and 3. Subsequently, the GAF method is used to convert the one-dimensional time series into two-dimensional images, including the Gramian Summation Angular Field (GASF) and the Gramian Difference Angular Field (GADF).

[0058] Suppose the extracted one-dimensional time series is V = [v 1 ,…,v n ,…,v N ], rescale V so that all values ​​fall within [0,1]:

[0059]

[0060] Encode the value of the above formula as the cosine of the angle, and use the timestamp as the radius to rescale the time series In polar coordinates:

[0061]

[0062] Among them, t i is the timestamp, and N is a constant factor used to normalize the range of the polar coordinate system. After converting the rescaled time series to the polar coordinate system, the correlation between the series is expressed in matrix form through the sum or difference operation of trigonometric functions. The sum or difference of such trigonometric functions is defined as GASF and GADF, as shown in the following formula:

[0063]

[0064] Among them, φ represents the angle of the sequence converted to polar coordinates, I is the unit row vector, is the scaled time vector. It is expressed in a matrix as:

[0065]

[0066] Step 6: Implement breathing pattern recognition based on deep learning model.

[0067] Firstly, the GASF and GADF images of the original data are divided into training set and test set in a ratio of 3:2, while the virtual data generated by the diffusion model are all used as part of the training set to improve the training effect of the model under small sample conditions and increase the generalization ability of the model.

[0068] Secondly, the data is trained based on the CNN-Transformer architecture.

[0069] Data preprocessing: Standardize the training data to ensure the stability and convergence speed of model training.

[0070] Model architecture: CNN is used to extract local spatial features from GAF images, while Transformer models the global dependencies of images through the self-attention mechanism, further integrating local and global features to achieve multi-scale feature analysis and classification.

[0071] Training settings: The model is trained using the Adam optimizer, the loss function is cross entropy, the learning rate is set to 0.005, the training round is set to 50epoch, the batch size is set to 8, and the GPU is used to accelerate the training to shorten the training time.

[0072] Finally, the trained model is used to classify the test set data, and the prediction results are compared with the true labels to evaluate the recognition accuracy, precision and generalization performance of the model.

[0073] Beneficial Effects

[0074] This method first generates diversified and high-quality RF data through the RF diffusion model, effectively expanding the small sample data set and solving the problem of data scarcity. Secondly, the respiratory signal is extracted using a one-dimensional time series extraction algorithm, and the time series data is converted into two-dimensional image data through the Gram angular field, so that the time dependency relationship can be intuitively presented. Thirdly, the CNN-Transformer model is used to extract and classify multi-scale features of image data, fully combining the local feature extraction capability of CNN and the global dependency modeling capability of Transformer to achieve accurate recognition of complex respiratory patterns.

[0075] The present invention provides a small sample breathing pattern recognition method based on a diffusion model. While expanding the data set and improving the model's recognition ability for small sample data, it fully exploits the periodicity and dynamic characteristics of the time series, which not only solves the problem of low accuracy in breathing pattern recognition under data scarcity conditions, but also improves the generalization ability and robustness of the model, providing a more accurate and reliable solution for contactless breathing pattern recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 This is a system block diagram of the small sample respiratory disease pattern recognition method based on the diffusion model of the present invention Specific implementation plan

[0077] The purpose of the present invention is to provide a small sample respiratory disease pattern recognition method based on a diffusion model to address the problem of scarce respiratory data without the need for wearable devices and deployment of cameras. The diffusion model is used to expand data and combined with relevant algorithms to extract features, thereby improving the accuracy of respiratory pattern recognition and providing technical support for non-contact respiratory monitoring applications.

[0078] The present invention discloses a method for recognizing respiratory disease patterns in small samples based on a diffusion model, which specifically comprises the following steps:

[0079] Step 1: Collect data of three breathing patterns using Wi-Fi devices.

[0080] Under the IEEE 802.11n specification, if the Multiple Input Multiple Output (MIMO) system includes I transmitting antennas and J receiving antennas, the channel status information of each link obtained using the Intel5300 network card can be expressed as:

[0081]

[0082] Among them, H i,j (f, t) represents the channel frequency response (CFR) of the link between the i∈{1,2,…,I}th transmitting antenna and the j∈{1,2,…,J}th receiving antenna at time t and with a carrier frequency of f, which can be expressed as the superposition of multiple propagation paths:

[0083]

[0084] in, is the static component, which is a complex constant; a(f,t), e -j2πd(t) / λ and d(t) are the dynamic components The complex attenuation, phase shift and reflection path length, e -jβ It is the time-varying phase offset caused by the asynchrony between the transmitter and the receiver. CSI is obtained by sampling the CFR, f = Δf·k, t = 1 / f s n, where Δf and f s Respectively represent the frequency interval and sampling rate, k∈{1,2,…,K} represents the subcarrier index, n∈{1,2,…,N} represents the data packet index, and N is the total number of data packets. After sampling, it becomes:

[0085]

[0086] Among them, H i,j (k,n) represents the CSI value of the nth data packet in the link between the kth subcarrier and the antenna pair (i,j).

[0087] Step 2: The collected data is preprocessed by link selection, amplitude and phase combination, and subcarrier selection.

[0088] First, calculate the average variance of the subcarrier amplitude of each link, denoted as W = {W i,j} I×J , where W i,j is the average variance of the subcarrier amplitude selected by the link between antenna pair (i, j). Finally, two Wi-Fi links with the largest average variance and the second largest Wi-Fi link are selected. The specific selection method is:

[0089]

[0090] Among them, (q 1 ,r 1 ) and (q 2 ,r 2 ) are the index values ​​of the selected links, and the CSIs of the selected links are and

[0091] Secondly, the CSI values ​​of the two selected links are divided to effectively eliminate some noise and time-varying phase offset in the original CSI amplitude. Subsequently, the amplitude and phase are smoothed using a Savitzky-Golay filter. The processed CSI ratio data can be expressed as:

[0092]

[0093] Among them, x k is the CSI ratio data of the kth subcarrier after filtering, and The nth data packet is respectively on the kth subcarrier and antenna pair (q 1 ,r 1 ) and (q 2 ,r 2 ) link CSI value.

[0094] Finally, the CSI ratio data is projected onto the projection axis [cosθsinθ] of the complex plane, and the projection angle θ is set to (0, π) with a step size of π / P. The candidate sequence generated by the K subcarrier projection is The short-term breathing-to-noise ratio (BNR) is used as the measurement standard. BNR is defined as the ratio of breathing energy to total energy. BNR is calculated for each candidate sequence in the projection matrix Y, and the threshold is set to 0.7 times the maximum BNR. The subcarriers with BNR higher than the threshold are selected. If S subcarriers are finally selected, then:

[0095] Y′=[y′ 1 ,…,y′ s ,…,y′ S ] T

[0096] Among them, y s ' indicates that the candidate sequence corresponding to the matrix Y in the s-th subcarrier is selected as the final breathing pattern.

[0097] Step 3: Use the signal variational mode decomposition (VMD)-Hilbert-Huang transform (HHT) method to denoise the selected subcarriers to obtain a purer one-dimensional time series.

[0098] First, the original respiratory signal is decomposed into several modal components (Intrinsic Mode Functions, IMFs) by the VMD method:

[0099]

[0100] Among them, y s ′ is the s∈{1,2,…,S}th subcarrier of Y′, which is a discrete time sequence consisting of N values, M is the modal number, u m [n]=[u m [1],u m [2],…,u m [N]] is the mth modal component.

[0101] Secondly, construct a variational problem and decompose the original signal into M modal components. The goal is to minimize the sum of the estimated bandwidths of each mode, and the constraint is that the sum of all modes is equal to the original signal. Then the VMD constrained variational model is:

[0102]

[0103] Among them, Δ[·] represents the difference of n, represents the Hilbert transform, f m is the center frequency of the mth modal component. In order to calculate u m and f m , transform the constrained variational problem into an unconstrained variational problem, take advantage of the quadratic penalty term and the Lagrange multiplier method, and then combine the augmented Lagrangian to solve the variational problem to find the optimal solution:

[0104]

[0105] Among them, α is the penalty factor and λ is the Lagrange multiplier. Finally, the alternating direction method of multipliers (ADMM) is used to solve and obtain M modal components.

[0106] Next, the HHT is used to perform time-frequency analysis on each IMF, construct an analytical signal based on the original signal and its Hilbert transform, extract the instantaneous frequency and instantaneous energy, and thus obtain the energy distribution of each mode in different frequency ranges:

[0107]

[0108] Among them, z m [n] represents the analytical signal of the mth modal component, a m [n] and θ m[n] represents the instantaneous amplitude and instantaneous phase of the mth modal component, E m [n] and w m [n] represents the instantaneous energy and instantaneous frequency of the mth modal component. Since the respiratory frequency range is approximately 0.1-0.5 Hz, the modal components unrelated to breathing are removed by combining HHT time-frequency information analysis, and the remaining modal components are reconstructed.

[0109] Finally, the PCA algorithm is used to reduce the dimension of the selected subcarriers, and the ReliefF algorithm is combined to select the principal components. First, the covariance matrix is ​​calculated and the eigenvalues ​​and eigenvectors are obtained through singular value decomposition. Then, the principal components with a variance contribution rate of more than 99% are selected, and the weight of each subspace signal is calculated using the ReliefF algorithm. Finally, each subspace signal is combined with its weight to construct a one-dimensional time series.

[0110] Step 4: Use the RF diffusion model to generate diversified and high-quality RF time series data to effectively expand the data set. The training process includes two stages: forward destruction and reverse recovery. The forward destruction process simulates the degradation of the signal during transmission by gradually adding noise to the original data; the reverse recovery process gradually removes noise by training the generation model to restore high-quality samples close to the original signal. In the generation stage, the model uses the trained weights and conditional labels as input to generate new RF time series data.

[0111] First, convert the CSI data extracted in step 1 into a two-dimensional tensor Assume that the signal conforms to a certain distribution h 0 ~q(h 0 ), the forward destruction process will generate some random variables h 1 ,h 2 ,…h T Each diffusion step in this process destroys the original distribution in both time and frequency domains. Specifically, the forward diffusion process from step t-1 to t undergoes frequency domain blurring and time domain noise addition:

[0112]

[0113] in, represents Fourier transform, G t is the Gaussian convolution kernel, is Gaussian noise, α t ∈(0,1) is a predefined parameter. Based on the convolution theorem, in order to avoid step iteration and reduce time complexity, the above formula can be converted into the following form:

[0114]

[0115] in, It is still a Gaussian convolution kernel. For ease of understanding, Respectively represent the signal h t-1 The forward process is a Markov chain. By recursively applying the above formula, we can get the original signal h 0 With h t Relationship:

[0116]

[0117] in, Therefore, the forward destruction process of any step can be completed quickly without iteration. t In h 0 The above follows a non-isotropic Gaussian distribution:

[0118]

[0119] in, vector It is composed of different weighting coefficients, each of which is multiplied and applied in the time dimension of the original signal to perform weighted adjustment. As the diffusion step does not increase, the original signal is gradually eliminated, and h t Eventually it converges to a closed form noise distribution.

[0120] The reverse recovery process is to reverse the damage, gradually eliminate the noise, and restore the original data distribution. t-1 |h t ) is still a Gaussian distribution, but it cannot be simply inferred, so a hierarchical diffusion transformer design (HDT) is used. HDT fully explores the time-frequency details by decoupling the spatiotemporal dimensions of the RF data. The attention mechanism-based module uses an enhanced transformer to extract RF features.

[0121] First, we learn a distribution that approximates the original distribution p by minimizing the divergence (Kullback-Leibler, KL) θ (h 0 ), but due to q(h 0 ) is difficult to calculate, so by maximizing the variational lower bound to approximate the distribution, the divergence optimization problem can be approximated as:

[0122]

[0123] Among them, q(h t-1 |h t ,h 0 ) represents the true reverse process, and p θ (ht-1 |h t ) represents the reverse process of model fitting. Therefore, the problem of reconstructing the original data distribution can be transformed into the problem of fitting the reverse process. Based on Bayes' theorem, it can be proved that q(h t-1 |h t ,h 0 ) in h t-1 The upper one follows a Gaussian distribution:

[0124]

[0125] Assume that p θ (h t-1 |h t ) is a Gaussian Markov process Therefore, the KL divergence of two Gaussian distributions can be simplified to:

[0126]

[0127] Finally, the parameterized model p θ (h t-1 |h t ) can be optimized by minimizing μ θ and After the training is completed, in the generation process, the trained weight μ θ and condition labels as input to generate new RF time series.

[0128] Step 5: The raw data extracted in step 1 are combined with the data generated by the RF diffusion model in step 4 and converted into a one-dimensional time series through steps 2 and 3. Subsequently, the GAF method is used to convert the one-dimensional time series into two-dimensional images, including the Gramian Summation Angular Field (GASF) and the Gramian Difference Angular Field (GADF).

[0129] Suppose the extracted one-dimensional time series is V = [v 1 ,…,v n ,,v N ], rescale V so that all values ​​fall within [0,1]:

[0130]

[0131] Encode the value of the above formula as the cosine of the angle, and use the timestamp as the radius to rescale the time series In polar coordinates:

[0132]

[0133] Among them, t i is the timestamp, and N is a constant factor used to normalize the range of the polar coordinate system. After converting the rescaled time series to the polar coordinate system, the correlation between the series is expressed in matrix form through the sum or difference operation of trigonometric functions. The sum or difference of such trigonometric functions is defined as GASF and GADF, as shown in the following formula:

[0134]

[0135] Among them, φ represents the angle of the sequence converted to polar coordinates, I is the unit row vector, is the scaled time vector. It is expressed in a matrix as:

[0136]

[0137] Step 6: Implement breathing pattern recognition based on deep learning model.

[0138] Firstly, the GASF and GADF images of the original data are divided into training set and test set in a ratio of 3:2, while the virtual data generated by the diffusion model are all used as part of the training set to improve the training effect of the model under small sample conditions and increase the generalization ability of the model.

[0139] Secondly, the data is trained based on the CNN-Transformer architecture.

[0140] Data preprocessing: Standardize the training data to ensure the stability and convergence speed of model training.

[0141] Model architecture: CNN is used to extract local spatial features from GAF images, while Transformer models the global dependencies of images through the self-attention mechanism, further integrating local and global features to achieve multi-scale feature analysis and classification.

[0142] Training settings: The model is trained using the Adam optimizer, the loss function is cross entropy, the learning rate is set to 0.005, the training round is set to 50epoch, the batch size is set to 8, and the GPU is used to accelerate the training to shorten the training time.

[0143] Finally, the trained model is used to classify the test set data, and the prediction results are compared with the true labels to evaluate the recognition accuracy, precision and generalization performance of the model.

Claims

1. A small sample respiratory disease pattern recognition method based on a diffusion model, comprising the following steps: Step 1: Collect data of three breathing patterns using Wi-Fi devices. Under the IEEE 802.11n specification, if the Multiple Input Multiple Output (MIMO) system includes I transmitting antennas and J receiving antennas, the channel status information of each link obtained using the Intel5300 network card can be expressed as: Among them, H i,j (f, t) represents the channel frequency response (CFR) of the link between the i∈{1,2,…,I}th transmitting antenna and the j∈{1,2,…,J}th receiving antenna at time t and with a carrier frequency of f, which can be expressed as the superposition of multiple propagation paths: in, is the static component, which is a complex constant; a(f,t), e -j2πd(t)λ and d(t) are the dynamic components The complex attenuation, phase shift and reflection path length, e -jβ It is the time-varying phase offset caused by the asynchrony between the transmitter and the receiver. CSI is obtained by sampling the CFR, f = Δf·k, t = 1 / f s n, where Δf and f s Respectively represent the frequency interval and sampling rate, k∈{1,2,…,K} represents the subcarrier index, n∈{1,2,…,N} represents the data packet index, and N is the total number of data packets. After sampling, it becomes: Among them, H i,j (k,n) represents the CSI value of the nth data packet in the link between the kth subcarrier and the antenna pair (i,j). Step 2: The collected data is preprocessed by link selection, amplitude and phase combination, and subcarrier selection. First, calculate the average variance of the subcarrier amplitude of each link, denoted as W = {W i,j } I×J , where W i,j is the average variance of the subcarrier amplitude selected by the link between antenna pair (i, j). Finally, two Wi-Fi links with the largest average variance and the second largest Wi-Fi link are selected. The specific selection method is: Among them, (q1, r1) and (q2, r2) are the index values ​​of the selected links respectively, and the CSI of the selected links are and Secondly, the CSI values ​​of the two selected links are divided to effectively eliminate some noise and time-varying phase offset in the original CSI amplitude. Subsequently, the amplitude and phase are smoothed using a Savitzky-Golay filter. The processed CSI ratio data can be expressed as: Among them, x k is the CSI ratio data of the kth subcarrier after filtering, and are the CSI values ​​of the link between the kth subcarrier and antenna pair (q1, r1) and (q2, r2) for the nth data packet, respectively. Finally, the CSI ratio data is projected onto the projection axis [cosθ sinθ] of the complex plane, and the projection angle θ is set to (0, π) with a step size of π / P. The candidate sequence generated by the K subcarrier projection is The short-term breathing-to-noise ratio (BNR) is used as the measurement standard. BNR is defined as the ratio of breathing energy to total energy. BNR is calculated for each candidate sequence in the projection matrix Y, and the threshold is set to 0.7 times the maximum BNR. The subcarriers with BNR higher than the threshold are selected. If S subcarriers are finally selected, then: Y′=[y′1,…,y′ s ,,and' S ] T Among them, y′ s It indicates that the candidate sequence corresponding to the matrix Y in the s-th subcarrier is selected as the final breathing pattern. Step 3: Use the signal variational mode decomposition (VMD)-Hilbert-Huang transform (HHT) method to denoise the selected subcarriers to obtain a purer one-dimensional time series. First, the original respiratory signal is decomposed into several modal components (Intrinsic Mode Functions, IMFs) by the VMD method: Among them, y s ′ is the s∈{1,2,…,S}th subcarrier of Y′, which is a discrete time sequence consisting of N values, M is the modal number, u m [n]=[u m [1],u m [2],…,u m [N]] is the mth modal component. Secondly, construct a variational problem and decompose the original signal into M modal components. The goal is to minimize the sum of the estimated bandwidths of each mode, and the constraint is that the sum of all modes is equal to the original signal. Then the VMD constrained variational model is: Among them, Δ[·] represents the difference of n, represents the Hilbert transform, f m is the center frequency of the mth modal component. In order to calculate u m and f m , transform the constrained variational problem into an unconstrained variational problem, take advantage of the quadratic penalty term and the Lagrange multiplier method, and then combine the augmented Lagrangian to solve the variational problem to find the optimal solution: Among them, α is the penalty factor and λ is the Lagrange multiplier. Finally, the alternating direction method of multipliers (ADMM) is used to solve and obtain M modal components. Next, the HHT is used to perform time-frequency analysis on each IMF, construct an analytical signal based on the original signal and its Hilbert transform, extract the instantaneous frequency and instantaneous energy, and thus obtain the energy distribution of each mode in different frequency ranges: Among them, z m [n] represents the analytical signal of the mth modal component, a m [n] and θ m [n] represents the instantaneous amplitude and instantaneous phase of the mth modal component, E m [n] and w m [n] represents the instantaneous energy and instantaneous frequency of the mth modal component. Since the respiratory frequency range is approximately 0.1-0.5 Hz, the modal components unrelated to breathing are removed by combining HHT time-frequency information analysis, and the remaining modal components are reconstructed. Finally, the PCA algorithm is used to reduce the dimension of the selected subcarriers, and the ReliefF algorithm is combined to select the principal components. First, the covariance matrix is ​​calculated and the eigenvalues ​​and eigenvectors are obtained through singular value decomposition. Then, the principal components with a variance contribution rate of more than 99% are selected, and the weight of each subspace signal is calculated using the ReliefF algorithm. Finally, each subspace signal is combined with its weight to construct a one-dimensional time series. Step 4: Use the RF diffusion model to generate diversified and high-quality RF time series data to effectively expand the data set. The training process includes two stages: forward destruction and reverse recovery. The forward destruction process simulates the degradation of the signal during transmission by gradually adding noise to the original data; the reverse recovery process gradually removes noise by training the generation model to restore high-quality samples close to the original signal. In the generation stage, the model uses the trained weights and conditional labels as input to generate new RF time series data. First, the CSI data extracted in step 1 is converted into a two-dimensional tensor h = [H 1,1 ,…H i,j ,…H I,J ] T , Assuming that the signal conforms to a specific distribution h0~q(h0), the forward destruction process will generate some random variables h1,h2,...h T Each diffusion step in this process destroys the original distribution in both time and frequency domains. Specifically, the forward diffusion process from step t-1 to t undergoes frequency domain blurring and time domain noise addition: in, represents Fourier transform, G t is the Gaussian convolution kernel, is Gaussian noise, α t ∈(0,1) is a predefined parameter. Based on the convolution theorem, in order to avoid step iteration and reduce time complexity, the above formula can be converted into the following form: in, It is still a Gaussian convolution kernel. For ease of understanding, Respectively represent the signal h t-1 The forward process is a Markov chain. By recursively applying the above formula, we can get the original signal h0 and h t Relationship: in, Therefore, the forward destruction process of any step can be completed quickly without iteration. t It follows a non-isotropic Gaussian distribution on h0: in, vector It is composed of different weighting coefficients, each of which is multiplied and applied in the time dimension of the original signal to perform weighted adjustment. As the diffusion step does not increase, the original signal is gradually eliminated, and h t Eventually it converges to a closed form noise distribution. The reverse recovery process is to reverse the damage, gradually eliminate the noise, and restore the original data distribution. t-1 |h t ) is still a Gaussian distribution, but it cannot be simply inferred, so a hierarchical diffusion transformer design (HDT) is used. HDT fully explores the time-frequency details by decoupling the spatiotemporal dimensions of RF data. The attention mechanism-based module uses an enhanced transformer to extract RF features. First, we learn a distribution that approximates the original distribution p by minimizing the divergence (Kullback-Leibler, KL) θ (h0), but since q(h0) is difficult to calculate, the distribution is approximated by maximizing the variational lower bound. The divergence optimization problem can be approximated as: Among them, q(h t-1 |h t ,h0) represents the true reverse process, and p θ (h t-1 |h t ) represents the reverse process of model fitting. Therefore, the problem of reconstructing the original data distribution can be transformed into the problem of fitting the reverse process. Based on Bayes' theorem, it can be proved that q(h t-1 |h t ,h0) in h t-1 The upper one follows a Gaussian distribution: Assume that p θ (h t-1 |h t ) is a Gaussian Markov process Therefore, the KL divergence of two Gaussian distributions can be simplified to: Finally, the parameterized model p θ (h t-1 |h t ) can be optimized by minimizing μ θ and After the training is completed, in the generation process, the trained weight μ θ and condition labels as input to generate new RF time series. Step 5: The raw data extracted in step 1 are combined with the data generated by the RF diffusion model in step 4 and converted into a one-dimensional time series through steps 2 and 3. Subsequently, the GAF method is used to convert the one-dimensional time series into two-dimensional images, including the Gramian Summation Angular Field (GASF) and the Gramian Difference Angular Field (GADF). Assume that the extracted one-dimensional time series is V = [v1,…,v n ,…,v N ], rescale V so that all values ​​fall within [0,1]: Encode the value of the above formula as the cosine of the angle, and use the timestamp as the radius to rescale the time series In polar coordinates: Among them, t i is the timestamp, and N is a constant factor used to normalize the range of the polar coordinate system. After converting the rescaled time series to the polar coordinate system, the correlation between the series is expressed in matrix form through the sum or difference operation of trigonometric functions. The sum or difference of such trigonometric functions is defined as GASF and GADF, as shown in the following formula: Among them, φ represents the angle of the sequence converted to polar coordinates, I is the unit row vector, is the scaled time vector. It is expressed in a matrix as: Step 6: Implement breathing pattern recognition based on deep learning model. Firstly, the GASF and GADF images of the original data are divided into training set and test set in a ratio of 3:2, while the virtual data generated by the diffusion model are all used as part of the training set to improve the training effect of the model under small sample conditions and increase the generalization ability of the model. Secondly, the data is trained based on the CNN-Transformer architecture. Data preprocessing: Standardize the training data to ensure the stability and convergence speed of model training. Model architecture: CNN is used to extract local spatial features from GAF images, while Transformer models the global dependencies of images through the self-attention mechanism, further integrating local and global features to achieve multi-scale feature analysis and classification. Training settings: The model is trained using the Adam optimizer, the loss function is cross entropy, the learning rate is set to 0.005, the training round is set to 50epoch, the batch size is set to 8, and the GPU is used to accelerate the training to shorten the training time. Finally, the trained model is used to classify the test set data, and the prediction results are compared with the true labels to evaluate the recognition accuracy, precision and generalization performance of the model.

Citation Information

Cited By

  • Intelligent terminal environment monitoring method based on combination of multi-source data fusion and deep learning

    CN120180046A

  • MIMO scattering channel estimation method, medium and device

    CN120547024A

  • A method, medium and device for MIMO scattering channel estimation

    CN120547024B

  • Time sequence set prediction method and system and storage medium

    CN120849827A

  • Breathing mode abnormity identification method and system based on time series data mining

    CN120954745A