Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 62

Technology: Python

PRIORITISING HOSPITAL ADMISSION


ACCORDING TO EMERGENCY USING
MACHINE
LEARNING
INDEX
 Abstract  Hardware and Software Requirements
 Objective  Algorithms
 Future scopes  UML Diagrams
 Problem statement  Results
 Introduction  Conclusion
 Literature review  References
 Existing Method
 Drawbacks
 Proposed method

 Advantages
 Applications
 Implementation
 Modules
OBJECTIVE

The primary goal of this project is to determine the prediction the prioritising hospital admission
according to emergency and to know this we have used classification techniques.

FUTURE SCOPES

Future Scope: In the future, machine learning can be further leveraged to enhance the prioritization of
hospital admission according to emergencies. Advanced algorithms and real-time data integration can
be explored to improve accuracy, optimize resource allocation, and develop intelligent decision
support systems for efficient emergency care management.
PROBLEM STATEMENT

Problem Statement: In emergency healthcare settings, there is a need to efficiently prioritize


hospital admissions based on the severity of the patient's condition. This project aims to develop
a machine learning-based solution to accurately classify and prioritize patients, enabling timely
and appropriate allocation of resources and medical interventions for improved patient outcomes.
ABSTRACT

the use of artificial intelligence and machine learning techniques in emergency medicine has grown rapidly.
This paper reviews and assesses studies in this field, categorizing them into three areas: prediction and detection
of disease, prediction of need for admission, discharge, and mortality, and machine learning-based triage
systems. In the first category, several studies have been conducted using machine learning algorithms. These
studies used various machine learning techniques, including Logistic Regression, Naive Bias, Random Forest,
MLP, SVC, LSTM, and datasets from electronic health records and medical imaging. The second category
focuses on predicting the need for hospital admission, discharge, and mortality using machine learning
algorithms. These studies have used various datasets, including electronic health records, laboratory data, and
vital signs. The algorithms used in these studies include decision trees, random forests, and logistic regression
models. Finally, the third category explores the development of machine learning-based triage systems for
emergency departments. These studies have used various datasets, including vital signs and medical history, and
machine
learning techniques such as decision trees, artificial neural networks, and fuzzy logic. Overall, the studies
reviewed in this paper demonstrate the potential of artificial intelligence and machine learning techniques in
emergency medicine. However, the accuracy and effectiveness of these algorithms depend on the quality and
quantity of the data used. Further research is needed to validate the findings and improve the performance of
these algorithms in bed settings
Keywords: Logistic Regression, Naive Bias, Random Forest, MLP, SVC, LSTM,
INTRODUCTION
Prioritizing hospital admission according to emergency using machine learning is a promising
application of artificial intelligence in healthcare. Machine learning algorithms can analyze large
amounts of data and identify patterns that can help predict which patients are at higher risk and need
immediate attention. There are various factors that can be considered when prioritizing hospital
admission for emergency cases. Some of these factors include the patient's age, medical history,
symptoms, vital signs, and the severity of their condition. Machine learning algorithms can be trained
on historical data to learn which factors are most important in predicting patient outcomes and can be
used to create a predictive model that assigns a risk score to each patient. The predictive model can be
used to prioritize hospital admission by flagging patients with higher risk scores for immediate attention
by medical professionals. This can help ensure that patients receive timely and appropriate care, leading
to better outcomes and potentially saving lives. It is important to note that machine learning algorithms
are not a substitute for medical professionals' expertise and judgment. The model should be used as an
aid in decision-making and not as the sole basis for admitting patients to the hospital.
Additionally, ethical considerations should be taken into account when using predictive models in
healthcare, such as ensuring fairness and avoiding bias in algorithmic decision-making. Overall,
machine learning has the potential to improve emergency care by enabling more efficient and accurate
triage of patients in need of immediate attention
S. Journal Type with year Authors Title Outcomes
No

1 IEEE, 2017 H. Xu, W. Wu, S. Patient flow This paper introduced a


Nemati prediction via smart work injury
discriminative system. To explain the
learning of wounded case path in a
mutually- high-dimensional
correcting environment
processes
2 IEEE, 2016 P. R. E. Jarvis Improving In this paper Crowding
emergency brought on by poor
department patient patient flow severely
flow,” Clin. Exp limits the ED's ability to
Emergency Med provide high-quality
emergency and urgent
care. Patient flow in the
ED is primarily
impacted by long wait
times for patients
S. Journal Type with year Authors Title Outcomes
No

3 IEEE, 2017 A. Staib, C. Sullivan Uniting emergency This study aims to illustrate
and inpatient through application how a
clinicians across the system dynamics (SD) patient
ed–inpatientinterface flow model of an emergency
department (ED) can identify
which levers efficiently
minimise backlogs to enhance
access to care

4 IEEE, 2012 O. Karan, C. Diagnosing diabetes This study Pervasive computing


Bayraktar, H. using neural networks is frequently discussed in
Gümü¸skaya on small mobile relation to enhancing healthcare.
devices In this paper, a novel method for
detecting diabetes using
pervasive healthcare computing
and neural networks is presented.
EXISTING METHOD

In the existing system, implementation of machine learning algorithms is bit complex to build
due to the lack of information about the data visualization. Mathematical calculations are used
in existing system for Logistic Regression, Random Forest, SVC model building this may
takes the lot of time and complexity. To overcome all this, we use machine learning packages
available in the scikit-learn library.

DISADVANTAGES

 Accuracy low

 Requires more time

 Difficult to handle
PROPOSED METHOD
Proposed several machine learning models to classify the hospital admission according to
emergency, but none have adequately addressed this misdiagnosis problem. Also, similar studies
that have proposed models for evaluation of such Hospital Emergency case and the size of the
data Therefore, we propose Naive Bias, MLP, and LSTM performing classifier tests based.

Advantages:

 Requires less time

 Good Accuracy

 Easy to handle
BLOCK DIAGRAM
ARCHITECTURE
IMPLEMENTATION

 First we have taken the EDAdmissionDataset CSV file.


 Load the dataset into work environment and made a check for null values if any.
 After checking the null values split the data in to train data and test data.
 After splitting apply the algorithm and fit the train data and test data.
 We got the best accuracy score of MLP.
 Later, the entire work is done with Django framework
 User can view the Home, About, View page, Model training, Prediction.
 After detection, we will get to know the MLP Using Machine Learning Model detection
whether the result are its enmergency case are not
HARDWARE & SOFTWARE REQUIREMENTS

H/W Configuration:
• Processor - I3/Intel Processor
• Hard Disk -160GB
• RAM - 8Gb

S/W Configuration:
• Operating System : Windows 7/8/10 .
• IDE : Pycharm.
• Libraries Used : Numpy, Pandas, OS,django, MySQL.
• Technology : Python 3.6+.
APPLICATIONS

• Efficient Triage and Resource Allocation: Machine learning models can analyze patient
data, including vital signs, symptoms, medical history, and demographic information, to
prioritize patients based on the severity and urgency of their condition.

• Reduced Waiting Times and Improved Patient Flow: By accurately triaging and
prioritizing patients, machine learning algorithms can help reduce waiting times in
emergency departments. This improves the overall patient flow, prevents overcrowding,
and allows medical staff to focus on critical cases first, leading to more efficient and
timely care delivery.
MODULES
MODULES:

1. User:

1. Register:

Users can register for the Hospital web application here.


2. Login:

After registering, the user can access his portal.


1.3 Upload:
Upload dataset which is downloaded from the kaggle
3. View Data:
View data before preprocessing
4. Preprocessing Data:
User Can View After Preprocessing Data
1. Input :
User will give the input values.

2. Result History:
After giving the inputs, model will predict the result which it was set according to performance, it will predict that the
Hospital Emergency is it’s a emergency case are its not emergency case.

Take Dataset:

The dataset for the EDAdmissionDataset is collected from the kaggle website (kaggle.com).

The size of overall dataset is 9.08 MB.

Pre-processing:

 In preprocessing first of all we will check whether there is any Nan values.

 If any Nan values is present we will fill the Nan values with different fillna techniques like bfill, ffill, mode, and mean.
Here we used the ffill (front fill) technique on our project.
Training the data:

Irrespective of the algorithm we select the training is the same for every algorithm.
Given a dataset we split the data into two parts training and testing, the reason behind doing this is to
test our model/algorithm performance just like the exams for a student the testing is also exam for the
model.
We can split data into anything we want but it is just good practice to split the data such that the
training has more data than the testing data, we generally split the data.
And for training and testing there are two variables X and Y in each of them, the X is the features that
we use to predict the Y target and same for the testing also.
Then we call the .fit ( ) method on any given algorithm which takes two parameters i.e., X and Y for
calculating the math and after that when we call the .predict ( ) giving our testing X as parameter and
checking it with the accuracy score giving the testing Y and predicted X as the two parameters will get
our accuracy score and same steps , these are just checking for how good our model performed on a
given dataset.
Algorithms
1. SUPPORT VECTOR CLASSIFIER(SVC):
The objective of the support vector machine algorithm is to find a hyper plane in an N-
dimensional space (N — the number of features) that distinctly classifies the data points
To separate the two classes of data points, there are many possible Hyper planes that could be
chosen. Our objective is to find a plane that has the maximum margin, i.e. the maximum distance
between data points of both classes. Maximizing the margin distance provides some
reinforcement so that future data points can be classified with more confidence.
Hyper planes are decision boundaries that help classify the data points. Data points falling on
either side of the hyper plane can be attributed to different classes. Also, the dimension of the
hyper plane depends upon the number of features. If the number of input features is 2, then the
hyper plane is just a line. If the number of input features is 3, then the hyper plane becomes a
two-dimensional plane. It becomes difficult to imagine when the number of features exceeds
2.Random Forest :

A random forest is a machine learning technique that’s used to solve regression and classification problems. It
utilizes ensemble learning, which is a technique that combines many classifiers to provide solutions to complex
problems.
A random forest algorithm consists of many decision trees. The ‘forest’ generated by the random forest algorithm
is trained through bagging or bootstrap aggregating. Bagging is an ensemble meta-algorithm that improves the
accuracy of machine learning algorithms.
The (random forest) algorithm establishes the outcome based on the predictions of the decision trees. It predicts
by taking the average or mean of the output from various trees. Increasing the number of trees increases the
precision of the outcome.
A random forest eradicates the limitations of a decision tree algorithm. It reduces the over fitting of datasets and
increases precision. It generates predictions without requiring many configurations in packages (like Scikit-learn
).
3.LOGISTIC REGRESSION

Logistic Regression was used in the biological sciences in early twentieth century. It was then used
in many social science applications. Logistic Regression is used when the dependent variable
(target) is categorical.

For example,

To predict whether an email is spam (1) or (0)

Whether the tumor is malignant (1) or not (0)

Consider a scenario where we need to classify whether an email is spam or not. If we use linear
regression for this problem, there is a need for setting up a threshold based on which classification
can be done. Say if the actual class is malignant, predicted continuous value 0.4 and the threshold
value is 0.5, the data point will be classified as not malignant which can lead to serious consequence
in real time.
4. NAIVE BAYES:

A Naive Bayes classifier is a probabilistic machine learning model that’s used for classification task. The crux of the
classifier is based on the Bayes theorem.

Using Bayes theorem, we can find the probability of A happening, given that B has occurred. Here, B is the evidence and A
is the hypothesis. The assumption made here is that the predictors/features are independent. That is presence of one
particular feature does not affect the other. Hence it is called naive.
Let’s understand it using an example. Below I have a training data set of weather and corresponding target variable ‘Play’
(suggesting possibilities of playing). Now, we need to classify whether players will play or not based on weather condition.
Let’s follow the below steps to perform it.
Convert the data set into a frequency table
5. MULTILAYER PERCEPTRON:

In the world of deep learning, TensorFlow, Keras, Microsoft Cognitive Toolkit (CNTK), and PyTorch are
very popular. Most of us may not realise that the very popular machine learning library Scikit-learn is also
capable of a basic deep learning modelling
• Salient points of Multilayer Perceptron (MLP) in Scikit-learn
• There is no activation function in the output layer.
• For regression scenarios, the square error is the loss function, and cross-entropy is the loss function
for the classification
• It can work with single as well as multiple target values regression.
• Unlike other popular packages, likes Keras the implementation of MLP in Scikit doesn’t support
GPU.
We cannot fine-tune the parameters like different activation functions, weight initializers etc. for each
layer.
A multilayer perceptron (MLP) is a class of feedforward artificial neural network (ANN). The term MLP
is used ambiguously, sometimes loosely to mean any feedforward ANN, sometimes strictly to refer to
networks composed of multiple layers of perceptrons (with threshold activation); see § Terminology.
Multilayer perceptrons are sometimes colloquially referred to as "vanilla" neural networks, especially
when they have a single hidden layer.
6. LSTM:

 Why Recurrent Neural Networks?

 Recurrent neural networks were created because there were a few issues in the feed-forward neural network:

 Cannot handle sequential data

 Considers only the current input

 Cannot memorize previous inputs

 The solution to these issues is the Recurrent Neural Network (RNN). An RNN can handle sequential data, accepting the
current input data, and previously received inputs. RNNs can memorize previous inputs due to their internal memory.

 It is a variety of recurrent neural networks (RNNs) that are capable of learning long-term dependencies, especially in
sequence prediction problems. LSTM has feedback connections, i.e., it is capable of processing the entire sequence of
data, apart from single data points such as images.
UML Diagrams
 Uml stands for unified modeling language. Uml is a standardized general-purpose modeling language in the
field of object-oriented software engineering. The standard is managed, and was created by, the object
management group.

 The goal is for uml to become a common language for creating models of object oriented computer software. In
its current form uml is comprised of two major components: a meta-model and a notation. In the future, some
form of method or process may also be added to; or associated with, uml.

 The unified modeling language is a standard language for specifying, visualization, constructing and
documenting the artifacts of software system, as well as for business modeling and other non-software systems.

 The uml represents a collection of best engineering practices that have proven successful in the modeling of
large and complex systems.

 The uml is a very important part of developing objects oriented software and the software development
process. The uml uses mostly graphical notations to express the design of software projects.
Use case diagram:
A use case diagram in the unified modeling language (uml) is a type of behavioral diagram defined
by and created from a use-case analysis. Its purpose is to present a graphical overview of the
functionality provided by a system in terms of actors, their goals (represented as use cases), and
any dependencies between those use cases. The main purpose of a use case diagram is to show
what system functions are performed for which actor. Roles of the actors in the system can be
depicted.
Class diagram:
In software engineering, a class diagram in the unified modeling language (uml)
is a type of static structure diagram that describes the structure of a system by
showing the system's classes, their attributes, operations (or methods), and the
relationships among the classes. It explains which class contains information.
Sequence diagram:
A sequence diagram in unified modeling language (uml) is a kind of interaction
diagram that shows how processes operate with one another and in what order. It
is a construct of a message sequence chart. Sequence diagrams are sometimes
called event diagrams, event scenarios, and timing diagrams.
Collaboration diagram:
In collaboration diagram the method call sequence is indicated by some numbering technique
as shown below. The number indicates how the methods are called one after another. We have
taken the same order management system to describe the collaboration diagram. The method
calls are similar to that of a sequence diagram. But the difference is that the sequence diagram
does not describe the object organization whereas the collaboration diagram shows the object
organization.
Deployment diagram:
Deployment diagram represents the deployment view of a system. It is related to the
component diagram. Because the components are deployed using the deployment diagrams.
A deployment diagram consists of nodes. Nodes are nothing but physical hard ware’s used to
deploy the application.
Component diagram:
Component diagrams are used to describe the physical artifacts of a system. This
artifact includes files, executable, libraries etc. So the purpose of this diagram is
different, component diagrams are used during the implementation phase of an
application. But it is prepared well in advance to visualize the implementation details.
Initially the system is designed using different uml diagrams and then when the
artifacts are ready component diagrams are used to get an idea of the implementation.
Activity diagram:
Activity diagrams are graphical representations of workflows of stepwise activities
and actions with support for choice, iteration and concurrency. In the unified
modeling language, activity diagrams can be used to describe the business and
operational step-by-step workflows of components in a system. An activity
diagram shows the overall flow of control.
ER Diagram:
An Entity–relationship model (ER model) describes the structure of a database with the
help of a diagram, which is known as Entity Relationship Diagram (ER Diagram). An
ER model is a design or blueprint of a database that can later be implemented as a
database. The main components of E-R model are: entity set and relationship set.
DFD Diagram:
A Data Flow Diagram (DFD) is a traditional way to visualize the information flows
within a system. A neat and clear DFD can depict a good amount of the system
requirements graphically. It can be manual, automated, or a combination of both. It
shows how information enters and leaves the system, what changes the information and
where information is stored. The purpose of a DFD is to show the scope and
boundaries of a system as a whole. It may be used as a communications tool between a
systems analyst and any person who plays a part in the system that acts as the starting
point for redesigning a system.
Context Level Diagram:
Level 1 Diagram:
Level 2 Diagram:
OUTPUT SCREEN SHOTS WITH DESCRIPTION.
Home Page:

Fig2: Home Page


About:

Fig3:About page.
User Registration page: User can register with required
details.

Fig3:Registration page.
User Login: User can login with valid credentials.

Fig4:Login page.
User Home page: User can view the home page after successful
login.

Fig5:Uaer Hoam page.


Upload data:

Fig6:Upload Data.
View:

Fig7: View.
Preprocessing

Fig7: Preprocessing.
Training:
We’re training the algorithm to see which one has the best accuracy.

Fig8: Training Algorithm


Prediction:
Check bed Availability :
CONCLUSION

The paper "Prioritizing Hospital Admission According to Emergency Using Machine Learning," in its conclusion,
reveals the capability of machine learning algorithms in prioritizing hospital admissions based on emergency
severity. According to the study, the constructed model successfully prioritized patients and correctly anticipated
hospital admission, which improved patient outcomes and decreased hospital overcrowding. In order to enhance
patient care and optimize resource allocation in emergency settings, the study emphasizes the significance of
employing machine learning techniques in healthcare. Expanding the use of machine learning in emergency case
are not in general will require more study and confirmation of the results.
REFERENCES

[1] O. Karan, C. Bayraktar, H. Gümü¸skaya, and B. Karlık, “Diagnosing diabetes using neural
networks on small mobile devices,” Expert Syst.Appl., vol. 39, no. 1, pp. 54–60, 2012.

[2] F. Ma, R. Chitta, J. Zhou, Q. You, T. Sun, and J. Gao, “Dipole: Diagnosisprediction in healthcare
via attention-based bidirectional recurrent neuralnetworks,” in Proc. 23rd ACM SIGKDD Int. Conf.
Knowl. Discovery Data Mining, 2017, pp. 1903–1911.

[3] Z. Liang, G. Zhang, J. X. Huang, and Q. V. Hu, “Deep learning for healthcare decision making
with emrs,” in Proc. IEEE Int. Conf. Bioinformatics Biomed., 2014, pp. 556–559.

[4] C. M. Bishop, Pattern Recognition and Machine Learning. Berlin,Germany: Springer, 2006.

[5] Y. Bengio, J. Louradour, R. Collobert, and J. Weston, “Curriculum learning,” in Proc. 26th Annu.
Int. Conf. Mach. Learn, 2009, pp. 41–48.
[6] V. A. Convertino et al., “Use of advanced machine-learning techniques fornoninvasive monitoring of
hemorrhage,” J. Trauma Acute Care Surgery,vol. 71, no. 1, pp. S25–S32, 2011.

[7] P. Gueth et al., “Machine learning-based patient specific prompt-gammadose monitoring in proton
therapy,” Phys. Med. Biol., vol. 58, no. 13, p.4563, 2013.

[8] J. Labarère, P. Schuetz, B. Renaud, Y.-E. Claessens, W. Albrich, and B.Mueller, “Validation of a clinical
prediction model for early admission tothe intensive care unit of patients with pneumonia,” Academic
EmergencyMed., vol. 19, no. 9, pp. 993–1003, 2012.

[9] O. Hasan et al., “Hospital readmission in general medicine patients: Aprediction model,” J. General
Internal Med., vol. 25, no. 3, pp. 211–219,2010.

[10] A. K. Diehl, M. D. Morris, and S. A. Mannis, “Use of calendar andweather data to predict walk-in
attendance.” Southern Med. J., vol. 74,no. 6, pp. 709–712, 1981.

You might also like