# Lung sound classification method and system based on deep learning, and storage medium

## A technology of deep learning and classification methods, which is applied in the field of biomedical signal recognition, can solve the problems that the function has not been extended to lung sounds, and the training feature value is single, so as to ensure the accuracy of classification and improve the effect of recognition

Pending Publication Date: 2021-06-01

GUANGZHOU DEVICEGATE INFORMATION TECH

0 Cites 0 Cited by

## AI-Extracted Technical Summary

### Problems solved by technology

Compared with the subjective auscultation method, many scholars have paid attention to the computer-aided analysis of lung sound signals, such as using the Mel frequency cepstral coefficient that characterizes the auditory characteristics of the human ear as the acoustic feature, combined with the Gaussian method based on ...

### Method used

In the embodiment of the present invention, construct corresponding feature matrix by extracting multi-class eigenvalues from the lung sound signal to be tested, can improve the identification effect of the lung sound signal to be tested; Utilize the deep convolutional neural network The advantage of self-learning, based on the vector composition of the feature matrix, adaptively improves the structure of each layer of the deep convolutional neural network, and at the same time, it is organically combined with the SVM classifier to ensure the classification accuracy of the lung sound signal to be teste...

## Abstract

The invention discloses a lung sound classification method and system based on deep learning and a storage medium, and the method comprises the steps: collecting a to-be-tested lung sound signal, and carrying out the preprocessing of the to-be-tested lung sound signal; performing feature extraction on the preprocessed lung sound signal to be tested based on a wavelet transform method to obtain a lung sound feature matrix to be tested; uniformly extracting a plurality of training lung sound feature matrixes with known classification results from a sample database, and training a deep convolutional neural network by using the plurality of training lung sound feature matrixes; and importing the to-be-tested lung sound feature matrix into a trained deep convolutional neural network for feature matching, and outputting a classification result of the to-be-tested lung sound signal. In the embodiment of the invention, the deep convolutional neural network is used for carrying out multi-class feature recognition on the lung sound signal, and a good classification effect is achieved.

Application Domain

Character and pattern recognitionNeural architectures +1

Technology Topic

Feature matchingClassification result +9

## Image

## Examples

- Experimental program(1)

### Example Embodiment

[0042]Example

[0043]Seefigure 1 ,figure 1 A flow schematic of a depth-based lung sound classification method according to an embodiment of the present invention is shown.

[0044]Such asfigure 1 As shown, a depth learning-based lung sound classification method includes the following steps:

[0045]S101, collecting the pulmonary sound signal to be tested, and pretreatment of the tested pulmonary sound;

[0046]The implementation of the present invention includes:

[0047](1) Collect the first pulmonary signal in the inhalation state and the second pulmonary signal in the exhaled state, and package the first pulmonary signal and the second pulmonary sound signal to be tested. The lung sound signal is the same length as the first pulmonary signal and the second pulmonary signal.

[0048](2) The high-frequency portion of the test pulmonary sound signal is pre-loaded by first-order high pass filters, and then the pre-gravity of the pneumonal signal to be tested is divided into window processing.

[0049]Specifically, first, the high-frequency portion to be tested, the high frequency portion to be tested is predicted as: assuming that T (T ≥ 1) is assumed to be tested at the time to test the lung sound sample value of X (t), pre-weight The rear current sampling value will be replaced with x '(t) = x (t) -αx (T-1), the α in the formula is a pre-plus, and the cycle is completed for pre-weight of the lung sound signal to be tested throughout.

[0050]Next, the pre-loaded lung sound signal is subjected to a framing window processing, which is: setting the frame length of 25ms, frame shift to 10 ms, and divide the pre-retransmission to be tested to be tested into several frame pulmonary signals , Call the Hamming window function to weigh the plurality of frame pulmonary signals.

[0051]S102, based on the wavelet transform method, the pretreatment of the pulmonary sound signal to be tested is characterized by the pulmonary sound signal to be tested;

[0052]The implementation of the present invention includes:

[0053](1) Based on the raw frequency range of the pulmonary sound signal to be tested, the pretreatment is carried out on the pretreatment, and the five-layer high frequency wavelet coefficient is obtained.

[0054]Specific performance is as follows:

[0055]The raw frequency range of the pulmonary sound signal to be tested based on the pretreatment is from 0 to 2000 Hz, and the pretreatment is decomposed by the first layer of the pulmonary sound signal to be tested to obtain a low frequency wavelet coefficient a.1(Frequency band is 0 ~ 1000 Hz) and high frequency wavelet coefficient D1(The frequency band is 1000 Hz ~ 2000 Hz);

[0056]The low frequency wavelet coefficient a1Decomposition of the second layer to obtain low frequency wavelet coefficient a2(Frequency band is 0 ~ 500 Hz) and high frequency wavelet coefficient D2(The frequency band is 500 Hz ~ 1000Hz);

[0057]The low frequency wavelet coefficient a2Perform a third layer decomposition to obtain a low frequency wavelet coefficient a3(Frequency band is 0 ~ 250 Hz) and high frequency wavelet coefficient D3(The frequency band is 250 Hz ~ 500 Hz);

[0058]The low frequency wavelet coefficient a3Perform the fourth layer decomposition to obtain a low frequency wavelet coefficient a4(Frequency band is 0 ~ 125Hz) and high frequency wavelet coefficient D4(The frequency band is 125 Hz ~ 250Hz);

[0059]The low frequency wavelet coefficient a4Perform a fifth layer decomposition to obtain a low frequency wavelet coefficient a5(Frequency band is 0 ~ 63Hz) and high frequency wavelet coefficient D5(The frequency band is 63 Hz ~ 125Hz);

[0060]At this time, according to the frequency band range, it is arranged as high to low, and the five high frequency wavelet coefficients are [D)1, D2, D3, D4, D5];

[0061](2) Based on the energy value corresponding to each of the high frequency wavelet coefficients of each layer in the five-layer high frequency wavelet coefficient, a valid N (N ≤ 5) layer high frequency is extracted from the five high-frequency wavelet coefficients. Wavelet coefficient;

[0062]Specifically, first calculate the energy value corresponding to each high frequency wavelet coefficient:

[0063]

[0064]Where: eiThe high frequency wavelet coefficient D of the i-level IiCorresponding energy value, Di, jThe high frequency wavelet coefficient D of the i-level IiThe J20 in the middle, N is the first high frequency wavelet coefficient DiDimension;

[0065]Next, the high-frequency wavelet coefficient of N (N ≤ 5) layer having a value greater than zero is extracted from the five-layer high frequency wavelet coefficient.

[0066](3) Calculate the standard deviation of each of the high-frequency wavelet coefficients in the N-layer high frequency wavelet coefficient, resulting in the first set of feature vectors corresponding to the pulmonary sound signal to be tested, by n standard Deviation composition;

[0067](4) Calculate the effective average of each of the high frequency wavelet coefficients of each of the N-layer high frequency wavelet coefficients, obtaining the second set of feature vectors corresponding to the pulmonary sound signal to be tested after the pre-treatment, from N Effective average composition;

[0068]Among them, the third high frequency wavelet coefficient D is calculated.iThe effective average includes: the high frequency wavelet coefficient D of the i-th layeriAll elements included in the in the middle are absolute, so that all elements are positive, then calculate the average of all current elements.

[0069](5) The energy value of the high frequency wavelet coefficient of each layer in the N layer high frequency wavelet coefficient is the third set of feature vectors, and the first set of feature vectors and the second set of feature vectors are constructed. The pre-treated lung sound signal to be tested to be tested is 3, and the number of rows to be tested the pulmonary sound characteristic matrix is 3, the number of columns is N.

[0070]S103, several training pulmonary feature matrices that are uniformly extracted from the sample database, using the number of training pulmonary feature matrices to train deep convolutional neural networks;

[0071]In an embodiment of the present invention, the sample database is divided into three major class subrigo databases, and a class of subrogabate is used to store all training lung sound feature matrices under normal types. The one of the sub-databases are used to store dry Rosin types. All training lung sound feature matrices, another sub-database for storing all training pulmonary feature matrices under wet rolls, and any of the above-mentioned forms of training pulmonary feature matrix is in the form of the composition of the pulmonary The sound feature matrix is consistent, all of which contain three sets of feature vectors; in addition, the uniform extraction method is limited to reasonably extract from the three class sub-databases in accordance with the specified ratio. The specific implementation process is as follows:

[0072](1) Based on the number of feature vector components included in the plurality of training pulmonary feature matrices in the plurality of training lung sound feature matrices, the layers of the depth convolutional neural network include: one input layer, three convolutions Layers, three pool layer, four full connecting layers and an output layer;

[0073]Among them, a single training pulmonary feature matrix is decomposed by the input layer, and a set of feature vectors is characterized by using a single convolutional layer, a single convolution layer, a single cellification layer, and a single full connect layer. Two-dimensional mapping, in this kind, finally fused via the last full connecting layer, the extract result of the three sets of feature vectors is fused, and the classifier is derived via the output layer tagging, it is easy to build a classifier.

[0074](2) Terminal structure of each layer structure of the depth convolutional neural network, i.e., a value randomly extracts a value of a certain layer structure within the interval [-1, + 1];

[0075](3) Several several training pulmonary feature matrices are divided into training sets and test sets, and the embodiments of the present invention may specify the proportion of the training set and the test set of 8: 2;

[0076](4) Using the training set to train the depth convolutional neural network, and the SVM classifier assembly is created using the characteristics of the training;

[0077]Specifically, since the SVM (Support Vector Machine, the Support Vector Machine) classifier is a two-point linear model, according to the classification of the embodiment of the present invention, the SVM classifier assembly includes a first SVM classifier sequentially connected and Two SVM classifier; wherein the first SVM classifier is used to perform classification recognition for normal pulmonary signal and abnormal lung sound signal; the second SVM classifier is used to perform the trolley signal and the wet Ross signal. Classification recognition, and the trolley signal and the wet roll signal are collectively referred to as the abnormal lung sound signal.

[0078](5) Import the test set into the current depth convolutional neural network for feature extraction, and then use the SVM classifier assembly to classify the characteristic result of the test set;

[0079](6) The correct rate of the classification result of the test set output by the SVM classifier component is calculated from the known classification result of the test set, and it is determined whether the correct rate exceeds the preset threshold, corresponding The result of the judgment is: If the correct rate exceeds the preset threshold, the current depth convolutional neural network directly defines a well-trained depth convolutional neural network; if the correct rate does not exceed the preset threshold Then continue to perform steps (7);

[0080]Among them, the correct rate of the classification result of the test set output of the SVM classifier assembly includes: assuming that the known classification result included in the test set (herein as the original classification result) is trained, the pulmonary sound characteristic matrix The total number is m, and when the M training lung sound feature matrix is identified by the current depth convolutional neural network, if the classification result of the presence of P (P ≤ M), the classification result of the P (P ≤ M) is verified, corresponding to its original classification As the result is the same, the recognition correct rate of the current depth convolutional neural network is obtained (p / m) * 100%.

[0081](7) With the maximum number of iterations, the number of weight parameters of the current depth convolutional neural network is adjusted by the error reverse propagation algorithm, and returned to the secondary adjustment of the secondary adjustment by the training set. Total neural networks are trained, namely: Define the secondary adjusted depth convolutional neural network as the current depth convolutional neural network and return to the execution step (4).

[0082]S104, a deep convolutional neural network to be tested to test the pulmonary sound feature matrix to perform a characteristic match, and output the classification result of the tested pulmonary signal to be tested.

[0083]In the embodiment of the present invention, the corresponding feature matrix is constructed by extracting a plurality of feature values from the lung sound signal to be tested, and the identification effect of the test pulmonary sound signal can be improved; the self-learning advantage of the deep convolutional neural network can be improved. The vector composition based on the feature matrix is adapted to the various layers of deep convolutional neural networks, and simultaneously combined with the SVM classifier to ensure classification accuracy to test the lung sound signal.

[0084]Example

[0085]Seefigure 2 ,figure 2 An assembly diagram of depth learning-based pulmonary tongs classification systems in the embodiment of the present invention is shown.

[0086]Such asfigure 2 As shown, a deep learning-based lung sound classification system includes the following:

[0087]The data pretreatment module 201 is used to collect the lung sound signal to be tested and pretreated the lung sound signal to be tested;

[0088]The specific implementation process includes:

[0089](1) Collect the first pulmonary signal in the inhalation state and the second pulmonary signal in the exhaled state, and package the first pulmonary signal and the second pulmonary sound signal to be tested. The lung sound signal is the same length as the first pulmonary signal and the second pulmonary signal.

[0090](2) The high-frequency portion of the test pulmonary sound signal is pre-loaded by first-order high pass filters, and then the pre-gravity of the pneumonal signal to be tested is divided into window processing.

[0091]Specifically, first, the high-frequency portion to be tested, the high frequency portion to be tested is predicted as: assuming that T (T ≥ 1) is assumed to be tested at the time to test the lung sound sample value of X (t), pre-weight The rear current sampling value will be replaced with x '(t) = x (t) -αx (T-1), the α in the formula is a pre-plus, and the cycle is completed for pre-weight of the lung sound signal to be tested throughout.

[0092]Next, the pre-loaded lung sound signal is subjected to a framing window processing, which is: setting the frame length of 25ms, frame shift to 10 ms, and divide the pre-retransmission to be tested to be tested into several frame pulmonary signals , Call the Hamming window function to weigh the plurality of frame pulmonary signals.

[0093]The feature extraction module 202 is for feature extraction of the pre-treated pulmonary sound signal after the wavelet transform method is based on the wavelet transform method to obtain the pulmonary sound characteristic matrix to be tested.

[0094]The specific implementation process includes:

[0095](1) Based on the raw frequency range of the pulmonary sound signal to be tested, the pretreatment is carried out on the pretreatment, and the five-layer high frequency wavelet coefficient is obtained.

[0096]Specific performance is as follows:

[0097]The raw frequency range of the pulmonary sound signal to be tested based on the pretreatment is from 0 to 2000 Hz, and the pretreatment is decomposed by the first layer of the pulmonary sound signal to be tested to obtain a low frequency wavelet coefficient a.1(Frequency band is 0 ~ 1000 Hz) and high frequency wavelet coefficient D1(The frequency band is 1000 Hz ~ 2000 Hz);

[0098]The low frequency wavelet coefficient a1Decomposition of the second layer to obtain low frequency wavelet coefficient a2(Frequency band is 0 ~ 500 Hz) and high frequency wavelet coefficient D2(The frequency band is 500 Hz ~ 1000Hz);

[0099]The low frequency wavelet coefficient a2Perform a third layer decomposition to obtain a low frequency wavelet coefficient a3(Frequency band is 0 ~ 250 Hz) and high frequency wavelet coefficient D3(The frequency band is 250 Hz ~ 500 Hz);

[0100]The low frequency wavelet coefficient a3Perform the fourth layer decomposition to obtain a low frequency wavelet coefficient a4(Frequency band is 0 ~ 125Hz) and high frequency wavelet coefficient D4(The frequency band is 125 Hz ~ 250Hz);

[0101]The low frequency wavelet coefficient a4Perform a fifth layer decomposition to obtain a low frequency wavelet coefficient a5(Frequency band is 0 ~ 63Hz) and high frequency wavelet coefficient D5(The frequency band is 63 Hz ~ 125Hz);

[0102]At this time, according to the frequency band range, it is arranged as high to low, and the five high frequency wavelet coefficients are [D)1, D2, D3, D4, D5];

[0103](2) Based on the energy value corresponding to each of the high frequency wavelet coefficients of each layer in the five-layer high frequency wavelet coefficient, a valid N (N ≤ 5) layer high frequency is extracted from the five high-frequency wavelet coefficients. Wavelet coefficient;

[0104]Specifically, first calculate the energy value corresponding to each high frequency wavelet coefficient:

[0105]

[0106]Where: eiThe high frequency wavelet coefficient D of the i-level IiCorresponding energy value, Di, jThe high frequency wavelet coefficient D of the i-level IiThe J20 in the middle, N is the first high frequency wavelet coefficient DiDimension;

[0107]Next, the high-frequency wavelet coefficient of N (N ≤ 5) layer having a value greater than zero is extracted from the five-layer high frequency wavelet coefficient.

[0108](3) Calculate the standard deviation of each of the high-frequency wavelet coefficients in the N-layer high frequency wavelet coefficient, resulting in the first set of feature vectors corresponding to the pulmonary sound signal to be tested, by n standard Deviation composition;

[0109](4) Calculate the effective average of each of the high frequency wavelet coefficients of each of the N-layer high frequency wavelet coefficients, obtaining the second set of feature vectors corresponding to the pulmonary sound signal to be tested after the pre-treatment, from N Effective average composition;

[0110]Among them, the third high frequency wavelet coefficient D is calculated.iThe effective average includes: the high frequency wavelet coefficient D of the i-th layeriAll elements included in the in the middle are absolute, so that all elements are positive, then calculate the average of all current elements.

[0111](5) The energy value of the high frequency wavelet coefficient of each layer in the N layer high frequency wavelet coefficient is the third set of feature vectors, and the first set of feature vectors and the second set of feature vectors are constructed. The pre-treated lung sound signal to be tested to be tested is 3, and the number of rows to be tested the pulmonary sound characteristic matrix is 3, the number of columns is N.

[0112]The network training module 203 is used to uniformly draw a number of training pulmonary feature matrices that are known from the sample database from the sample database, and use the several training pulmonary feature matrices to train the deep convolutional neural network;

[0113]In an embodiment of the present invention, the sample database is divided into three major class subrigo databases, and a class of subrogabate is used to store all training lung sound feature matrices under normal types. The one of the sub-databases are used to store dry Rosin types. All training lung sound feature matrices, another sub-database for storing all training pulmonary feature matrices under wet rolls, and any of the above-mentioned forms of training pulmonary feature matrix is in the form of the composition of the pulmonary The sound feature matrix is consistent, all of which contain three sets of feature vectors; in addition, the uniform extraction method is limited to reasonably extract from the three class sub-databases in accordance with the specified ratio. The specific implementation process is as follows:

[0114](1) Based on the number of feature vector components included in the plurality of training pulmonary feature matrices in the plurality of training lung sound feature matrices, the layers of the depth convolutional neural network include: one input layer, three convolutions Layers, three pool layer, four full connecting layers and an output layer;

[0115]Among them, a single training pulmonary feature matrix is decomposed by the input layer, and a set of feature vectors is characterized by using a single convolutional layer, a single convolution layer, a single cellification layer, and a single full connect layer. Two-dimensional mapping, in this kind, finally fused via the last full connecting layer, the extract result of the three sets of feature vectors is fused, and the classifier is derived via the output layer tagging, it is easy to build a classifier.

[0116](2) Terminal structure of each layer structure of the depth convolutional neural network, i.e., a value randomly extracts a value of a certain layer structure within the interval [-1, + 1];

[0117](3) divide the plurality of training pulmonary sound characteristic matrices into training sets and test sets, and embodiments of the present invention may specify the data ratio of the training set to the test set to 8: 2;

[0118](4) Using the training set to train the depth convolutional neural network, and the SVM classifier assembly is created using the characteristics of the training;

[0119]Specifically, since the SVM (Support Vector Machine, the Support Vector Machine) classifier is a two-point linear model, according to the classification of the embodiment of the present invention, the SVM classifier assembly includes a first SVM classifier sequentially connected and Two SVM classifier; wherein the first SVM classifier is used to perform classification recognition for normal pulmonary signal and abnormal lung sound signal; the second SVM classifier is used to perform the trolley signal and the wet Ross signal. Classification recognition, and the trolley signal and the wet roll signal are collectively referred to as the abnormal lung sound signal.

[0120](5) Import the test set into the current depth convolutional neural network for feature extraction, and then use the SVM classifier assembly to classify the characteristic result of the test set;

[0121](6) The correct rate of the classification result of the test set output by the SVM classifier component is calculated from the known classification result of the test set, and it is determined whether the correct rate exceeds the preset threshold, corresponding The result of the judgment is: If the correct rate exceeds the preset threshold, the current depth convolutional neural network directly defines a well-trained depth convolutional neural network; if the correct rate does not exceed the preset threshold Then continue to perform steps (7);

[0122]Among them, the correct rate of the classification result of the test set output of the SVM classifier assembly includes: assuming that the known classification result included in the test set (herein as the original classification result) is trained, the pulmonary sound characteristic matrix The total number is m, and when the M training lung sound feature matrix is identified by the current depth convolutional neural network, if the classification result of the presence of P (P ≤ M), the classification result of the P (P ≤ M) is verified, corresponding to its original classification As the result is the same, the recognition correct rate of the current depth convolutional neural network is obtained (p / m) * 100%.

[0123](7) With the maximum number of iterations, the number of weight parameters of the current depth convolutional neural network is adjusted by the error reverse propagation algorithm, and returned to the secondary adjustment of the secondary adjustment by the training set. Total neural networks are trained, namely: Define the secondary adjusted depth convolutional neural network as the current depth convolutional neural network and return to the execution step (4).

[0124]The information matching module 204 is configured to perform feature matching of the depth convolutional neural network of the introduction of the pulmonary sound feature matrix to the training, and output the classification result of the tested pulmonary sound signal.

[0125]In the embodiment of the present invention, the corresponding feature matrix is constructed by extracting a plurality of feature values from the lung sound signal to be tested, and the identification effect of the test pulmonary sound signal can be improved; the self-learning advantage of the deep convolutional neural network can be improved. The vector composition based on the feature matrix is adapted to the various layers of deep convolutional neural networks, and simultaneously combined with the SVM classifier to ensure classification accuracy to test the lung sound signal.

[0126]A computer readable storage medium provided by the embodiment of the present invention, the computer readable storage medium stores an executable computer program, which is executed by the processor, implemented deep learning-based pulmonary sound proposed by the above embodiment. Classification. Among them, the computer readable storage medium includes, but is not limited to, any type of disc (including floppy disk, hard disk, disc, CD-ROM, and magnetic disc), ROM (Rand-Only Memory, read-only memory), RAM (Random AccessMemory) , Then memory), EraSable Programmable Read-Only Memory, erased programmable read-only memory), EEPROM (Electrical EraSable Programmableread-Only Memory, Electro-Programmable Read-only Memory), flash memory, magnetic card or light card . That is, the storage device includes any medium stored or transmitted by a device (such as computer, mobile phone, etc.), which may be read-only memory, disk, or optical disc.

## PUM

## Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

## Similar technology patents

## Image recognition model training method and device, electronic equipment and storage medium

ActiveCN113111872AReduce false recognition rateImprove the recognition effect

Owner:智道网联科技(北京)有限公司

## Target recognition method and device

PendingCN113762108AImprove the recognition effectThe final result of object recognition is reliable

Owner:ZHEJIANG DAHUA TECH

## Image processing method and device, computer storage medium and electronic equipment

ActiveCN112541502AImprove the recognition effect

Owner:HEFEI LCFC INFORMATION TECH

## Intelligent identification system and method for building material categories

PendingCN111026902AReduce the effect of lightImprove the recognition effect

Owner:贵州黔岸科技有限公司

## Construction site safety helmet identification method and system

Owner:YICHANG WTAU ELECTRONICS EQUIP

## Classification and recommendation of technical efficacy words

- Improve the recognition effect

## Method and device for identifying cheat web-pages

InactiveCN103150369AImprove the recognition effect

Owner:人民搜索网络股份公司

## Text event information extraction method, electronic device and nonvolatile storage medium

ActiveCN110321432ASolve data dispersionImprove the recognition effect

Owner:TRS INFORMATION TECH CO LTD

## Automatic foreign name identification and control method based on context semantics

InactiveCN102955775AReduce recognition errorsImprove the recognition effect

Owner:EAST CHINA NORMAL UNIVERSITY