Lung sound enhancement method and system, and device and storage medium

Through technologies such as cycle consistency loss model and generative adversarial network, the problem of high cost of lung sound enhancement is solved, efficient lung sound signal processing is achieved, the demand for clean lung sound data is reduced, and the quality and quality of lung sound enhancement are improved. efficiency.

WO2024174183A1PCT designated stage expired Publication Date: 2024-08-29SHENZHEN UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/077983
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-02-23
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

The cost of lung sound enhancement in the existing technology is high, mainly due to the difficulty in obtaining clean lung sound data, which results in high model training costs.

Method used

A cycle consistency loss model based on the first variational autoencoder and the second variational autoencoder is used to train with clean lung sound data and noisy lung sound data, which reduces the demand for clean lung sound data and utilizes Generative adversarial networks and multi-head self-attention models are used for signal processing to improve the quality and efficiency of lung sound enhancement.

Benefits of technology

It reduces the training cost and difficulty of the lung sound enhancement model, requires only a smaller amount of clean lung sound data to complete the training, and improves the effect and accuracy of lung sound enhancement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023077983_29082024_PF_FP_ABST
    Figure CN2023077983_29082024_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present application belong to the technical field of sound signal processing. Disclosed are a lung sound enhancement method and system, and a device and a storage medium. The lung sound enhancement method comprises: acquiring lung sound data to be enhanced; and converting said lung sound data by using a trained lung sound enhancement model, so as to obtain enhanced lung sound data, wherein the lung sound enhancement model is constructed on the basis of a first variational auto-encoder, a second variational auto-encoder and a cyclic consistency loss model, and is trained by means of clean lung sound data and noisy lung sound data, so as to obtain the enhanced lung sound data.
Need to check novelty before this filing date? Find Prior Art

Description

Lung sound enhancement method, system, device and storage medium Technical Field

[0001] The present application relates to the technical field of sound signal processing, and in particular to a lung sound enhancement method, system, device and storage medium. Background Art

[0002] Lung sounds are produced by the vibrations of airflow through the airways and alveoli during breathing. These sounds are transmitted to the body's surface through the lung tissue and chest wall. Lung sound signals exhibit non-Gaussian random characteristics and are unstable. In medicine, lung sounds are an important indicator of both physiological and pathological lung health. Lung auscultation is widely used by medical professionals due to its rapid, low-cost, and sustainable monitoring capabilities.

[0003] Because lung sounds are prone to a large amount of noise, and the frequency bands of this noise often overlap with those of lung sounds, existing technologies typically use wavelet transforms and adaptive filters to enhance lung sound signals. However, these methods require a large number of clean lung sound samples as model training samples, which are difficult to obtain, increasing the cost of lung sound enhancement.

[0004] Summary of the Invention

[0005] In view of this, the present application provides a lung sound enhancement method, system, device, and storage medium to solve the problem in the prior art that lung sound data collection is difficult, resulting in high lung sound enhancement costs. To achieve one, part, or all of the above objectives or other objectives, the present application proposes a lung sound enhancement method, system, device, and storage medium. In the first aspect:

[0006] A lung sound enhancement method, comprising:

[0007] Acquire lung sound data to be enhanced;

[0008] Using the trained lung sound enhancement model to convert the lung sound data to be enhanced to obtain enhanced lung sound data;

[0009] The lung sound enhancement model is constructed based on a first variational autoencoder, a second variational autoencoder, and a cycle consistency loss model, and is trained with clean lung sound data and noisy lung sound data to obtain enhanced lung sound data.

[0010] In one embodiment, before converting the lung sound data to be enhanced using the trained lung sound enhancement model to obtain enhanced lung sound data, the method further includes:

[0011] Training the first variational autoencoder using the clean lung sound data to obtain the trained first variational autoencoder and first feature vector data corresponding to the first variational autoencoder;

[0012] The second variational autoencoder is trained using the noisy lung sound data and the trained first variational autoencoder to obtain second feature vector data corresponding to the second variational autoencoder, a mapping relationship between the first feature vector data and the second feature vector data, and reconstructed noisy data; the second feature vector data, the mapping relationship, and the reconstructed noisy data are obtained under the constraints of the cycle consistency loss model;

[0013] When a preset matching condition is satisfied between the reconstructed noisy data and the noisy lung sound data, it is determined that the training of the lung sound enhancement model is completed.

[0014] In one embodiment, the steps of training the second variational autoencoder using the noisy lung sound data and the trained first variational autoencoder to obtain second eigenvector data corresponding to the second variational autoencoder, a mapping relationship between the first eigenvector data and the second eigenvector data, and reconstructing the noisy data include:

[0015] encoding the noisy lung sound data using encoder 2 of the second variational autoencoder to obtain the second feature vector data;

[0016] According to the mapping relationship between the first feature vector data and the second feature vector data constructed by the cycle consistency loss model, the second feature vector data is decoded using the decoder 1 of the first variational autoencoder that has been trained to obtain purified lung sound data;

[0017] encoding the purified lung sound data using encoder 1 of the trained first variational autoencoder to obtain the first feature vector data;

[0018] Based on the mapping relationship, the first feature vector data is decoded using decoder 2 of the second variational autoencoder to obtain the reconstructed noisy data.

[0019] In one embodiment, after obtaining the enhanced lung sound data, the method further includes:

[0020] Processing the enhanced lung sound data using a preset generative adversarial network model to obtain discriminant value data;

[0021] The generative adversarial network model includes a generator and a discriminator; the first variational autoencoder and the second variational autoencoder both correspond to the generative adversarial network model; the generative adversarial network model corresponding to the first variational autoencoder determines the decoder 1 as the generator; the generative adversarial network model corresponding to the second variational autoencoder determines the decoder 2 as the generator; after the loss function of the first variational autoencoder converges, the corresponding generative adversarial network model is trained; after the loss function of the second variational autoencoder converges, the corresponding generative adversarial network model is trained.

[0022] In one embodiment, the decoder 1, the decoder 2 and the discriminator all include a two-layer multi-head self-attention model.

[0023] In one embodiment, after the enhanced lung sound data is processed using a preset generative adversarial network model to obtain discriminant value data, the method further includes:

[0024] Processing the enhanced lung sound data using the trained lung sound phase correction model to obtain phase-corrected lung sound data;

[0025] The lung sound phase correction model is trained using the clean lung sound data containing white noise.

[0026] In one embodiment, after processing the enhanced lung sound data using the trained lung sound phase correction model to obtain phase-corrected lung sound data, the method further includes:

[0027] The trained signal-to-noise ratio prediction model is used to process the lung sound data to be enhanced and the enhanced lung sound data to obtain corresponding signal-to-noise ratio prediction data.

[0028] Second aspect:

[0029] A lung sound enhancement system includes an acquisition module for acquiring lung sound data to be enhanced;

[0030] a lung sound enhancement module, configured to convert the lung sound data to be enhanced using the trained lung sound enhancement model to obtain enhanced lung sound data;

[0031] The lung sound enhancement model is constructed based on a first variational autoencoder, a second variational autoencoder, and a cycle consistency loss model, and is trained with clean lung sound data and noisy lung sound data to obtain enhanced lung sound data.

[0032] In one embodiment, the system further includes a first training module configured to train the first variational autoencoder using the clean lung sound data before converting the lung sound data to be enhanced using the trained lung sound enhancement model to obtain enhanced lung sound data, thereby obtaining the trained first variational autoencoder and first feature vector data corresponding to the first variational autoencoder.

[0033] a second training module, configured to train the second variational autoencoder using the noisy lung sound data and the trained first variational autoencoder to obtain second eigenvector data corresponding to the second variational autoencoder, a mapping relationship between the first eigenvector data and the second eigenvector data, and reconstructed noisy data; wherein the second eigenvector data, the mapping relationship, and the reconstructed noisy data are obtained under the constraints of the cycle consistency loss model;

[0034] The iteration module is configured to determine that the training of the lung sound enhancement model is completed when a preset matching condition is satisfied between the reconstructed noisy data and the noisy lung sound data.

[0035] In one embodiment, the second training module includes a first encoding unit configured to encode the noisy lung sound data using encoder 2 of the second variational autoencoder to obtain the second feature vector data;

[0036] a first decoding unit, configured to decode the second feature vector data using decoder 1 of the trained first variational autoencoder according to a mapping relationship between the first feature vector data and the second feature vector data constructed by the cycle consistency loss model, to obtain purified lung sound data;

[0037] a second encoding unit, configured to encode the purified lung sound data using encoder 1 of the trained first variational autoencoder to obtain the first feature vector data;

[0038] The second decoding unit is used to decode the first feature vector data using the second decoder of the second variational autoencoder based on the mapping relationship to obtain the reconstructed noisy data.

[0039] In one embodiment, the system further includes a generative adversarial network module for processing the enhanced lung sound data using a preset generative adversarial network model to obtain discriminant value data after obtaining the enhanced lung sound data;

[0040] The generative adversarial network model includes a generator and a discriminator; the first variational autoencoder and the second variational autoencoder both correspond to the generative adversarial network model; the generative adversarial network model corresponding to the first variational autoencoder determines the decoder 1 as the generator; the generative adversarial network model corresponding to the second variational autoencoder determines the decoder 2 as the generator; after the loss function of the first variational autoencoder converges, the corresponding generative adversarial network model is trained; after the loss function of the second variational autoencoder converges, the corresponding generative adversarial network model is trained.

[0041] In one embodiment, the decoder 1, the decoder 2 and the discriminator all include a two-layer multi-head self-attention model.

[0042] In one embodiment, the system further includes a correction module for processing the enhanced lung sound data using a trained lung sound phase correction model to obtain phase-corrected lung sound data after the enhanced lung sound data is processed using a preset generative adversarial network model to obtain discriminant value data;

[0043] The lung sound phase correction model is trained using the clean lung sound data containing white noise.

[0044] In one embodiment, the system further includes a signal-to-noise ratio prediction module, which is configured to process the enhanced lung sound data using the trained lung sound phase correction model to obtain phase-corrected lung sound data, and then process the lung sound data to be enhanced and the enhanced lung sound data using the trained signal-to-noise ratio prediction model to obtain corresponding signal-to-noise ratio prediction data.

[0045] The third aspect:

[0046] A computer device includes a memory and a processor, wherein the memory stores a lung sound enhancement method, and the processor is configured to adopt the above-mentioned method when executing the lung sound enhancement method.

[0047] Fourth aspect:

[0048] A storage medium stores a computer program that can be loaded by a processor and execute the above method.

[0049] Implementing the embodiments of this application will have the following beneficial effects:

[0050] A cycle consistency loss model was used in the construction of the lung sound enhancement model. Both clean and noisy lung sound data were used in the training process. This eliminates the need for equal amounts of clean and noisy lung sound data during training, reducing the amount of clean lung sound data required and the difficulty and cost of training the model. Only a relatively small amount of clean lung sound data is required to complete the training, thus lowering the cost of lung sound enhancement. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0052] in:

[0053] FIG1 is a flow chart of a lung sound enhancement method according to an embodiment.

[0054] FIG2 is a flow chart of obtaining reconstructed noisy data in a lung sound enhancement method according to one embodiment.

[0055] FIG3 is a schematic diagram of a shared latent space correlation structure of lung sound mapping in one embodiment.

[0056] FIG4 is a schematic diagram of the structure of a variational autoencoder combined with a generative adversarial network model in one embodiment.

[0057] FIG5 is a flow chart of lung sound phase correction according to one embodiment.

[0058] FIG6 is a structural block diagram of a lung sound enhancement system according to an embodiment.

[0059] FIG7 is a schematic structural diagram of a lung sound enhancement device in one embodiment. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0061] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0063] This application provides a lung sound enhancement method. Because lung sounds are prone to a large amount of noise, and the frequency bands of this noise overlap with those of lung sounds, existing techniques typically use wavelet transforms and adaptive filters to enhance lung sound signals. However, these methods require a large number of clean lung sound samples as model training samples, which are difficult to obtain, increasing the cost of lung sound enhancement.

[0064] In order to solve the above-mentioned defects, an embodiment of the present application provides a lung sound enhancement method, as shown in FIG1 , comprising:

[0065] 101. Obtain lung sound data to be enhanced.

[0066] In one embodiment, the lung sound data to be enhanced refers to lung sound data that needs to be denoised. The lung sound data to be enhanced can be passively acquired by the current executing entity, or it can be actively acquired by the current executing entity. For example, in one application scenario, the lung sound collection device transmits the lung sound data to be enhanced to the current executing entity, so that the current executing entity passively obtains the lung sound data to be enhanced; in another application scenario, after detecting or receiving an enhancement instruction, the current executing entity obtains the lung sound data to be enhanced through a preset path or interface. It should be noted that the current executing entity can be an intelligent device with data processing capabilities, such as an MCU, an integrated chip, a single-chip microcomputer, or a computer.

[0067] 102. Use the trained lung sound enhancement model to convert the lung sound data to be enhanced to obtain enhanced lung sound data.

[0068] In one embodiment, the lung sound enhancement model is constructed based on a first variational autoencoder, a second variational autoencoder, and a cycle consistency loss model, and is trained by using clean lung sound data and noisy lung sound data.

[0069] For ease of understanding, the lung sound enhancement model is explained. Since it is necessary to remove the noise in the lung sound data to be enhanced to obtain enhanced lung sound data that contains no or little noise, a model that can convert the lung sound data to be enhanced into enhanced lung sound data is needed. Among them, the enhanced lung sound data refers to the enhanced lung sound data after denoising. In the process of training the lung sound enhancement model, two variational autoencoders (VAEs) are used, namely the first variational autoencoder and the second variational autoencoder. By using clean lung sound data to train the first variational autoencoder, the trained first variational autoencoder can extract the features of the clean lung sound data and complete the reconstruction of the clean lung sound data.

[0070] In one embodiment, to reduce the amount of clean lung sound data required during training, a cycle consistency loss model is incorporated into the training of the second variational autoencoder to address the imbalance between clean and noisy lung sound data. This cycle consistency loss model is used to construct a mapping relationship between the two feature vector spaces of the first and second variational autoencoders. This allows the noisy lung sound data to be converted into enhanced lung sound data after processing by the first and second variational autoencoders, achieving the transformation from pre-enhanced lung sound data to enhanced lung sound data, thus addressing the denoising issue of lung sound data.

[0071] A cycle consistency loss model was used in the construction of the lung sound enhancement model. Both clean and noisy lung sound data were used in the training process. This eliminates the need for equal amounts of clean and noisy lung sound data during training, reducing the amount of clean lung sound data required and the difficulty and cost of training the model. Only a relatively small amount of clean lung sound data is required to complete the training, thus lowering the cost of lung sound enhancement.

[0072] Encoder 1 In another embodiment of the present application, before the step of converting the lung sound data to be enhanced using the trained lung sound enhancement model to obtain enhanced lung sound data, the method further includes:

[0073] 201. Train the first variational autoencoder using the clean lung sound data to obtain the trained first variational autoencoder and first feature vector data corresponding to the first variational autoencoder.

[0074] In one embodiment, a first variational autoencoder includes an encoder 1 and a decoder 1. The encoder 1 processes clean lung sound data to obtain first feature vector data. The decoder 1 then processes the first feature vector data to obtain reconstructed clean lung sound data. The first variational autoencoder training is determined to be complete when the similarity between the clean lung sound data and the reconstructed clean lung sound data reaches a preset threshold.

[0075] 202. Train the second variational autoencoder using the noisy lung sound data and the trained first variational autoencoder to obtain second eigenvector data corresponding to the second variational autoencoder, a mapping relationship between the first eigenvector data and the second eigenvector data, and reconstruct the noisy data.

[0076] The second feature vector data, the mapping relationship and the reconstructed noisy data are obtained under the constraints of the cycle consistency loss model.

[0077] For ease of understanding, the first and second variational autoencoders, compared to autoencoders, focus more on data generation. That is, the first and second variational autoencoders do not encode the input data as a single point in a latent space, but rather encode the input data as a probability distribution in the latent space. Specifically, in one embodiment, assume that the first variational autoencoder corresponds to a first latent space, and assume that the second variational autoencoder corresponds to a second latent space. When training the second variational autoencoder, the trained first variational autoencoder is used. Based on the constraints of the cycle consistency loss model, the second variational autoencoder to be trained is used to process the noisy lung sound data to obtain second eigenvector data. Assume there is a shared space. Given clean lung sound data to the first variational autoencoder, and then given noisy lung sound data to the second variational autoencoder. The first eigenvector data in the first latent space and the second eigenvector data in the second latent space are mapped in the shared space to satisfy the cycle consistency loss algorithm.

[0078] In other words, the process of constructing a mapping relationship between the first eigenvector data and the second eigenvector data in a shared space is the training process of the second variational autoencoder. By iteratively processing the noisy lung sound data using the second variational autoencoder to be trained and the trained first variational autoencoder, the mapping relationship is optimized. Each iteration of the decoder generates reconstructed noisy data.

[0079] 203. When a preset matching condition is satisfied between the reconstructed noisy data and the noisy lung sound data, it is determined that the training of the lung sound enhancement model is completed.

[0080] In one embodiment, the reconstructed noisy data is obtained by sequentially processing noisy lung sound data using encoder 2, decoder 1, encoder 1, and decoder 2. Therefore, the reconstructed noisy data should be identical or highly similar to the corresponding noisy lung sound data used as input. Therefore, in one application scenario, the matching condition is to determine whether the similarity between the reconstructed noisy data and the corresponding noisy lung sound data is greater than a preset threshold. If the similarity is greater than the threshold, the matching condition is determined to be met, and the lung sound enhancement model training is then determined to be complete.

[0081] By using noisy lung sound data and a cycle consistency loss model to train the second variational autoencoder, the amount of clean lung sound data used is reduced, which helps to reduce the cost of lung sound enhancement.

[0082] In addition, in another embodiment of the present application, when training the first variational autoencoder and the second variational autoencoder, the short time Fourier transform (STFT) is used to extract the amplitude spectrograms of clean lung sound data and noisy lung sound data, and the amplitude spectrograms are used as inputs of the first variational autoencoder and the second variational autoencoder.

[0083] The amplitude spectrogram is used to train the first variational autoencoder and the second variational autoencoder, thereby completing the training of the lung sound enhancement model, thereby improving the quality and efficiency of the lung sound enhancement model.

[0084] In another embodiment of the present application, as shown in FIG2 , the step of training the second variational autoencoder using the noisy lung sound data and the trained first variational autoencoder to obtain second feature vector data corresponding to the second variational autoencoder, a mapping relationship between the first feature vector data and the second feature vector data, and reconstructing the noisy data includes:

[0085] 301. Use encoder 2 of the second variational autoencoder to encode the noisy lung sound data to obtain the second feature vector data.

[0086] For ease of understanding, as shown in Figure 3, the noisy lung sound data y i By inputting encoder 2, the second feature vector data corresponding to the noisy lung sound data can be obtained.

[0087] 302. According to the mapping relationship between the first feature vector data and the second feature vector data constructed by the cycle consistency loss model, use the decoder of the first variational autoencoder that has completed training to decode the second feature vector data to obtain purified lung sound data.

[0088] Specifically, in one embodiment, since a shared space is set, a mapping relationship is established between the first feature vector data and the second feature vector data in the shared space. After obtaining the second feature vector data, based on the mapping relationship, the second feature vector data is made equal to or close to the first feature vector data. Therefore, after the second feature vector data is used as the input of the decoder 1, the decoder 1 outputs the purified lung sound data. It should be noted that, ideally, the purified lung sound data obtained by processing the second feature vector data using the decoder is The same as the reconstructed clean lung sound data obtained by processing the corresponding first eigenvector data using a decoder pair, the conversion of noisy lung sound data to enhanced lung sound data is completed by using the mapping relationship. Based on this feature, in the process of training the second variational autoencoder, the mapping relationship is iteratively optimized so that after processing the second eigenvector data using a decoder pair, purified lung sound data close to the clean lung sound data can be obtained.

[0089] 303. Use the trained encoder 1 of the first variational autoencoder to encode the purified lung sound data to obtain the first feature vector data.

[0090] Purify lung sound data As the input of encoder one, encoder one cleans lung sound data After processing, the first eigenvector data is obtained. Since there is a mapping relationship between the first eigenvector data and the second eigenvector data, in an ideal state, the first eigenvector data is equal to the second eigenvector data.

[0091] 304. Decode the first feature vector data using a second decoder of the second variational autoencoder based on the mapping relationship to obtain the reconstructed noisy data.

[0092] The first feature vector data is used as the input of the decoder 2 to obtain the reconstructed noisy data In the ideal state, the first eigenvector data is equal to the second eigenvector data. is equal to the reconstructed noisy lung sound data obtained after the second eigenvector data is processed by the second encoder. Based on this feature, the optimization progress of the mapping relationship can be determined by comparing the difference between the reconstructed noisy data and the noisy lung sound data. In one embodiment, when the difference between the reconstructed noisy data and the noisy lung sound data is less than a preset threshold, the training of the second variational autoencoder is determined to be complete, and thus the training of the lung sound enhancement model is determined to be complete.

[0093] In one application scenario, the intermediate representation during the training of the second variational autoencoder is:

[0094] The loss function is:

[0095] Under the constraints of the trained first variational autoencoder and the cycle consistency loss model, the second variational autoencoder is trained, thereby completing the training of the lung sound enhancement model. This eliminates the need to use a large number of clean lung sounds, helping to reduce the cost of lung sound enhancement.

[0096] In another embodiment of the present application, after the step of obtaining the enhanced lung sound data, the method further includes:

[0097] The enhanced lung sound data is processed using a preset generative adversarial network model to obtain discriminant value data.

[0098] The generative adversarial network model includes a generator and a discriminator; the first variational autoencoder and the second variational autoencoder both correspond to the generative adversarial network model; the generative adversarial network model corresponding to the first variational autoencoder determines the decoder 1 as the generator; the generative adversarial network model corresponding to the second variational autoencoder determines the decoder 2 as the generator; after the loss function of the first variational autoencoder converges, the corresponding generative adversarial network model is trained; after the loss function of the second variational autoencoder converges, the corresponding generative adversarial network model is trained.

[0099] In one embodiment, a generative adversarial network (GAN) model is a generative model. The discriminator should output a value as close to 1 as possible, while for fake samples, the discriminator should output a value as close to 0 as possible. Previously, we trained a pair of VAEs, namely a first variational autoencoder and a second variational autoencoder, to convert between clean lung sounds and noisy lung sounds. Because we simply used mean squared error to calculate the VAE reconstruction loss for the samples, the magnitude spectrograms generated by the VAE were always less clear than those generated by the GAN. As shown in Figure 4, a discriminator was added to both VAEs. The two discriminators are combined with the two VAEs. Here, the VAE decoder can be regarded as the GAN generator, and combined with the discriminator for adversarial learning. The discriminator will simultaneously input the lung audio spectrogram of the current domain and the lung audio spectrogram generated by the VAE from another domain and output the probability of belonging to the current domain. If the discriminator determines that the spectrogram belongs to the current domain, the discriminator outputs a value close to 1. If the discriminator determines that the spectrogram is from another domain, the discriminator outputs a value close to 0. To fool the discriminator into classifying the VAE-generated lung audio spectrogram as originally existing in the current domain, the VAE needs to generate more realistic data. Because the GAN training process is unstable, to accelerate training and achieve better results, the discriminator is added and fine-tuned after both VAEs have demonstrated a certain level of generative ability. Convergence of the loss function is considered a model's generative ability.

[0100] The combination of VAE and GAN helps to determine the accuracy of the enhanced lung sound data, thereby promptly discovering defects in the lung sound enhancement model and improving the quality of lung sound enhancement.

[0101] In another embodiment of the present application, the decoder 1, the decoder 2 and the discriminator all include a two-layer multi-head self-attention model.

[0102] Specifically, in one embodiment, according to the Self-Attention GAN structure, a two-layer multi-head self-attention model is added to the decoder of VAE and the discriminator of GAN respectively.

[0103] By adding a multi-head self-attention model, we can better capture the long-range interactions between temporal features. The multi-head self-attention module can help the model focus on information from different representation subspaces at different positions, thereby improving the expressive power of the model.

[0104] In another embodiment of the present application, after the step of processing the enhanced lung sound data using a preset generative adversarial network model to obtain discriminant value data, the method further includes:

[0105] The enhanced lung sound data is processed using the trained lung sound phase correction model to obtain phase-corrected lung sound data.

[0106] The lung sound phase correction model is trained using the clean lung sound data containing white noise.

[0107] In one embodiment, a lung sound phase correction model with a Unet structure is added after the lung sound enhancement model, as shown in FIG5 , and the clean lung sound data X is mixed with white noise at different signal-to-noise ratios to obtain X * , compare the spectrum of X with X * The phase combination generates Will As the training data of the lung sound phase correction model, the lung sound phase correction model is trained using the corresponding lung sounds in X as labels. The training is determined to be complete when the function converges.

[0108] In another embodiment of the present application, after the step of processing the enhanced lung sound data using the trained lung sound phase correction model to obtain phase-corrected lung sound data, the method further includes:

[0109] The trained signal-to-noise ratio prediction model is used to process the lung sound data to be enhanced and the enhanced lung sound data to obtain corresponding signal-to-noise ratio prediction data.

[0110] In one embodiment, the SNR prediction model is a support vector regression (SVR) model. Mel-frequency cepstral coefficients (MFCCs) of lung sounds with varying SNRs are extracted. These MFCCs are used as input to the SVR model, which is trained in a self-supervised manner using the original SNRs as labels. After the SVR model converges, the MFCCs are input into the model, and the model's predicted values ​​serve as the predicted SNRs.

[0111] By predicting the lung sound signal-to-noise ratio, it is easy to know the quality of lung sound enhancement, so that when the quality is poor, defects can be checked and remedied in time to improve the lung sound enhancement effect.

[0112] In another embodiment of the present application, a lung sound enhancement system is also disclosed. As shown in FIG6 , the lung sound enhancement system includes an acquisition module 1 for acquiring lung sound data to be enhanced;

[0113] Lung sound enhancement module 2, configured to convert the lung sound data to be enhanced using the trained lung sound enhancement model to obtain enhanced lung sound data;

[0114] The lung sound enhancement model is constructed based on a first variational autoencoder, a second variational autoencoder, and a cycle consistency loss model, and is trained with clean lung sound data and noisy lung sound data to obtain enhanced lung sound data.

[0115] In one embodiment, the system further includes a first training module configured to train the first variational autoencoder using the clean lung sound data before converting the lung sound data to be enhanced using the trained lung sound enhancement model to obtain enhanced lung sound data, thereby obtaining the trained first variational autoencoder and first feature vector data corresponding to the first variational autoencoder.

[0116] a second training module, configured to train the second variational autoencoder using the noisy lung sound data and the trained first variational autoencoder to obtain second eigenvector data corresponding to the second variational autoencoder, a mapping relationship between the first eigenvector data and the second eigenvector data, and reconstructed noisy data; wherein the second eigenvector data, the mapping relationship, and the reconstructed noisy data are obtained under the constraints of the cycle consistency loss model;

[0117] The iteration module is configured to determine that the training of the lung sound enhancement model is completed when a preset matching condition is satisfied between the reconstructed noisy data and the noisy lung sound data.

[0118] In one embodiment, the second training module includes a first encoding unit configured to encode the noisy lung sound data using encoder 2 of the second variational autoencoder to obtain the second feature vector data;

[0119] a first decoding unit, configured to decode the second feature vector data using decoder 1 of the trained first variational autoencoder according to a mapping relationship between the first feature vector data and the second feature vector data constructed by the cycle consistency loss model, to obtain purified lung sound data;

[0120] a second encoding unit, configured to encode the purified lung sound data using encoder 1 of the trained first variational autoencoder to obtain the first feature vector data;

[0121] The second decoding unit is used to decode the first feature vector data using the second decoder of the second variational autoencoder based on the mapping relationship to obtain the reconstructed noisy data.

[0122] In one embodiment, the system further includes a generative adversarial network module for processing the enhanced lung sound data using a preset generative adversarial network model to obtain discriminant value data after obtaining the enhanced lung sound data;

[0123] The generative adversarial network model includes a generator and a discriminator; the first variational autoencoder and the second variational autoencoder both correspond to the generative adversarial network model; the generative adversarial network model corresponding to the first variational autoencoder determines the decoder 1 as the generator; the generative adversarial network model corresponding to the second variational autoencoder determines the decoder 2 as the generator; after the loss function of the first variational autoencoder converges, the corresponding generative adversarial network model is trained; after the loss function of the second variational autoencoder converges, the corresponding generative adversarial network model is trained.

[0124] In one embodiment, the decoder 1, the decoder 2 and the discriminator all include a two-layer multi-head self-attention model.

[0125] In one embodiment, the system further includes a correction module for processing the enhanced lung sound data using a trained lung sound phase correction model to obtain phase-corrected lung sound data after the enhanced lung sound data is processed using a preset generative adversarial network model to obtain discriminant value data;

[0126] The lung sound phase correction model is trained using the clean lung sound data containing white noise.

[0127] In one embodiment, the system further includes a signal-to-noise ratio prediction module, which is configured to process the enhanced lung sound data using the trained lung sound phase correction model to obtain phase-corrected lung sound data, and then process the lung sound data to be enhanced and the enhanced lung sound data using the trained signal-to-noise ratio prediction model to obtain corresponding signal-to-noise ratio prediction data.

[0128] It should be noted that the description of the lung sound enhancement system embodiment described above is similar to the method description described above and has the same beneficial effects as the method embodiment. For technical details not disclosed in the lung sound enhancement system embodiment of this application, those skilled in the art should refer to the description of the method embodiment of this application for understanding.

[0129] It should be noted that, in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM, Read Only Memory), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0130] Correspondingly, an embodiment of the present application further discloses a storage medium storing a computer program that can be loaded by a processor and execute the above method.

[0131] The embodiment of the present application also discloses a computer device, as shown in Figure 7, comprising a processor 100, at least one communication bus 200, a user interface 300, at least one external communication interface 400, and a memory 500. The communication bus 200 is configured to achieve connection and communication between these components. The user interface 300 may include a display screen, and the external communication interface 400 may include a standard wired interface and a wireless interface. The memory 500 stores a lung sound enhancement method. The processor 100 is configured to adopt the above method when executing the lung sound enhancement method stored in the memory 500.

[0132] The above description of the computer device and storage medium embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the computer device and storage medium embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0133] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0134] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0135] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0136] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0137] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0138] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks or optical disks.

[0139] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks or optical disks.

[0140] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A lung sound enhancement method, wherein: include: Acquire lung sound data to be enhanced; Using the trained lung sound enhancement model to transform the lung sound data to be enhanced, to obtain enhanced lung sound data; The lung sound enhancement model is constructed based on a first variational autoencoder, a second variational autoencoder, and a cycle consistency loss model, and is trained by clean lung sound data and noisy lung sound data.

2. The lung sound enhancement method according to claim 1, wherein: Before converting the lung sound data to be enhanced by using the trained lung sound enhancement model to obtain enhanced lung sound data, the method further includes: Training the first variational autoencoder using the clean lung sound data to obtain the trained first variational autoencoder and first feature vector data corresponding to the first variational autoencoder; The second variational autoencoder is trained by using the noisy lung sound data and the first variational autoencoder that has completed training, to obtain second feature vector data corresponding to the second variational autoencoder, a mapping relationship between the first feature vector data and the second feature vector data, and reconstructed noisy data; the second feature vector data, the mapping relationship, and the reconstructed noisy data are obtained under the constraints of the cycle consistency loss model; When a preset matching condition is satisfied between the reconstructed noisy data and the noisy lung sound data, it is determined that the training of the lung sound enhancement model is completed.

3. The lung sound enhancement method according to claim 2, wherein: The step of training the second variational autoencoder by using the noisy lung sound data and the first variational autoencoder that has completed training, obtaining the second feature vector data corresponding to the second variational autoencoder, the mapping relationship between the first feature vector data and the second feature vector data, and reconstructing the noisy data comprises: Using encoder 2 of the second variational autoencoder to encode the noisy lung sound data to obtain the second feature vector data; According to the mapping relationship between the first feature vector data and the second feature vector data constructed by the cycle consistency loss model, the second feature vector data is decoded by using the decoder 1 of the first variational autoencoder that has completed training to obtain purified lung sound data; Encoding the purified lung sound data using encoder 1 of the first variational autoencoder that has been trained to obtain the first feature vector data; Based on the mapping relationship, the first feature vector data is decoded using decoder 2 of the second variational autoencoder to obtain the reconstructed noisy data.

4. The lung sound enhancement method according to claim 3, wherein: After obtaining the enhanced lung sound data, the method further includes: Processing the enhanced lung sound data using a preset generative adversarial network model to obtain discriminant value data; The generative adversarial network model includes a generator and a discriminator; the first variational autoencoder and the second variational autoencoder both correspond to the generative adversarial network model; the generative adversarial network model corresponding to the first variational autoencoder determines the decoder 1 as the generator; the generative adversarial network model corresponding to the second variational autoencoder determines the decoder 2 as the generator; after the loss function of the first variational autoencoder converges, the corresponding generative adversarial network model is trained; after the loss function of the second variational autoencoder converges, the corresponding generative adversarial network model is trained.

5. The lung sound enhancement method according to claim 4, wherein: The decoder 1, decoder 2 and the discriminator all include a two-layer multi-head self-attention model.

6. The lung sound enhancement method according to claim 4, wherein: After the enhanced lung sound data is processed by using a preset generative adversarial network model to obtain discriminant value data, the method further includes: Processing the enhanced lung sound data using the trained lung sound phase correction model to obtain phase-corrected lung sound data; The lung sound phase correction model is trained using the clean lung sound data containing white noise.

7. The lung sound enhancement method according to claim 6, wherein: After the enhanced lung sound data is processed using the trained lung sound phase correction model to obtain phase-corrected lung sound data, the method further includes: The trained signal-to-noise ratio prediction model is used to process the lung sound data to be enhanced and the enhanced lung sound data to obtain corresponding signal-to-noise ratio prediction data.

8. A lung sound enhancement system, wherein: It includes an acquisition module, used for acquiring lung sound data to be enhanced; A lung sound enhancement module, used to convert the lung sound data to be enhanced by using the trained lung sound enhancement model to obtain enhanced lung sound data; The lung sound enhancement model is constructed based on a first variational autoencoder, a second variational autoencoder, and a cycle consistency loss model, and is trained by clean lung sound data and noisy lung sound data.

9. A computer device comprising a memory and a processor, wherein: The memory stores a lung sound enhancement method, and the processor is used to adopt the method according to any one of claims 1 to 7 when executing the lung sound enhancement method.

10. A storage medium, wherein: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Voice noise method and system for data enhancement

    CN110211575A

  • Multi-view multi-target association method based on deep neural network

    CN113673483A

  • Speech enhancement method based on variational auto-encoder generative adversarial network

    CN115588436A

  • Lung sound enhancement method, system and device and storage medium

    CN116052724A

  • Efficient encoding and decoding sequences using variational autoencoders

    US20190392302A1