Implementation of a Mobile Application based on the Convolutional Neural Network for the Diagnosis of Pneumonia

—Pneumonia is the main cause of infant mortality in Peru, which has led to plansfig, such as vaccination campaigns, greater economic investment in health, and the strengthening of specialized medical personnel, however, mortality rates remain high. In this sense, the implementation of new computer technologies such as Deep Learning through the use of the artificial neural network is proposed. The objective of this project was to determine the influence of a mobile application based on a Convolutional Neural Network for the diagnosis of Pneumonia, the project consists of the analysis of images of Chest X-rays with Pneumonia and Normal by means of an application developed called “Diagnost”. The study was carried out considering a control group and a study group formed by 33 medical staff members who used the application. The analysis of the data obtained was made based on the study of 3 indicators, detection time, result in accuracy, and reduction of medical assistance. According to the results, it was concluded that the mobile application based on the convolutional neural network allows the early detection of Pneumonia and allows the reduction of medical assistance, however, it is still necessary to continue working on the accuracy of the diagnosis.


I. INTRODUCTION
Respiratory infections contribute to high mortality rates worldwide, accounting for more than 4.5 million deaths per year, especially in low-and middle-income countries [1]. These infections cause upper respiratory tract diseases such as rhinitis, sinusitis, pharyngitis, and lower respiratory tract diseases such as bronchitis and pneumonia [2].
The world health organization (WHO) states that Pneumonia is the leading cause of infant mortality in children under 5 years of age worldwide [3], where 2.4 million of these occurred in the first month of life, as well as 1.5 million deaths at the age of 1 to 11 months of life, and 1.3 million at the age of 1 to 4 years [4]. Community-acquired pneumonia is an acute inflammation of the lung parenchyma from microorganisms and is demonstrated by radiological changes in patients and systemic infections, where pneumococcus is probably the most frequent germ. The cause of pneumonia can be fungal, bacterial, or viral, where pneumonia caused by bacteria can be easily treated with antibiotics, but only one-third of children with pneumonia receive the correct medication [5]. According to different studies on the increase of pneumonia in the seasons [6], [7], [8] it has been proved that the belief that low temperatures in winter are the major cause of pneumonia is false; most of the origins of this disease do not depend on seasonal causes.
In Peru in 2021, 1153 cases of pneumonia and 12 deaths from the same cause were reported in children under 5 years of age; so far in the current year 2022, 2149 cases of pneumonia and 21 deaths from the same cause have been reported in the same age range [9], [10]. According to Peru, pneumonia is one of the main causes of death, especially in the pediatric population, highlighting that the method of prevention is timely diagnosis and adequate treatment to help reduce its fatal consequences [11], [12].
The Ministry of Health has carried out contingency plans such as mass vaccination campaigns against pneumonia and influenza, greater economic investment in health, and the reinforcement of specialized medical personnel; however, mortality rates are still high, making it essential to implement new techniques that contribute to the early diagnosis of pneumonia.
Therefore, the aim of this research is to determine the influence of Convolutional Neural Network-based mobile applications on Pneumonia diagnosis. Focusing on early detection of pneumonia, the accuracy of detection, and reduction of medical assistance is in order to contribute to the reduction of pneumonia cases, focusing on early detection by making use of a deep learning technology tool provided to physicians by reducing the demand for these in the detection of pneumonia.
The research is organized as follows. Section II contains a bibliographic study of previous research and its results obtained. Section III details the concepts related to the convolutional neural network for the diagnosis of pneumonia. Section IV formulates the methodology to be used and the type of research. Section V is the case study, where the development and training of the convolutional neural network are described, as well as the development of the application. Section VI is the results phase, showing the descriptive analysis and inferential results. In Section VII, the discussions, analysis, and interpretation of the results are developed. Finally, in Section VIII, conclusions are drawn to enhance the proposed objective.

II. BIBLIOGRAPHIC STUDY
According to [13], a fast and reliable detection method is required to prevent the spread of infections. In recent years, great expectations have been raised from the community of healthcare professionals and patients regarding the use of smart technology to provide innovative solutions for the treatment of diseases this due to the great potential of the technology [14].
In [15] it is stated that regularly the users are not informed about the treatments or the symptoms related to the disease and in case of small problems the user has to go personally for a check-up and which is more time-consuming.
In [16], investigated the case of severe retinopathy of prematurity leading to newborn limitations or blindness, and the need for accuracy and interpretation in deep learning for medical care of these cases, in that study, was used as study material data of premature infants between the years 2011-2014, with the registration of 5000 patients showing 102 variables, where it was necessary to group the records by variants, thus the sample size of 385 patients was determined, and a simple model was built to predict patients with severe retinopathy, the objective of the research is to provide physicians with an interpretable machine learning model. The research that was done allowed us to know that the construction of a deep learning model requires a considerable amount of data and that this model can be an ally to our physicians and that it is easy to understand [17].
The research article [18] on the classification of X-ray chest images using a Convolutional Neural Network aimed to classify chest images previously captured by the cameras of a system, so the convolutional neural network was built, since it has a high performance, being used in problems of classification of images, signals or medical images. For the classification of these images are used large networks previously trained, this network with a real-time application allows the classification to occur in less time. During the training of the network to identify anomalies of the images it is required to classify the data in subsets and increase the data. Likewise, for the present research, the convolutional neural network and the classification of X-ray images will be used.
The research article [19], proposed a method for the classification of pathologies in chest X-ray images based on deep learning or deep learning, for this purpose it makes use of a large number of X-ray images, and from the images, a classification was made between the pathology of pulmonary nodules and cardiomegaly, from that it was concluded that the results obtained showed an improvement for the detection of nodules and cardiomegaly compared to existing methods. In comparison to the present investigation, the use of a deep learning model was made for the classification of X-ray images for pneumonia disease.
In [20] proposed a method for diagnosis based on an imaging study of patients with pneumonia by means of deep learning techniques, in order to achieve a distinction between patients with pneumonia and healthy patients, as well as to differentiate viral between and bacterial pneumonia. The model achieved acceptable results, but with certain limitations in the classification of viral and bacterial pneumonia.
The article [21] proposed a new architecture based on ResNet 50 with some adjustments, for the analysis of medical images of the chest to highlight examples infected with pneumonia. The aim of the research was to highlight the use of machine learning to create a model with accuracy that correctly answers the questions posed to it in the shortest time. The image classification obtained an accuracy of 97.56%. Likewise, in the present research, use was made of the deep neural network trained CVPR 2015 or ResNet152, from this network the weights and parameters necessary for the training of the convolutional network are obtained.

III. CONCEPTS RELATED TO CONVOLUTIONAL NEURAL NETWORK FOR PNEUMONIA PIAGNOSIS
A. Convolutional Neural Network 1) Machine learning: Machine learning is a type of artificial intelligence technique where computers learn to do something without being programmed to do it. The program learns and associates combinations of distinctive features, resulting in a learning process also known as "building a model".
3) Artificial neural networks: Artificial neural networks are an imitation of the behavior of our neurons in the brain. Our brain has a huge number of neurons connected to each other, forming a neural network, these neurons have three main parts: the dendrites, the body, and the axon. Where the dendrites are in charge of transporting the electronic pulses to the body of the neuron, the body recognizes and works on the signals that arrive and the axon is a single nerve fiber in charge of communicating the body of a neuron with the others. The synapse originates with the contact between the oxon and the dendrite of another neuron [22].

4) Neural network model:
A neural network is the joint use of many single neurons, this neural network is made up of hundreds or even thousands of neurons, this is where the concept of layer appears, which is the grouping of all neurons in several sets within the neural network ( Fig. 1), where each layer has its own weight matrices, its bias vectors and their respective outputs [22]. Furthermore, the inputs of the subsequent layers are the outputs of the lower layers. 5) Red convolutional: He mentions that a convolutional network is a kind of multilayer network that consists of different alternating convolutional and subsampling layers, finally, it has a sequence of layers that are completely connected like a multilayer perceptron network. In addition, the input of a convolutional network is usually an image of m x m x r, where m is the height as the width of an image and r is the number of channels and it works with grayscale where r=1. Convolutional layers have k filters or Kernels. www.ijacsa.thesai.org b) Convolutional layer: In this layer, the reduction of the number of possible connections between the neurons of the hidden layer and elements of the input image is carried out, which consists of reducing the computational load of the system. This layer allows extracting useful features from the images to help with their analysis [22]. The convolution is an operation of products and sums between the input image and the Kernel filter, this generates a feature map, where the advantage is that the filter used serves to extract the same feature in any part of the image. c) Pooling or subsampling layer: In this layer, we use the characteristics of the images obtained in the convolution layer to classify them. The objective of this layer is to support the image characteristics obtained and locate the predominant features of the image. This layer has two types of pooling, pooling or overage-pooling, and max-pooling. In the overagepooling the elements of the submatrix are selected and their average is calculated and the result is stored in the first position of a matrix which is the output, on the contrary, in a max-pooling, the element with value is searched and this goes to the first position of the output matrix (Fig. 2). d) Full-Connected Layer: This is the last layer of a convolutional neural network, where we try to classify to determine to which class each input image belongs. In this layer, each neuron is connected with each and every one of the elements of the matrix of the previous layer. e) Pre-Training. The training of a convolutional neural network is important for the transfer of learning, so it is essential to use pre-trained networks with different applications. These pre-trained models are successfully applied, and the use of these pre-trained networks can be to make small adjustments or function as a feature extractor to achieve a better performance of the data to be processed. Pretraining means initializing the networks with previously trained parameters, instead of setting parameters randomly [23].

6) Respiratory diseases:
According to [24], most diseases of the respiratory system fall into one of three categories: obstructive pulmonary diseases, restrictive disorders, and pulmonary diseases.
Within the category of obstructive pulmonary diseases, we have all disorders of the respiratory tract such as asthma, bronchiolitis, etc. Restrictive disorders, also known as parenchymal diseases, include anomalies of the chest wall, as well as neuromuscular diseases. Also [24] states that studies of patients with respiratory diseases begin with a complete anamnesis, this anamnesis should focus on the factors that trigger dyspnea such as cough, which are the cardinal symptoms of respiratory disease.

A. Type of Research
The present research is of the applied type since the knowledge acquired by practice is applied in most cases for the benefit of society [25]. The research design is experimental because one or more study variables are manipulated in order to observe the effect of one variable (independent) on another variable (dependent). This is done in order to discover the cause of a particular situation or event [26]. In addition, the type of research is pure experimental type, this type of research meets the requirements to achieve internal validity and control because it has comparison groups. Within this type of research, pretests and posttests can be used to study the evolution before and after the experimental treatment [27].
The independent variable for the research was "Convolutional Neural Network based mobile application", while the dependent variable was "Diagnosis of Pneumonia".

B. Population and Sample
The target population of this research project is the 80 users and/or medical personnel of the hospitals and clinics that will use the mobile application.
The statistical formula (1) was used to determine the sample size.
The research population considered a population of 80 members of the hospital's medical staff who will use the mobile application, with a confidence level of 95% and a margin of error of 5%. A 50% probability was considered that the event studied would occur and a 50% probability that the event would not occur. The Table I is the detail of the results of the sample: www.ijacsa.thesai.org The sample under study for this research project consisted of 67 members of the hospital's medical staff who will use the mobile application. This was randomly divided between the experimental group (RG1) and the control group (RG2), with 33 members in each group.

C. Indicators
For this research, three indicators were taken into account: "Detection time" (early detection is evaluated); "Outcome" (detection accuracy is evaluated); and "Time to care" (reduction of medical assistance is evaluated).

D. Techniques and Instruments for Data Collection and Analysis
In order to collect data on the variables, it was necessary to collect data by means of detailed procedures using techniques and instruments.

1) Techniques:
For the present research study, the technique of observation and data collection was used. Where observation was used to review the evaluation of the influence of the dependent variable on the independent variable.
2) Instruments: Data collection was carried out through the Quantitative Observation Sheet instrument, and then a statistical analysis of the data collected was performed.
3) Procedure: The next step consisted of analyzing the indicators, frequency tables and formulas, through calculations in SPSS software.

E. Methodology for Development
A comparison of agile methodologies was made in Table II in order to choose the one that best suited the proposed project.
For this research, the agile methodology called Scrum was chosen since it will have a short duration and it allows us to have a broad and interactive control of the processes. Scrum is a reference framework within the Agile software development methodology that allows for the creation of complex software and delivers it in a simpler way compared to the waterfall methodology. Scrum proposes short iterative cycles that last about a week or even a month, this period of work is known as iteration or sprint [28].
The framework allows for increased productivity and creativity during the project, enhances team engagement, and enables collaborative task completion [29], as well as understanding the customer's needs as a team to collaborate and deliver maximum value during each iteration.

A. Solution Development
The research developed was technically feasible, since everything necessary for the development of the mobile application and the training of the convolutional neural network is accessible. Tables III and IV below detail the technical aspects considered for the development of the research.

1) User equipment:
Regarding the requirements of the mobile equipment on the users' side, the following characteristics specified in Table III were recommended. 2) Software platforms: During the development of the project, the list of necessary software was divided in Table IV shows the necessary software to be used for the development of the mobile application.
3) Development: For the development of each Sprint, reviews, and deliverables were planned to validate the progress obtained at the end of the Sprints. The estimated speed of the Sprint was 14 days. a) Sprint N°1: In this phase, the data processing was developed which consisted of Thorax X-Ray images, these were divided into two groups: Training and Test stored in Drive. Likewise, the construction of the neural network and its training were carried out. www.ijacsa.thesai.org  Fig. 3, the project folders were defined and the folders of X-ray images of the thorax with Pneumonia and Normal were read.    Fig. 6 shows the data results of the data augmentation, it can be seen that the generated images change their position within the data augmentation process. The use of the trained DenseNet neural network can be seen in Fig. 7.
The architecture of the new classifier using the pretrained DenseNet model is shown in Fig. 8.
Finally, the training of the convolutional Neural Network is shown in Fig. 9.   b) Sprint N°2: In this phase, the Diagnostic Interface of the mobile application called "Diagnost" visualized in Fig. 10(c) was developed, the model created was saved in a disk, and finally, the Centos server was configured.     c) Sprint N°3: For this phase, the Login interface of the application was developed as shown in Fig. 10(a); the main menu of the application was created as shown in Fig. 10(b); and requests were made from the application as shown in Fig.  10(d). www.ijacsa.thesai.org Fig. 13 shows the comparison of means in post and pre groups of experiments for Indicator N° 1 Detection time:      Table V indicates that the significance of the Control group is 0.001 and the significance of the Experiment group is 0.001, in both values are less than 0.05, then it is stated that the data have a normal distribution.

A. Descriptive Analysis Experiment Group
b) Indicator N°2: The following results were obtained for this indicator: For the hypothesis test, the nonparametric Wilcoxon test was performed, where a significance level of 0.01 was obtained, which is less than 0.05, the limit value to see if the research is accepted.
In this case, by obtaining a p-value greater than 0.01, the alternative hypothesis (H1) is accepted and the null hypothesis (H0) is rejected. For the hypothesis test, the nonparametric Wilcoxon test was performed, where a significance level of 0.340 was obtained, which is greater than 0.05, the limit value to see if the research is accepted.
In this case, by obtaining a p-value greater than 0.05, the null hypothesis (H0) is accepted and the alternative hypothesis (H1) is rejected. c) Indicator N°3: H0, the mobile application based on the Convolutional Neural Network does not allow the reduction of medical assistance when diagnosing Pneumonia in 2021. H1, the mobile application based on the Convolutional Neural Network allows the reduction of medical assistance when diagnosing Pneumonia in 2021.
For the hypothesis test, the nonparametric Wilcoxon test was performed, where a significance level of 0.01 was obtained, which is less than 0.05, the limit value to see if the research is accepted.
In this case, by obtaining a p-value of 0.01, the alternative hypothesis (H1) is accepted and the null hypothesis (H0) is rejected.

VII. DISCUSSION
From the results obtained in the present research work, it is observed in the descriptive analysis in the Detection Time indicator, Fig. 16 shows a deviation of 2.24 in the Control group and in the Experiment group (Fig. 17), a deviation of 1.78 is observed. Likewise, as observed in the hypothesis test, it has a significance level equal to 0.01, which is less than 0.05; determining that a mobile application based on the convolutional neural network allows the early detection of pneumonia in the year 2021. According to the research [30] for the diagnosis and treatment of pneumonia in pigs, it is verified that its expert system supports in some way reducing the time in which a pig is treated and that it is treated efficiently, in order to avoid aggravation and death, with the help of the knowledge provided by the specialist and thus develop an expert system that helps in making decisions to treat the disease in time.  Likewise, in the descriptive analysis in the Result indicator, in Fig. 18, a deviation of 4.10 is observed in the Control group, and in the Experiment group (Fig. 19), a deviation of 14.93 is observed. Likewise, as observed in the hypothesis test, s has a significance level equal to 0.340, which is greater than 0.05; determining that a mobile application based on the convolutional neural network does not allow the accurate detection of Pneumonia in the year 2021.  In addition, the descriptive analysis in the Attention Time indicator, in Fig. 20, shows a deviation of 12.38 in the Control group, and in the Experiment group (Fig. 21), a deviation of 9.16 is observed. Likewise, as observed in the hypothesis test s has a significance level equal to 0.01, which is less than 0.05; determining that a mobile application based on the convolutional neural network allows the reduction of medical assistance when making the diagnosis of Pneumonia, in the year 2021.

VIII. CONCLUSION
Convolutional network-based X-ray image classification has been widely used for different applications and predictions. In the present research work, we proposed the training of a Convolutional Neural Network for the Diagnosis of Pneumonia through the analysis of chest X-ray images implemented in a mobile application, in order to provide a technological tool to medical personnel, contributing to the early diagnosis of pneumonia.
From the results obtained, it was concluded that it was possible to prove that a mobile application based on the convolutional neural network allows the early detection of pneumonia and also allows the reduction of medical assistance when making the diagnosis. Although favorable results were achieved, it was also determined that there is still work to be done on the accuracy, since according to the studies for indicator 2, the mobile application based on the convolutional neural network does not allow the accurate detection of pneumonia, so for future research, it is proposed to improve the model to achieve greater accuracy.