Covid-19 emergency services and disease prediction system

A medical emergency can be referred to as a medical or behavioral condition, which occurs suddenly and has severe symptoms, including severe pain, such that if a person delays medical attention it can cause: (1) loss of life;(2) serious impairment to the person’s body; or (3) serious damage. Admitting a patient to a healthcare is a complex process which should be managed efficiently, which otherwise may cause serious consequences and patient dissatisfaction. The registration aspect of a patient admission is tedious and cumbersome, which is not at all suitable during a medical emergency. There is a need of a system through which user could fill the form for getting admitted to the hospital beforehand in order prevent delay in treatment. After the registration, the goal is to create a web application for hospital staff to manage the patients’ data. The web application also analyses the types of patients in particular hospital and represent the data in the form of charts. The implementation of this system is carried out with the help of machine learning algorithms which also analyze Covid data and represent it continent wise, predict future cases in India, and conduct Covid detection by chest scan of a patient.


Introduction
A medical emergency can be referred to as a medical or behavioral condition, which occurs suddenly and has severe symptoms, including severe pain, such that if a person delays medical attention it can cause: (1) loss of life; (2) serious impairment to the person's body; or (3) serious and permanent damage.
[1] Admitting a patient to a healthcare is a complex process which should be managed efficiently, which otherwise may cause serious consequences and patient dissatisfaction. Also, during an emergency, it is difficult to locate nearby hospitals and get the directions to it. This system consists of a mobile application through which the patients can register themselves and fill a particular hospital's admission form beforehand and can also get directions to the selected hospital. There can be a situation where after reaching the hospital, the patient comes to know that there is no availability of beds which will lead to delay in the treatment of the patient. Through this system, this confusion will also be avoided as the number of beds available, and the number of beds occupied for each hospital will be updated to a web application consisting of admin module. So, patient would not get the option to fill the form for a hospital which has no beds available. Covid-19 (Coronavirus) has affected the daily life and is alleviating country economy as much as a decade worth. This pandemic has affected many people, who are getting sick or get killed , many families are being destroyed. Many people have also lost their livelihood and jobs. Covid-19 has alleviated businesses, disrupted the world trade and movement across the globe. [2] Identification of the disease at an early stage can help in controlling the spread of the virus as well as for saving a life. This system uses machine learning algorithms such as K-means clustering, Polynomial regression, Inception -v3 for analyzing Covid-19 data, represent it continent wise, and conduct Covid detection through chest scan.

Motivation
Though there are computerized systems available for booking appointments in hospitals and healthcare and for maintaining records, there is no such existing system available where the patient can view the nearby hospitals and get admitted to any of them by filling the form previously. Through this system, not only can the patient book a bed in advance but can also get the directions to the hospital. Also, during this Covid-19 situation, it is important to manage related data in an efficient manner. Visualization of Covid cases, records in the web application part of the project will help in the efficient management of the data. Also, this application consists of a feature where through images of chest scan of a patient, it can be detected whether the patient has Covid which can help the doctors with the diagnostic and treatment procedures.

Literature Survey
History of Covid-19: The Covid-19 pandemic has caused many Cancellations like clinical conferences , journey restrictions, social distancing, and different unprecedented preventive steps or procedures. 1. What are the Covid causing virus ? Coronaviruses are a huge own circle of relatives of zoonotic viruses. These viruses can motive illnesses like not unusual place bloodless to even extreme breathing illnesses like SARS and MERS. Zoonotic manner those viruses can transmit themselves from animals to human beings. There are numerous coronaviruses recognized to be circulating in one of a kind animal population which have now no longer but inflamed human beings. [3] Covid-19 is the maximum current one to contaminate human beings. Common symptoms and symptoms of Covid-19 contamination are similar to cold and consist of signs such as dry cough, fever, shortness of breath, and respiration problems. In extreme instances, it causes pneumonia infection, extreme acute breathing syndrome, kidney failure, or even death. ➢From where the Coronavirus came into existence? According to the medical experts, SARS-CoV-2 has originated in bat species. That's additionally how the coronaviruses at the back of Middle East breathing syndrome (MERS) and extreme acute breathing syndrome (SARS) were given commenced. SARS-CoV-2 commenced infecting human beings at one of Wuhan's open-air "moist markets." ➢Coronavirus Evolution: Scientists first found a human infecting coronavirus in 1965. It precipitated a not unusual place bloodless. Later that decade, researchers discovered a collection of comparable human and animal viruses. They had been named 'coronaviruses' because of their crown-like appearance. It was found that there are at least seven types of coronaviruses that can infect human beings. The one which reasons SARS emerged in southern China in 2002 and fast unfold to twenty-eight different countries. More than 8,000 humans had been inflamed via way of means of July 2003, and 774 died. A small outbreak in 2004 worried simplest 4 extra instances. This coronavirus reasons fever, headache, and breathing issues including cough and shortness of breath. MERS commenced in Saudi Arabia in 2012. Nearly 2500 instances had been of the individuals who travelled to Middle East. This coronavirus is much less contagious than SARS however extra dangerous, killing 858 humans. It has the equal breathing effects ,however it can also cause kidney problems. [4] Following papers have been referred for the project:

Regression Analysis of Covid-19 using Machine Learning Algorithms :
The trend of Covid cases in India is analysed. The paper makes use of regression analysis as the dataset being analysed is continuous dataset. It aims at predicting the future Covid cases so as to take preventive measures. The analysis was performed using Support Machine vector and Polynomial regression both. SVM and Polynomial regression both are supervised machine learning algorithms. The paper also presents charts to visualize death rate, active cases, and total confirmed cases. The analysis performed raises some questions such as "Why is the mortality rate of India lowest as compared to other countries?". [5]

A Comprehensive Analysis of Covid-19 Outbreak situation in India :
In this study, trends and patterns were presented based on data from different state units of India and Ministry of Health and Family Welfare. The data was till 8th of April 2020. This study tried to answer six questions related to current coronavirus spread in comprehensive manner. The research questions were regarding the change in the country post lockdown, prediction of current cases, mobility changes in various regions of India, community outbreak spread due to conduction of religious and cultural events, prominent clusters formed with respect to Covid-19 outbreak in India, etc. The findings were mostly related to impact of mass events and social distancing on affected areas, short term predictions for infected cases ,network analysis and classification on infected patients. [6]

Deep learning-based detection and analysis of Covid-19 on chest x-ray images :
The paper explains how image screening of Chest scans and CT-scans can help detect Covid patients. An algorithm was developed using three different models which were Inception, Xception and ResNeXt models. These are Deep learning models which are best known for image recognition. The dataset was collected from Kaggle and had total of 6432 images. 5467 images were used for training and 965 for testing. The images were cleaned, resized and augmented for better results. Augmentation includes rotation, zoom size and some other factors. This paper has presented steps in which the detection can be done. First the image is preprocessed, then it is applied to a pretrained model and the output obtained is flattened to (n-1) and then passed through different layers depending on the model used. The accuracy of Xception model was found to be better than other two. [7] 4. Proposed System The proposed system consists of following modules: 1. Mobile Application for patient to search for bed and get admitted in the nearest hospital in case of emergency.
[8] 2. A web application for hospital staff to manage the patients' data generated from the mobile application. The web application also analyses the types of patients in particular hospital and represent the data in the form of charts. [9] 3. A Machine learning algorithm run on the backend of the web app which analyses the Covid data around the world and represents it continent wise. It also retrieves and analyses the current Covid cases in India from Jan 2020 to March 2021. 4. Another Machine Learning Web app is used to predict the cases of India in the future. 5. And lastly a web-based Machine Learning app is used for Covid detection from a patient's Chest scan.
The mobile app is made using android studio and firebase for taking user details and symptoms. The user can send emergency message to contact and make emergency call to helpline number. The web application is made using Vue.js and Vuetify. The user data is passed to the web app through firebase. The web app consists of different graphs representing total available beds and total occupied beds. The graph is displayed continent wise for total cases, recoveries, and deaths from a real time API.
The Covid patients data is clustered using k-means algorithm based on the number of days they require to discharge and age , which is used to determine the average number of days required to get discharged with respect to age. The number of clusters 'k' which is a hyper parameter is defined as 4 and the centroids were chosen accordingly. The data points have been clustered on the basis of squared distance between them.
The confirmed cases in India per day are put under polynomial regression model to determine the confirmed cases for near future days. The data is collected from Kaggle dataset. The data is preprocessed by reshaping and fit into polynomial feature of degree 5. The data is then fit into a linear regressor model and the accuracy of the model is found out to be 99.765%. The model is presented as a flask app which uses Html CSS and JavaScript and the result is rendered on the web app hosted on Heroku.
y= b0+b1x1+ b2x1 2 + b2x1 3 +...... bnx1 n (1) The deep learning algorithm Inception-v3 is used to train a model on ImageNet using Keras module. [10,11] The images were changed from BGR to RGB for better modelling. Normalization was formed so as to avoid overfitting. Then the data was split into training and testing data for Covid and Non-Covid chest scans .Label binarizer was used to convert the results into form of 0's and 1's.Finally the Inception-v3 model is applied on the prepared data, model is compiled using Adam optimizer. Image data generator is used to change the rotations and make all the images even. The model is built and now the model is trained by fitting with a batch size of 32 and epochs of 500.The model is then saved in a .h5 format and then used to make predictions. The mobile app is connected to the Firebase. Firebase provides various services including registering a new account via email and password using Firebase authentication service or login into an existing account using the same. It also provides a real time database for storing retrieval f user data. The main page of app displays a map with current location of user and markers for hospitals nearby along with an emergency button. Emergency button is used to call the nearest helpline number and send SMS to user's personal contacts which can be set by user. Select hospital provides two services, uploading a photo from phone or clicking a picture in app as well as a patient form which is submitted to the selected hospital and uploaded to the firebase database. Firebase Database is further connected to the web app. The web app is connected to the Firebase like the mobile app. Firebase provides login into an existing staff account via email and password using Firebase authentication service. It also provides a real-time database for storing retrieval of user data. The admin or the hospital staff can handle multiple functionalities such as CRUD operations, Analysis and graphs, Covid cases prediction and Covid Detection system. Data generated by user from the mobile app can be or created, retrieved, updated, deleted using the web app. Analysis is done in the same data and represented in the form of graphs and charts. Covid Prediction system is Machine learning system which uses Polynomial regression to predict the Covid cases in the future. Finally Covid detection system is a Machine learning system which analyses the Chest can of patient and detects the existence of Covid-19 virus and generates a report.

Results
We have created an android app which can be used by the patient to get admitted to a nearby hospital by filling an application form. The user can also inform his emergency contacts and make an emergency call using the app in case of emergency. The app also shows the fastest route to the selected hospital using google map api. The number of available beds can be seen for any hospital.
The records of patients can be accessed using the web app by the admin. The web app shows many graphs relating to Covid updates such as everyday cases, deaths, ICU patients using live data from api. Through web app admin can change the status of patient from admitted to discharge or just to admit the patient. The number of available beds can also be updated.
In the web app we can see the clusters of Covid patients (as shown in fig. 10) to determine the average number of days required to discharge in association to age. [12] The web app can also predict number of confirmed cases of India for any day in the near future. The model has an accuracy of 99.65%. The web app can also analyze a chest scan to detect if a person is suffering through Covid-19 using Inceptionv3 and deep learning and the results will be displayed.  The user can register using a valid email id and password. The emergency contacts can also be added. The user needs to fill the form and upload his image or take it using the camera hardware. The user then submits the application form and is redirected to the maps. The graph shows the available and occupied number of beds hospital-wise. Fig10. Clustering graph This graph shows clustering of patient data that depicts the average number of days required to discharge from the hospital with respect to age. X-axis depicts the patients age and Y-axis depicts the number of days required by different patients to fully recover. The bright red dot represents the average number of days to recover. This visualization can help the hospital management to plan accordingly and monitor the patients recovery. It also gives insight if the number of beds should be increased if the recovery time has increased, making the bed availability scarce.  The records of patients of a particular hospital which also shows a pi chart for different disease count and male female pi chart. The records can be added, deleted, and updated. The total cases, recovered, and deaths for different continents can be seen and other graphs such as daily cases, everyday deaths, recovered, ICU patients for India can be seen. Type the number of days and get an estimation of total confirmed cases of India after that many days. The chest scan is to be uploaded by selecting an image from the system so as to make a decision if a patient is suffering from Covid or not. The result or report of the scan is shown to decide if the patient is suffering from Covid or not. The accuracy of model is 96% as shown in Fig16. The Inception-v3 model uses 500 epochs and 32 batch size for getting best accuracy.

Conclusion
Covid-19 pandemic is a growing exponentially daily. With the ever-increasing number of cases, bulk testing of cases swiftly may be required. We have successfully categorized covid-19 scans, and it encourages the possible implementation of such techniques in the near future to automate diagnosis tasks. It is advised to consult medical professionals for any practical use case of this project. We do not intend to develop a perfect detection mechanism but only research about possible economically feasible ways to combat this disease. Such methods may be pursued for further research to prove their real case implementation. [7]

Future Scope
Currently the user has to provide login credentials in order to use the app or if the account does not exist the user has to register and then login. We can create a functionality where user can login using his/her google account. Secondly, we can also display the hospitals based on the emergency. For example, if the patient has a heart attack, then all the heart care hospitals with their location will be suggested.