Open access peer-reviewed chapter

ANNHRPAA Based Deep Learning Image Processing for Pneumonia Detection

Written By

Avaragollada Puravarga Mathada Prasanna Kumar and S.M. Vijaya

Submitted: 09 June 2022 Reviewed: 19 July 2022 Published: 22 November 2022

DOI: 10.5772/intechopen.106640

From the Edited Volume

Denoising - New Insights

Edited by Mourad Talbi

Chapter metrics overview

68 Chapter Downloads

View Full Metrics

Abstract

Pneumonia is a syndrome that is cause by a bacterial disease in the lungs. This disease is diagnosed through a chest X-ray. For triumphant treatment early diagnosis is important. This disease can be diagnosed through X-ray imagery. Sometimes due to the unclear chest X-ray image, it can be confused with the other bacterial disease. Consequently, to guide clinicians requires computer-aided diagnosis system. In this, a amalgam reverse transmission algorithms introduced by which erudition of multi-layer network achieved. The clamor investigation of the system is performed by using artificial neural network (ANN). Convolution neural network model vgg19 employed to create a user-friendly webpage for diagnosing this disease. Simulated artificial neural network hybrid reverse propagation adaptive algorithm used for deep learning image processing method in our training stage. The test results showed for the vgg19 network is at an accurateness of 0.91.

Keywords

  • pneumonia
  • transfer learning
  • vgg19
  • deep learning
  • webpage

1. Introduction

Mounting scientific advancement, it is potential to use tools based on unfathomable learning frameworks to discover pneumonia based on upper body X-ray imagery. The confront here would be to aid the conclusion process which allows for expedited treatment and better scientific outcome.

Pneumonia is a bacterial infection in one or both lungs which causes the inflammation of lung tissue. Over 7% of the residents which is 450 million inhabitants are affected by this disease worldwide and 4 million dies every year [1]. In India during, 2016—158,176 deaths were reported, and we continue to have the uppermost number of child deaths all over the globe. On earth pneumonia day the report was released that by 2030 over 11 million under-five children will be dead due to this transferable disease [2]. In the nineteenth century, the father of modern medicine for revolutionizing sir William Osler said pneumonia is “captain of the men of death”.

The virus can easily pass from person to person which make it spread rapidly. One of the common symptoms of COVID-19 that can be easily identified is fever. Since the virus outbreak, thermal screening using infrared thermometers are used at public places to check the body temperature to identify the indicated infected among crowd. This prevention still lacking because it spends a lot of time to check the body temperature from every person and the most importance is the close contact of the infected might lead to spreading it to the person who do the screening process or from the one in charge of screening to the checked people.

Clinical examination such as chest X-ray, blood test, and other techniques are used by doctors to diagnose pneumonia in patients. In this chest X-ray is cheaper because of the technology development in bio-medical equipment. Sometimes even the clinicians fail to detect this disease by x-ray images due to the disturbance in images. Recent technology such as artificial intelligence can be useful to mitigate the disease. Especially for the image classification convolution neural network (CNNs) show great results. The main idea behind CNN is that it is an simulated model of the human brain's visual cortex. Based on the presence of pneumonia chest X-ray images are classified in convolution neural network.

Advertisement

2. Literature survey

The researchers [3] compared two CNN networks to diagnose pneumonia disease. To train the model they used to convey learning and fine-tuning. The consequences of the two networks are compared after the training phase. The accuracy of Xception and vgg19 are 0.82 and 0.87 respectively. And precision for Xception is 0.86 and 0.82 for the normal and pneumonia datasets. The precision for vgg16 is 0.83 and 0.91 respectively for the normal and pneumonia datasets. Here exception is more flourishing in detect pneumonia cases and vgg16 is better in detecting normal cases.

In [4] researchers tried the dissimilar technique for minimizing dimensionality. They used the JSRT dataset which has 247 X-ray images. BSE-JSRT dataset can be extracted after removing the bone shadow (dataset 02). Segmented JSRT (dataset 03) and we can have segmented BSE-JSRT (dataset 04). T-SNE technique is use to remove outlier (dataset 05). Here highest accuracy is obtained from dataset 05 which is 0.71 and the lowest accuracy is dataset 04 which is 0.56. From bone outline dataset 02 we get 0.65 accuracy.

In this paper [5], the authors used the ANN implement for detect lung diseases like pneumonia, TB. The pre- processing techniques are Lung segmentation taking out Image classification. Back-propagation and feed-forward networks are used for image classification. The dataset use from Sassoon sanatorium of 80 patients. They achieved an correctness of 0.92. The limitation is when the CXR position and size change there is no robustness. In this [6] researchers have used CNN techniques such as resnet-50 to diagnose thorax disease using chest X-ray. In pre-processing techniques, the global division take input and local branch is trained after discovering local lesion province. Here resnet-50 has average accuracy of 0.841. The AG-CNN raises the accurateness up to 0.868.

The researchers in [7, 8] created a cheXNet algorithm which as CNN of 121 layers to diagnose the pneumonia disease. They have down scaled the image to 224*224 sizes. In addition to normalization base on standard deviation and mean. The accuracy of cheX Net is 0.435. The Artificial Neural Network model by Prasanna Kumar and Vijaya [2] as Hybrid Back Propagation Adaptive Algorithm (ANNHBPAA) for clatter abolition. Adaptive clatter termination using ANN has been implementing on image signal and intelligent method for real-time signal noise cancellation based on neural networks.

Here [1, 9] the author has taken the data from 3 different hospitals for pneumonia detection. For classification, they have used the cheXNet model. And for the model training PyTorch, 0.2.0 is used. Overall, they have obtained 0.815 accuracies. But CNN does not perform well on the external data.

There has been to a great extent follow a line of investigation by Prasanna Kumar and Vijaya [10, 11] on active noise control (ANC) systems and obtainable simulated results for trans image facsimile systems. The working principle of the anticipated intelligent adaptive filter base noise cancellation system is the prolongation of prior work.

Advertisement

3. Proposed solutions

Known revelation intensity, the quantity of X-rays impinge on the long-suffering different at different location on the patient’s remains. Confrontation of X-rays pass from side to side the patient’s composition. Some are wrapped up by the patient at the same time as others exceed all the way through and are captivated by the imaging detector—an additional statistically controlled process with its own inherent noise characteristics. One time the X-rays have conceded throughout the patient, picture “information” enclosed in the spatial allocation of the X-ray fluence.

The patient’s composition has shaped variation in the X-ray concentration that imaging system uses to create image. Picture “signal” is the inherent arithmetic “noise” connected with the X-ray creation method.

In distinction, when a huge quantity of radiation use, the visibility of the arithmetical noise exist very low, perhaps even hardly noticeable. Although this can outcome in a visually agreeable image, an unnecessarily high revelation level was used, consequential in overexposure to the patient.

Up to this point converse noise coupled with the statistical nature of X-ray production and their succeeding amalgamation by the patient. These process are controlled by indispensable laws of nature and, for any given X-ray acquisition, they establish the fundamental limit on image quality.

Final displayed image comes to that original threshold on image quality distinguish the total of “extra” noise that the detector introduce hooked on the image. This is fundamentally the proportion of the gesture to noise in the final image to the “unique” signal to noise at hand in the occurrence X-ray fluence. Detector forever adds some quantity of noise into the image so the DQE is forever less than 1 shown in Figure 1A–C.

Figure 1.

A (left): Erect Portable Chest @ 105 kVp, 3.2 mAs with 6:1, 103 In/in Grid; B (center): Same patient, same SID @ 95 kVp, 2.8 mAs, no Grid, processed with Smart Grid; C (right): Same capture as B without Smart Grid.

Disperse increases as soon as imaging thicker areas of the corpse—such as the upper body. Conventional method of plummeting scatter is collimation, anti-scatter grids, and/or utilize an air-gap.

In image processing system, noise deletion using adaptive digital sieve is a well-known technique for extract most wanted images gesture by eliminate noise from the lossy picture contained indication tainted by noise. For noise annulment an assortment of gradient adaptive lattice (GAL) and LMS algorithms use. Of late, the cross adaptive algorithms with neural set of connections have gained popularity in cancelling the noise available in image compression and enhancement system. The operational principle of the planned intelligent adaptive filter-based noise cancellation system (AFNCS) is the extension of prior work Kumar et al. [12] which is additional empirically designed and computer-generated to enhance the performance of the input synthetic signal with high opinion to denoising.

This intelligent hybrid reverse transmission algorithm involves both GAL and LMS algorithm. The prime objective of the proposed intelligent AFNCS is to acquire signal as of reference signal and output noisy signal, in the middle of this signal noise is eliminated by subtracting the reference signal and noisy signal with original signal. Significantly reinstate the original signal by eliminate the noise by means of adaptive control and adaptation of weights from beginning to end ANN. The following Figure 2, indicate the chunk depiction of the AFNCS which intakes the input signal “i(t)” and generate signal at output “O(t)” by means of adaptive system and orientation signal “R(t)”. Lastly, the signal with errore(t) is computed by finding the difference amongst reference signal and output signal as given in (1).

Figure 2.

Proposed adaptive filter based noise cancellation system (AFNCS).

et=RtOtE1

Every where ‘t’ represent number of epochs.

Implementation of mixture algorithm consider this inaccuracy signal e(t) to produce a purpose for execution. This function perform the working out of required filter coefficients. The minimize error rate indicate that yield signal is similar as that of sole signal. Here reverse propagation algorithms are use to estimate the error speed of every neuron. The following Figure 2 things to see the structural representation of reverse propagation level diagram of ANN network. The layer diagram of ANN network is finished up of three layers comprising input layer, concealed layer and output layer. The hidden layer is active in among input and output layer which couple both the layers. Overall back propagation network is affected by one neuron error. The network allow image signal to propagate by means of ANN and provides output signal. As given in Eq. (1) the error results of the output layer are computed and this error is forward reverse to participation layer from beginning to end hidden layer in anticipation of the considered necessary output.

Added, to reduce its inaccuracy signal, fine-tuning of weight is to execute for every neurons. Projected hybrid algorithm combine both the reverse propagation algorithm of LMS and GAL which help to embark upon sluggish convergence.

The proposed AFNCS revealed in Figure 1 adopt adaptive filter for carrying out of ANN in addition to as well adopt a control method for fine-tuning of adaptive filter parameter. The elements association is train with ANN by credence fine-tuning. The output of ANN can be obtained by using below formula as given in (2). The following Table 1, indicates the parameters used in design.

TrainTest
Normal1341234
Pneumonia3875390
Total5216624

Table 1.

Distribution of dataset.

ANNout=it×WgE2

Each of the input are accompany by a weight.

If, WgTh

Then the output of ANN will be 1 given in (3)

ANNout=1E3

3.1 Data

In this study, a dataset consisting of 5842 chest X-ray images provided in Table 1 by Guangzhou Women and Children’s Medical Centre, Guangzhou. The X-ray images in the dataset are of different resolutions such as 1328 × 1160 and 1762 × 1535. The number of no pneumonia is 1576, and pneumonia is 4266. Figure 3 shows some X-ray image samples from the dataset. In our models 0 represents normal cases, 1 represents pneumonia cases.

Figure 3.

Data samples from the dataset.

3.2 Pre-processing

In Deep learning, we need more data to be obtained for better and reliable results. However, there might not be more data or enough data for some problems, especially on medical problems. so, to avoid this, experts have some solutions to solve this problem. One of them is data augmentation which avoids over fitting and improves accuracy. It is supported in the Keras deep learning library image data generator class shown in Figure 4. Here we use rescale, shear range, Zoom range, Horizontal flip. We pre-process our X-ray images dataset before it is used for diagnosing pneumonia. The pre-processing has been performed as in following:

Figure 4.

(a) Rescale, (b) zoom range, (c) horizontal flip and (d) shear range for we use rescale, shear range, Zoom range, Horizontal flip. Pre-process our X-ray images dataset before it is used for diagnosing pneumonia.

Unify X-ray images. Before inputting the images into our model, we downscale the images to 224 × 224 and convert them to a NumPy array. It can be suitable for features extraction by VGG. Perform image data argumentation methods, it is supported in the Keras deep learning library via the image data Generator class. Here we use rescale, shear range, Zoom range, Horizontal flip.

3.3 Architecture

AlexNet, AlexNetOWTBn, GoogleNet, VGG models are the most commonly used in transfer learning. They are a stack of many convolution layers. we have many difficulties with deep Convolution neural networks they are optimization of the network, desertion gradient problem, and deprivation problems. The VGG NET brings a new idea in place. It is used to solve complicated tasks and also increases detection accuracy. VggNet tries to resolve the difficulty in the training process of deep Convolution neural networks, the saturation, and degradation of correctness. In this paper, we have used Vgg19 architecture shown in Figure 5. Vgg19 network Vgg19 has 19 layers (16 convolution layers, 3 fully connected layers, 5 MaxPool layers, and 1 SoftMax layer).

Figure 5.

Vgg19 network.

3 × 3 filters are used in the first and second layers in the convolutional layer. Here in the first and second layer totally 64 layers are used which results in 224 × 224 × 64 volume as the same convolution used. 3 × 3 filters are always used with a stride of 1. The next layer is the pooling layer, here to reduce the width and height volume from 224 × 224 × 64 to 112 × 112 × 64 we use the max pool of 2 × 2 size and stride of 2 Next it is followed by 2 convolution layers which as 128 filters. Therefore, it gives the new dimension of 112 × 112 × 128. Here pooling layer is used again to reduce the size to 56 × 56 × 128. Now 256 filters of 2 convolution layers are added then it is reduced to 28 × 28 × 256 by down sampling layer. Then the stack of 3 convolution layers is separated with 1 max-pooling layer. Finally, in the last pooling layer, we get 7 × 7 × 512 volume which is flattened into a fully connected layer with a total channel of 4096 and 1 classes of soft Max output.

Advertisement

4. Hardware explanation

In the projected method, the convergence speed of error signal increase with the value of St. LMS mechanism is adopt in the proposed method because of its easier accomplishment, easy computational, dynamic usage of memory capability and is performed by adjusting filter coefficient for error reduction.

To estimate the performance of the projected adaptive noise cancellation algorithm by replication, the proposed algorithm is implemented on the experimental panel. As revealed in Figure 6, the experimental board includes one major board and one D to A/A to D data exchange card. The 16-bit D/A data exchange card is used to produce two signals. One signal is the communication signals.

Figure 6.

Hardware experimental board.

Initially, the time impediment opinion performance and noise cancellation performance are evaluated in different mixed SNR environment, in that order. Secondly, the noise cancellation performance of proposed algorithm is evaluated when the time delay between the primary input and reference input is changing.

Advertisement

5. Experimental method

In order to authenticate the feasibility of the projected algorithm adaptive noise cancellation system based is built on FPGA, which is revealed in Figure 7.

Figure 7.

Adaptive noise cancellation system.

In a mathematical computing atmosphere projected model by means of soft computation-based algorithm design and implementation. The system stipulation required for performance includes a 64-bit operating system, an x64-based processor supported with 4.00 GB installed memory (RAM), where the processor type is Intel® Core™ i-8250U,CPU@1.80GHz

5.1 Performed tests

We have tried many testing in different experimental setups to analyze the performance of the proposed model. We have changed several network parameters and instructions to create the model. We have split the total dataset into 80% for training purposes and 20% for validation purposes. Then, we have experimented with the dataset with our proposed model.

5.2 Fine-tuning

Fine-enhancement is a method used to increase the effectiveness of a task. It make small changes to improve the outcome. Changing the parameters is so critical that several modify affect the training process a lot for the calculation time desirable the swiftness of convergence and the use of doling out units. Parameters setup for the proposed model given in Table 2. This process of fine-tuning was repeated again and again to improve the accuracy of our model.

ParameterValue
Batch size32
Steps per epoch5216
Epoch20
Validation steps624
optimizerAdam optimizer

Table 2.

Parameters setup for the proposed model.

5.3 Training

We have collected 5842 X-ray images in total as our database from Guangzhou Women and Children’s Medical Centre, Guangzhou, where the number of no pneumonia is 1576, and pneumonia is 4266. All the images are graded into 2 classes (NORMAL & PNEUMONIA) by professional graders and used to train the model. And it is tested with 624 images.

To train the model, we have used the pretrained vggNet, which is initialized with weights trained on ImageNet which gave better results.

5.4 Performance of the proposed model

The model which we have created will start training with the training dataset which consists of both the actual images and the images from the augmentation Then we have used the validation dataset to generalize the model.

Furthermore, we can see the spreading of losses (both training loss and validation loss) concerning the number of epochs in both the training and validation phases

In this paper with the proposed model, the X-ray images were resized into 224 × 224. Then we have done the data augmentation. We used the weights of the pre-trained vgg19 model. We have used Adam optimizer, and we have used the SoftMax activation function and batch size equals 32. In our model, we have set the learning rate, decay, momentum as default values.

Then we started training our vgg19 model, after training, we have got the accuracy score of the model which is 0.91 where we have used the standard ImageNet weights to train the model shown in Figures 8 and 9.

Figure 8.

Pretrained VGG-19 performance for pneumonia prediction task.

Figure 9.

Output of the model predicted with real data.

We have trained our model up to 20 epochs; the training was stopped owing to the absence of further improvement in both accuracy and loss.

Difference between actual and predicted is given in corresponding error Column for the 6 neuron layers obtained for 5000 iterations shown in Table 3 and in Figure 10 gives Comparison of LMS, GAL, hybrid correlation coefficient for 5000 and 10,000 iterations.

Signal typeActual LMSPredictedErrorActual GALPredictedErrorHybrid algorithmsPredictedError
Chirp0.84010.86510.02500.92180.93050.00870.85010.86630.0162
Sinusoidal0.94640.97360.02720.94220.9378−0.00440.94590.95010.0042
SawTooth0.89350.8911−0.00240.90210.8651−0.03700.89090.94770.0568
Image signal0.97980.9601−0.01970.99890.9736−0.02530.99880.9477−0.0511
Total error: 0.0301Total error: −0.0580Total error: 0.0261

Table 3.

Neurons hidden layer, 5000 iterations.

Figure 10.

Comparison of LMS, GAL, hybrid correlation coefficient for 5000 and 10,000 iterations.

Advertisement

6. Results

To predict pneumonia disease, we have created a webpage using flask API. Once Flask API is designed. We can add the trained h5 file in the flask API then we can use the flask run command in the command prompt to run the flask file and create a running webpage link which we can put in the browser to see the webpage.

Figure 11 shows the pneumonia disease input screen. Where user can input their X-ray image by pressing the upload button, once the user clicks on the predict button it will return whether the patient has pneumonia disease or not Figure 12 shows the output of the predicted results.

Figure 11.

Webpage which predicts the disease when input is given.

Figure 12.

Predicts the disease.

Advertisement

7. Bench mark

In the base paper they have used vgg16 and Xception model for performing training. We have used extension of vgg which is vgg19, which as more trainable parameter and gives better accuracy than vgg16 which used in our base paper. In vgg16 we have 138 million parameter and in vgg19 we have 144 million parameters. Vgg19 is the deeper version vgg16 (Table 4).

AlgorithmAccuracy
Base paper resultVgg16, Xception0.87, 0.82
Performance attainmentVgg190.91

Table 4.

Performance attainment.

Advertisement

8. Conclusion

Projected hybrid adaptive algorithms participation signals are deterministic. LMS as well as GAL algorithms are stochastic. Adaptive noise annulment using hybrid adaptive algorithms implement. Compare in the midst of conventional algorithms, the hybrid adaptive algorithms reveal that extremely fast convergence. Amid persistent enhancement of the adaptive hybrid algorithm in addition to the rapid development of signal processing chip it will be further widely use in mobile telecommunication system, in addition to signal processing fields. The simulation perception investigation of hybrid adaptive algorithms is conceded out on the convergence behaviour, correlation coefficient and convergence time. After comparing, simulated results were tabulated. By taking into consideration of accessible algorithms performance of hybrid adaptive algorithms gives enhanced convergence time, convergence behaviour, correlation coefficients. This technique is more systematic in eliminate noise from corrupted signal furthermore has less time to converge, faster response and reduction in memory.

Convolution Neural Network used to identify the pneumonia disease automatically. To train this model employed transfer learning method and carried out fine-tuning to improve the performance of the model, our model can distinguish between 2 classes of pneumonia or normal. The Vgg19 model which we have used has shown significant performance. Results obtained confirm attained valid accuracy up to 0.91 for classifying the pneumonia disease. Inference that our model has great practical significance in early pneumonia screening and diagnosis and has strong potential to be applied in other disease.

References

  1. 1. Zech JR, Badgeley MA, Liu M, Costa AB, Titano JJ, Oermann EK. Variable generalization performance of a deep learning model to detect pneumonia in chest radiographs: A cross-sectional study. PLoS Medicine. 2018;15(11):e1002683
  2. 2. Prasanna Kumar AM, Vijaya SM. ANNHBPAA based noise cancellation employing adaptive digital filters for mobile applications. Journal of the Institution of Engineers (India). 2021;102(4):645-653
  3. 3. Ayan E, Murat H. Diagnosis of Pneumonia from Chest X-Ray Images Using Deep Learning. Kırıkkale, Turkey: Kırıkkale University, IEEE; 2019
  4. 4. Gang P, Wang Z, Zeng W, Gordienko Y, Kochura Y, Alienin O, et al. Dimensionality reduction in deep learning for chest x-ray analysis of lung cancer. In: ICACI 2018: 10th International Conference on Advanced Computational Intelligence, Xiamen, China. IEEE; 2018. pp. 878-883
  5. 5. Khobragade S, Tiwari A, Patil CY, Narke V. Automatic detection of major lung diseases using Chest Radiographs and classification by feed-forward artificial neural network. In: IEEE 1st International Conference on Power Electronics, Intelligent Control and Energy Systems. Delhi, India: Institute of Electrical and Electronics; 2016. pp. 1-5
  6. 6. Udeshani KAG, Meegama RGN, Fernando TGI. Statistical feature-based neural network approach for the detection of lung cancer in chest x-ray images. International Journal of Image Processing (IJIP). 2011;5(4):425-434
  7. 7. Guan Q, Huang Y, Zhong Z, Zheng Z, Zheng L, Yang Y. Diagnose like a radiologist: Attention guided convolutional neural network for thorax disease classification. arXiv preprint arXiv:1801.09927 (2018)
  8. 8. Rajpurkar P, Irvin J, Zhu K, Yang B, Mehta H, Duan T, et al. Chexnet: Radiologist-level pneumonia detection on chest x-rays with deep learning. arXiv preprint arXiv:1711.05225 (2017)
  9. 9. Pingale TH, Patil HT. Analysis of cough sound for pneumonia detection using wavelet transform and statistical parameters. In: 2017 International Conference on Computing, Communication, Control and Automation (ICCUBEA). 2017. pp. 1-6 [Online]
  10. 10. Prasanna Kumar AM, Vijaya SM. Noise cancellation employing adaptive digital filters for mobile applications. Indonesian Journal of Electrical Engineering and Informatics (IJEEI). 2020;8(1):112-121
  11. 11. Vijaya SM, Suresh K. An efficient design approach of ROI based DWT using vedic and wallace tree multiplier on FPGA platform. International Journal of Electrical and Computer Engineering. 2019;9(4):24333
  12. 12. Chan H-P, Sahiner B, Hadjiyski L, Zhou C, Petrick N. Lung nodule detection and classification. U.S. Patent Application 10/504,197, September 22, 2005

Written By

Avaragollada Puravarga Mathada Prasanna Kumar and S.M. Vijaya

Submitted: 09 June 2022 Reviewed: 19 July 2022 Published: 22 November 2022