Drug Classification
0.0 • 0 Reviews

Drug Classification

     Selecting the most suitable drug for a patient is a critical step in clinical treatment, since the response to a medication depends on several physiological factors such as...

$ 69.00
AvailabilityAvailable Now CategoryPython
CodeFS-48 Specs4 points
Quality Guaranteed Reviewed project files and clear structure.
24/7 Support Reach us anytime for setup and usage help.
Instant Access Download your files right after checkout.
Source Included Code, assets, and project-ready materials included.
Need a custom version?

We can help you adapt this project for your topic, tech stack, or submission requirements.

Talk to us

About This Product

Intelligent Drug Prediction Using a Deep Neural Network with Label Encoding and Feature Scaling and an Integrated Django Web Framework

1. Introduction

     Selecting the most suitable drug for a patient is a critical step in clinical treatment, since the response to a medication depends on several physiological factors such as age, sex, blood pressure, cholesterol level, and the sodium-to-potassium ratio in the blood. Traditionally, this decision relies on manual assessment by physicians, which is time-consuming and may vary between practitioners. These challenges highlight the need for automated, data-driven systems that can recommend an appropriate drug quickly and consistently.Recent progress in machine learning and deep learning has enabled accurate analysis of structured clinical records. Deep Neural Networks (DNNs) are capable of learning complex non-linear relationships between patient attributes and drug categories. However, raw clinical data contains categorical variables and features with different numerical ranges, which can reduce training stability. To address these limitations, categorical attributes such as sex, blood pressure, and cholesterol are converted through label encoding, and all input features are standardized using a StandardScaler. A fully connected DNN with two hidden layers of 64 and 32 neurons, ReLU activation, and dropout regularization is then trained to classify patients into five drug classes using a softmax output layer. Training convergence is monitored through Accuracy vs. Epochs and Loss vs. Epochs performance curves. To bridge the gap between model development and practical use, the trained workflow is integrated into an interactive, user-friendly Django web application. The system provides a simple input form for patient details, applies the same preprocessing used during training, and returns the predicted drug instantly. By loading the saved model, encoders, and scaler once at startup, the application delivers fast and consistent real-time predictions, offering a practical tool for clinical decision support.

2. Problem Statement

Manual selection of a suitable drug for patients is characterized by:

  1. Time-consuming evaluation and heavy dependence on individual judgment
  2. Inconsistent recommendations across different practitioners
  3. Difficulty interpreting mixed categorical and numerical attributes such as blood pressure and cholesterol
  4. Lack of an accessible interface for obtaining instant, data-driven drug recommendations from trained models

There is a critical need for an automated, reliable end-to-end system that preprocesses patient data consistently, accurately classifies the suitable drug using a deep neural network, tracks training progression using convergence curves, and delivers results in real time through an accessible web platform.

3. Input

  1. Patient drug dataset (clinical records with drug labels)
  2. Numerical features: Age and Na_to_K ratio
  3. Categorical features: Sex, Blood Pressure (LOW, NORMAL, HIGH), and Cholesterol (NORMAL, HIGH)
  4. Drug class categories (DrugY, drugA, drugB, drugC, drugX)

Real-time user input: Patient details submitted through the Django web form

4. Output

Model training & validation evaluation artifacts:

  1. Accuracy vs. Epochs curve
  2. Loss vs. Epochs curve
  3. Confusion Matrix
  4. ROC Curve
  5. Performance Metrics (Accuracy, Error Rate, Precision, Recall, F1-Score)

Saved model artifacts and web application output:

  1. Saved model file (.keras / .h5) and preprocessing objects (.pkl)
  2. Real-time classification result: Predicted drug class with the highest softmax probability
  3. Interactive web display: Predicted drug shown instantly on the patient input page after form submission

5. Novelty

  1. Integration of label encoding and StandardScaler preprocessing with a deep neural network to handle mixed categorical and numerical clinical attributes reliably.
  2. Implementation of a compact fully connected DNN (64 and 32 neurons) with dropout regularization to reduce overfitting across five drug classes.
  3. Dynamic model performance monitoring through Accuracy vs. Epochs and Loss vs. Epochs convergence plotting.
  4. Complete end-to-end fusion combining a deep learning training pipeline with a lightweight Django web application that reuses the saved model, encoders, and scaler for real-time prediction.

6. Contribution

Developed a complete machine learning pipeline:

  1. Dataset loading, reading, exploratory analysis, and preprocessing
  2. Label encoding and feature scaling
  3. DNN model training, validation, and convergence tracking (Accuracy vs. Epochs, Loss vs. Epochs)
  4. Performance evaluation metrics (Confusion Matrix, ROC Curve, Accuracy, Error Rate, Precision, Recall, F1-Score)
  5. Model persistence (.keras / .h5 and .pkl)

Built a simple, user-friendly Django web interface incorporating:

  1. Responsive patient input form with required, type-checked fields
  2. Real-time drug prediction using the saved model, encoders, and scaler
  3. Instant display of the predicted drug on the same page, with CSRF-protected form submission for easy use

7. Conclusion

     The proposed system successfully automates drug prediction by combining label encoding and feature scaling with a Deep Neural Network. Training stability and optimization were verified through Accuracy vs. Epochs and Loss vs. Epochs convergence plots. The model achieves reliable classification performance, validated through confusion matrices, ROC curves, and standard performance metrics. Furthermore, seamless integration with a Django-based web application ensures practical, real-world utility, enabling users to enter patient details and instantly obtain the predicted drug through a simple and dependable interface.

8. References

[1] Y. LeCun, Y. Bengio, and G. Hinton, "Deep Learning," Nature, vol. 521, no. 7553, pp. 436–444, 2015.

[2] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, "Dropout: A Simple Way to Prevent Neural Networks from Overfitting," Journal of Machine Learning Research, vol. 15, pp. 1929–1958, 2014.

[3] F. Pedregosa et al., "Scikit-learn: Machine Learning in Python," Journal of Machine Learning Research, vol. 12, pp. 2825–2830, 2011.

[4] M. Abadi et al., "TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems," arXiv preprint arXiv:1603.04467, 2016.

Backend Programming Language

Python

Backend Web Framework

Django

Frontend Structure

HTML

Frontend Styling

CSS

0.0
0 reviews
5
0
4
0
3
0
2
0
1
0

No reviews available for this product.

Add Your Review

View All