Major 1 (B-16)
Major 1 (B-16)
P. Devika (O190481)
V. Ganesh (O190888)
K. Abhisimha (O190865)
P.Deepika (O190341)
P.Mounika (O190293)
V.Jyothi (O190757)
(Assistant Professor)
i
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
ONGOLE CAMPUS
CERTIFICATE
This is to certify that report entitled “ Skin Disease Detection Using Convolution and Neural
Networks” being submitted by P. Devika, V. Ganesh, K. Abhisimha, P.Deepika
P. Mounika, V.Jyothi bearing ID numbers O190481, O190888, O190865, O190341, O190293 and
O190757 respectively in partial fulfillment of the requirements for the award of the Bachelor of
Technology in Electronics and Communication Engineering to the Rajiv Gandhi University of
Knowledge Technologies, Ongole is a record of Bonafide work carried by them under my guidance
and supervision.
ii
APPROVAL SHEET
This project report entitled “ Skin Disease Detection Using Convolution and Neural Networks
” by P. Devika, V. Ganesh, K. Abhisimha, P.Deepika, P. Mounika, V.Jyothi bearing ID numbers
O190481, O190888, O190865, O190341, O190293 and O190757 respectively is approved for the
degree of Bachelor of Technology in Electronics and Communication Engineering.
Examiner(s) ____________________________
____________________________
Supervisors ____________________________
____________________________
Chairman ____________________________
Date: ________________________
Place: ________________________
iii
DECLARATION
I declare that this written submission represents my ideas in my own words and where others'
ideas or words have been included, I have adequately cited and referenced the original sources. I also
declare that I have adhered to all principles of academic honesty and integrity and have not
misrepresented or fabricated or falsified any idea/data/fact/source in my submission. I understand that
any violation of the above will be cause for disciplinary action by the Institute and can also evoke
penal action from the sources which have thus not been properly cited or from whom proper
permission has not been taken when needed.
Signature
P. Devika (O190481)
V. Ganesh (O190888)
K. Abhisimha (O190865)
P.Deepika (O190341)
P.Mounika (O190293)
V.Jyothi (O190757)
Date: ____________________________
iv
ACKNOWLEDGEMENT
I express my sincere gratitude to Mrs. N. Padmavathi, Assistant Professor & Head of the
Department of Electronics and Communication Engineering, Rajiv Gandhi University of
Knowledge Technologies, for his suggestions, motivations and co-operation for the, successful
completion of the work. I extend my sincere thanks to Dr. Bhaskar Patel sir, Director,
Rajiv Gandhi University of Knowledge Technologies, Ongole for his encouragement. And also I thank
each individual of the RGUKT, Ongole campus for their impeccable support for my the internship.
P. Devika (O190481)
V. Ganesh (O190888)
K. Abhisimha (O190865)
P.Deepika (O190341)
P.Mounika (O190293)
V.Jyothi (O190757)
v
TABLE OF CONTENTS
PAGE NO:
CERTIFICATE ii
DECLARATION iii
APPROVAL SHEET iv
ACKNOWLEDGEMENT v
ABSTRACT vi
CHAPTER -1 INTRODUCTION
1.1 BACKGROUND AND MOTIVATION 1
1.2 CONTRIBUTION 2
1.3 PROBLEM STATEMENT 2
1.4 DRAWBACK OF EXISTING SYSTEM 3
1.5 PROPOSED SYSTEM 3
1.6 ADVANTAGES 4
vi
6.4 SEQUENCE DIAGRAM 23
7.4 SCREENSHOTS 36
vii
LIST OF FIGURES
S.NO NAME OF THE FIGURE PAGE NO.
viii
CHAPTER 1
INTRODUCTION
The biggest organ of the body is human skin. Its weight lies between six and nine pounds and surface
area is about two square yards. Inner part of body is separated by skin from the outer environment. It
provides protection against fungal infection, bacteria, allergy, viruses and controls temperature of body.
Situations that frustrate, change texture of the skin, or damage the skin can produce symptoms like
swelling, burning, redness and itching. Allergies, irritants, genetic structure, and particular diseases
and immune system related problems can produce dermatitis, hives, and other skin problems. Many of
the skin diseases, such as acne, alopecia, ringworm, eczema also affect your look. Skin can also
produce many types of cancers. Image processing is used to detect these diseases by using various
methods like segmentation, filtering, feature extraction etc.
To get an improved image or to get meaningful information from an image, it is necessary to convert
an image into digital form and then perform functions onto that image. It is a part of signal processing.
The input is an image and it may be a video, a photograph and output is also another image having
same characteristics as input image. Mostly Image Processing models take input samples as 2-D signals
and after that they apply fixed signal processing methods to them. It is widely used technology now
days and it has various applications in the area of business. It is a new research area within engineering
and computer science too. The range of skin diseases is very wide.
Skin diseases have a serious impact on the psychological health of the patient. It can result in the loss
of confidence and can even turn the patient into depression. Skin diseases can thus be fatal. It is a
serious issue and cannot be neglected but should be controlled. So it is necessary to identify the skin
diseases at an early stage and prevent it from spreading. Human skin is unpredictable and almost a
difficult terrain due to its complexity of jaggedness, lesion structures, moles, tone, the presence of
dense hairs and other mitigating confusing features. Early detection of skin diseases can prove to be
cost effective and can be accessible in remote areas. Identifying the infected area of skin and detecting
the type of disease is useful for early awareness. In this paper, a detection system is proposed which
enables the users to detect and recognize skin disease.
1
one individual to the other. The skin diseases can be prevented by investigating the infected region at
an early stage. The characteristic of the skin images are diversified, so that it is challenging job to
devise an efficient and robust algorithm for automatic detection of the skin disease and its severity.
Skin tone and skin color plays an important role in skin disease detection. Color and coarseness of skin
are visually different. Automatic processing of such images for skin analysis requires quantitative
discriminator to differentiate the diseases.
Proposed system is combo model which is used for the prevention and early detection of skin disease,
Melanoma and Nevus. Basically skin disease diagnosis depends on the different characteristics like
color, shape, texture etc. there are no accepted treatment for skin diseases Different physicians will
treat differently for same symptoms. Key factor in skin diseases treatment is early detection further
treatment reliable on the early detection.
In this paper, Proposed system is used for the diagnosis multiple skin disease using statistical parameter
analysis. Statistical analysis is anxious with analysis of random data. Random data is pattern of skin
diseases. Standard database is used this data does not have any mathematical expression; it has some
statistical properties. To analyses random data, we must analyse statistical properties of it.
1.2 CONTRIBUTION
In this paper, we present an image to diagnose multiple skin diseases using statistical parameter
analysis. Statistical analysis is concerned with the analysis of random data. This system is combomodel
which is to be used to diagnose multiple skin diseases at a time. The target skin diseases are Melanoma,
Nevus. The disease diagnosis and classification is built on statistical parameter analysis. Statistical
parameters includes: Entropy, Texture index, Standard deviation, Correlation fact
Depending on standard range of parameters skin disease is going to be diagnosed and classified.
2
readily available, inadequate or nonresponsive to an urgent medical need (such as
dermatologicalrelated). The aforementioned problems suggest that a better and manageable solution is
needed urgently with the view to minimize these dependencies and human bias, thus leading to our
research question.
4
CHAPTER 2
EXISITNG SYSTEM
There are several existing systems for skin disease detection and diagnosis leveraging machine
learning (ML) and artificial intelligence (AI). These systems aim to provide accurate and efficient
diagnostic support to dermatologists and general practitioners, or sometimes even directly to patients.
Below are some examples and categories of such systems:
Examples :
ISIC (International Skin Imaging Collaboration): Provides a benchmark dataset of dermoscopic images
for training ML models to classify skin lesions into benign and malignant categories.
DeepDerm: Uses convolutional neural networks (CNNs) to classify images into multiple skin diseases
with performance comparable to dermatologists.
Dermoscopy Analysis Tools: Applications like DermoScan or SkinVision allow users to upload images
for automated analysis of potential skin cancers.
2. Smartphone Applications :
These are user-friendly mobile apps that use ML to assess skin conditions based on photos taken with
smartphone cameras.
Examples :
SkinVision: Focuses on early melanoma detection by analyzing moles and lesions.
Miiskin: Helps users track changes in their skin over time using ML-assisted image comparisons.
Aysa: Provides AI-powered advice on skin symptoms based on photos and user input.
5
CHAPTER 3
LITERATURE SURVEY
6
for both doctors and patients. Some skin-disease datasets have already been published, such as the
SD198 dataset, which contains 6584 clinical skin-disease images of 198 categories.
However, because of the diversity of clinical dermatology, previous works have showed that the
performance of deep visual features is not as good as or even worse than hand-crafted features for skin
disease classification. In this paper, we propose an SD-198-P dataset, which includes additional
highlevel position information in the SD-198 dataset to guide the generation of better deep visual
features. Our experiment shows that, after adding the position information, the performance of deep
visual features is better than that of hand-crafted features. To the best of our knowledge, our method
outperforms the current state-of-the-art clinical skin disease classification methods.
7
a completely automated system of dermatological disease recognition through lesion images, a
machine intervention in contrast to conventional medical personnel-based detection.
Expert System for Diagnosis of Skin Diseases [81
Skin diseases are frequent diseases to every person and various types of infections are becoming very
frequent. You know that all of these diseases are very harmful, especially if not controlled at an early
stage. Skin diseases not only damage the skin. It can have a large effect on a person 's daily life, destroy
confidence of a person, hang their movement, and turn to depression. Sometimes, many people try to
treat these allergies by using their own therapy. However, if these methods are not appropriate for that
type of skin disease then it would make it more harmful. Skin diseases can easily transfer from human
to human so there is a need to control it their initial stage to prevent it from spreading. This paper
presents an implementation of a skin diseases diagnosis system which helps user to detect human skin
diseases and provides medical treatments timely. For this purpose, user will have to upload a disease
affected skin image to our system and give answers to the questions which are asked to user according
to the symptoms of the skin. These symptoms are used to identify the disease and provide a medical
treatment. This system works on technologies like image processing and data mining for skin diseases
detection. So the whole project is divided in to below major parts, Image preprocessing, segmentation
and feature extraction.
Classification model and skin disease predication.
Medical treatment suggestions or advice.
The image of skin disease is taken and various pre processing techniques are applied onto that
image for noise removal and image enhancement. This image is segmented by using a segmentation
technique i.e. thresholding segmentation. At last, data mining techniques are used to identify the skin
disease and to provide recommendations to users. This expert system pertain disease recognition
accuracy of 85% for Eczema, 95% for Impetigo and 85% for Melanoma. Both image based technique
and questionnaire technique help to increase reliability and performance of the system.
Limitations
This application is implemented only for three skin diseases (Eczema, Impetigo and
Melanoma).
It is implemented only for windows application so that is not yet develop for smart phones like
Android, IOS etc.
During image acquisition, the distance between camera lens and affected skin should be 5cm.
When capture the image for this application, it is mandatory to capture it without any light
effects.
8
It only supports English language not for other ordinary languages like Sinhala,Tamil.
Online Children Skin Diseases Diagnosis System [91
Rule based and forward chaining inference engine methods are used to implement this model which
is used to identify the skin disease. By using this system, user is allowed to identify children skin
diseases via online and provide useful medical suggestions or advice timely. In this system, it consists
of diagnosis module, login module, info module, report module and management module.
There are two main modules called diagnosis and management module. In the diagnose
module questions are asked to the user and on the basis of answers given by the user, Children's
symptoms and condition are identified. This system may be an alternative for parents to identify skin
diseases of children, in response to the questions about the symptoms and the condition children'
skin.
Mobile-based Medical Assistance for Diagnosing Different Types of Skin Diseases Using
Case based Reasoning with Image Processing [111
In artificial intelligence (Al), medical field is a recent area for research purpose. This paper implements
a mobile based medical assistance which is used for diagnosing skin diseases by the use of CBR and
image processing. This model was developed to help users to pre- examine their skin situation whether
they have a disease or not. Also to increase the awareness of skin diseases on what it may do to our
bodies which will lead to death or infecting other people and have a cure before it gets worse. The
proposed system is successfully implemented to detect 6 different skin diseases with an accuracy of
90%. The scale of symptoms, which is used for testing, is 15%, for validation it is 10% and for testing
it is 75%. This supervised system identify diseases at the rate of 90% where the unsupervised system
detect diseases at the rate of
80%. The detection rate of the sample disease with the other related disease is as follows: Eczema —
88%; Psoriasis — 61%; Acne — 75%; Skin Cancer — 51%; Scabies — 43%; and Seborrhea Dermatitis
34%.
An Innovative Skin Detection Approach Using Color based Image Retrieval Technique
[121
The idea of "skin detection & quot; from an image is described as the categorization of the
existence pixels in that image into two skin and Non-skin classes. Many methods uses different color
space to extract features for the categorization of pixels, but most of these methods does not detect
different type of skin with high accuracy. The present method in this paper is implemented by using
quot; Color based image retrieval & quot; (CBIR) technique. In this method, first of all by finding
means of CBIR method and image tiling and finding the relationship between pixel and its neighbors,
9
a set of feature vector is prepared and then at the test stage, training is used for skin detection.
Experimental results show that the proposed model identifies different type of skin with a high
accuracy and it is not sensitive to illumination intensity and with the movement of face. The proposed
method contains two steps such as train and test. First in training step, pure skin images were trained
and then in testing steps skin area were detected from non- skin areas.
10
CHAPTER 4
REQUIREMENT SPECIFICATION
- Reliability
The structure must be reliable and strong in giving the functionalities. The movements must be made
unmistakable by the structure when a customer has revealed a couple of enhancements. The
progressions made by the Programmer must be Project pioneer and in addition the Test designer.
- Maintainability
11
The system watching and upkeep should be fundamental and focus in its approach. There should not
be an excess of occupations running on diverse machines such that it gets hard to screen whether the
employments are running without lapses.
- Scalability
The framework should be sufficiently adaptable to include new functionalities at a later stage.
There should be a run of the mill channel, which can oblige the new functionalities.
12
4.4 Tools and Technology Details
Hardware Requirements
The most common set of requirements defined by any operating system or software application is the
physical computer resources, also known as hardware, a hardware requirements list is often
accompanied by a hardware compatibility list (HCL), especially in case of operating systems. An HCL
list tested, compatible, and sometimes in compatible hardware devices for a particular operating
systems or applications. The CPU is a fundamental system requirement for any software most software
running on different kinds of architecture defines processing power as the model and he clock speed
of the CPU. In this memory requirements are defined after considering demands of applications,
operating system, supporting software and files, and other running process. Hardware requirements
specifications list the necessary hardware for the proper functioning of the project.
System Processor: Pentium IV 2.4 GHz Hard Disk
Rom: 40 GB.
Ram: 512 MB.
Software Requirements
Software requirements deal with software resource requirements and prerequisites that need to
be installed on the computer to provide optimal functioning of an application. These requirements are
prerequisites are generally not included in the software installation package and need to be installed
separately before the software is installed. Software requirements specifications is a description of a
software system to be developed, laying out functional and non-functional requirements, and may
include a set of use cases that describe interactions the users will have the software. Operating System
Windows 7/ 8 / 10
13
CHAPTER 5
SYSTEM ANALYSIS
5.1 SYSTEM DESIGN
The proposed method includes the following 3 processes.
Preprocessing
Feature Extraction and Selection
Classification
The overall flow of the proposed method is represented in Figure. The performance of the
Naive Bayes is analyzed using the feature matrix. Further, the performance of the Hog is studied for
its accuracy, sensitivity and specificity values. The process of diagnosing the eye diseases is illustrated
in the upcoming sections.
5.2 PRE-PROCESSING
Image pre-processing is the initial step to identify the affected area. Multiple steps are performed in
the preprocessing phase to make the image suitable for the feature extraction process. The
abnormalities in the input image are detected and preprocessed for the following purpose:
To avoid uneven illumination.
To enhance the contrast among image background pixels and exudates.
To eliminate the noise in the input image.
14
In this research work, the techniques used for the preprocessing phase are:
Image resizing.
Color transformation(RGB to Gray) and
Histogram equalization.
Image Resizing
An image size can be changed in several ways. One of the simpler ways of increasing image
size is nearest-neighbor interpolation, replacing every pixel with the nearest pixel in the output; for
up scaling this means multiple pixels of the same colour will be present. Image resizing is necessary
when you need to increase or decrease the total number of pixels, whereas remapping can occur when
we are correcting for lens distortion or rotating an image. Zooming refers to increase the quantity
ofpixels, so that when you zoom an image, we will see more detail.
Color Transformation
The retinal images are taken from the fundus camera in the form of RGB (Red, Green, and
Blue). Grayscale is a range of shades of gray without apparent color. The darkest possible shade is
black, which is the total absence of transmitted or reflected light. The lightest possible shade is white,
the total transmission or reflection of light at all visible wavelengths. Intermediate shades of gray are
represented by equal brightness levels of the three primary colors (red, green and blue) for transmitted
light for reflected light. In the case of transmitted light (for example, the image on a computer display),
the brightness levels of the red (R), green (G) and blue (B) components are each represented as a
(RGB) grayscale image, R = G = B. The lightness of the gray is directly proportional to the number
representing the brightness levels of the primary colors.
Histogram Equalization
The use of fundus camera to capture the skin disease image results in an uneven illumination. The
portions near the center are well illuminated and hence it looks very bright. But the porti ons on the
sides are less illuminated and hence looks very dark. To address this issue, the histogram equalization
is used. As the regions of exudate and optic disc are much greater in intensity than the neighboring
regions of the image, the histogram equalization method is used to assign the neighboring regions
greater intensity.
Adaptive Histogram Equalization
Adaptive Histogram Equalization differs from ordinary histogram equalization in the respect that the
adaptive method computes several histograms, each corresponding to a distinct section of the image,
15
and uses them to redistribute the lightness values of the image. It is therefore suitable for improving
the local contrast and enhancing the definitions of edges in each region of an image.
Contrastive Limited Adaptive Equalization
Contrast Limited AHE (CLAHE) differs from adaptive histogram equalization in its contrast limiting.
In the case of CLAHE, the contrast limiting procedure is applied to each neighborhood from which a
transformation function is derived. CLAHE was developed to prevent the over amplification of noise
that adaptive histogram equalization can give rise to.
16
Input Image
Classifica on
17
SVM
An SVM is a classifica on-based method or algorithm. There are some cases where we can use it for
regression. However, there are rare cases of use in unsupervised learning as well. SVM in clustering is
under research for the unsupervised learning aspect. Here, we use unlabelled data for SVM.
Since the topic is under research, we will only look at what it means. In regression, we call the concept
SVR or support vector regression. It is quite similar to SVM with only a few changes. However, it
is more complicated than SVM.
Now, we come to SVM. It is a strong data classifier. The support vector machine uses two or more
labelled classes of data. It separates two different classes of data by a hyperplane. The data points based
on their position according to the hyperplane will be put in separate classes. In addition, an important
thing to note is that SVM in Machine Learning always uses graphs to plot the data. Therefore, we will
be seeing some graphs in the article. Now, let's learn some more stuff.
Parts of SVM in Machine Learning
To understand SVM mathematically, we have to keep in mind a few important terms.
These terms will always come whenever you use the SVM algorithm. So let's start looking at them one
by one.
Support Vectors
Support vectors are special data points in the dataset. They are responsible for the construction of the
hyperplane and are the closest points to the hyperplane. If these points were removed, the position of
the hyperplane would be altered. The hyperplane has decision boundaries around it. And, the support
vectors help in decreasing and increasing the size of the boundaries. They are the main components in
making an SVM. We can see the picture for this.
18
Decision Boundaries
Decision boundaries in SVM are the two lines that we see alongside the hyperplane. The
distance between the two light-toned lines is called the margin. An optimal or best hyperplane form
when the margin size is maximum. The SVM algorithm adjusts the hyperplane and its margins
according to the support vectors.
Hyperplane
The hyperplane is the central line in the diagram above. In this case, the hyperplane is a line because
the dimension is 2-D. If we had a 3-D plane, the hyperplane would have been a 2-D plane itself.
There is a lot of mathematics involved in studying the hyperplane. We will be looking at that. But, to
understand a hyperplane we need to imagine it first. Imagine there is a feature space (a blank piece of
paper). Now, imagine a line cutting through it from the center. That is the hyperplane. The math
equation for the hyperplane is a linear equation.
20
CHAPTER 6
SYSTEM DESIGN
System design is the process of planning a new system to compliment or all together replace
the old system. The purpose of the design phase is the first step in moving from the problem domain
to the solution domain. The design of the system is the critical aspect that affects the quality of the
aspects of the system into physical aspects of the system. It is the process of defining the architecture,
modules, interfaces, and data for a system to satisfy specified requirements. System design could be
seen as the application of system theory product development. There is some overlap with the
disciplines of system analysis, system architecture, and system engineering.
21
In Fig 6.1 there are mainly two stages i.e., Enrollment and Verification respectively. In the enrollment
and verification stage the image can be preprocessed and improves the low contrast image, it also
includes the image enhancement, resizing of the image. After preprocessing the feature of the image
can be extracted, Hog features are extracted from the localized ROI. The feature extraction followed
by feature selection, In this the ROI is located using a rectangular mask and this mask is selected by
feature matrix, then finally the selected image is classified using Naive Bayes classifier and SVM
classifier to detect the disease.
22
6.3 USE CASE DIAGRAM
It represents the functionality of a system by utilizing actors and use cases. It encapsulates the
functional requirement of a system and its association with actors. It portrays the use case view of a
system.
Des
on
23
Fig. 6.4. Sequence Diagram
6.5. Communication Diagram
It shows the interchange of sequence messages between the objects. It focuses on objects and their
relations. It describes the static and dynamic behavior of a system.
Classify
Image
Make
Predic on
5. Make
Recommenda on
24
CHAPTER 7
IMPLEMENTATION & RESULTS
7.1 METHODOLOGY
The image is initially pre-processed and Resize, Histotrophic Equalization (HE) in image acquisition.
The HOG (Histogram of gradients) features are extracted from Collective competitive ratio and
number of statistical properties is derived. The derived properties constitute the HOG features that are
fed to the Naive Bayes classifier and SVM classifier for identifying the diseases. The classifier is
trained and tested with disease image dataset. The methodology of the proposed methodology is shown
in Fig.7. I
Image Acquisition Noise Removal Feature Extraction using HOG Classification
CLASSIFICATION USING
SVM AND NAVIE BAYES
25
Noise Removal
It's necessary to have quality images without any noise to get accurate result. Noisy images may lead
your algorithm towards incorrect result. Hence it becomes necessary to denoise the image. Image de
noising is an important image processing task; there are many ways to de noise an image. The important
for good image de noising model is that it will remove noise while preserving edges. Traditionally,
linear model have been used. To de-noise the image we can use median filter. Median filter does the
work of smoothening of images.
Feature Extraction
To get an accurate result in biomedical image processing it is always necessary that biomedical image
must be a very good quality. However, practically this is not easy. Due to different reasons obtain low
or medium quality images. Hence it becomes necessary to improve their quality. To improve the
quality of an image using image enhancement algorithm. This algorithm enhances the image by
focusing on parameters like contrast, brightness adjustment.
Classification
The overall flow of the proposed method is represented in Figure. The performance of the Naive Bayes
is analyzed using the feature matrix. Further, the performance of the Hog is studied for its accuracy,
sensitivity and specificity values. The process of diagnosing the skin diseases is illustrated in the
upcoming sections.
26
Data Set Image
27
Fig. 7.1.2. Dataset
P(E) is evidence probability, and it is used to normalize the result. It remains same so, removing it
won't affect.
Naive Bayes classifier assumes that all the features are unrelated to each other. Presence or absence
of a feature does not influence the presence or absence of any other feature. We can use Wikipedia
example for explaining the logic i.e., A fruit may be considered to be an apple if it is red, round, and
about 4" in diameter. Even if these features depend on each other or upon the existence of the other
features, a naive Bayes classifier considers all of these properties to independently contribute to the
probability that this fruit is an apple.
P(HIMu1tip1e Evidences) = P(EII P(E21H) * P(H) / P(Multip1e Evidences)
In this research, diabetic retinopathy method is used to diagnose the Diabetic Retinopathy (DR).
Initially, the dataset images are resized and histogram equalization is applied. Then the key features
from the preprocessed images are extracted using the Histogram of Gradient (HoG). Then from HOG
features model is constructed using navis bayes algorithm.
The dataset is used here is binrushed which consists of 4 classes of diseases. Total numbers of images
are 1285. When we tested with testing test for 4 classes it shows 90.02% of accuracy. To get more
number of disease classes we divided the images into 8 classes. Navis Bayes algorithms showed overall
accuracy of 77.23% even though other algorithms for multiclass classification failed to cross 50%. We
also tested various scenarios for login pages, different types of images. Our algorithm proven better
results for most of the cases.
28
7.2 SAMPLE CODE INDEX.HTML
APP.HTML
from flask import render template, jsonify, Flask, redirect, url for, request, make_response
import os
import io import numpy as np
from PIL import Image
import keras.utils as image
from keras.models import model from_json app =
SKIN CLASSES = {
0: 'Actinic Keratoses (Solar Keratoses) or intraepithelial Carcinoma (Bowen's disease)',
l : 'Basal Cell Carcinoma',
2: 'Benign Keratosis',
3: 'Dermatofibroma',
4: 'Melanoma',
5: 'Melanocytic Nevi',
6: 'Vascular skin lesion'
@app.route('/')
def index() :
return render_template('index.html')
@app.route('/signin')
def signin():
return render template('signin.html')
@app.route('/signup')
def signup():
return render template('signup.html')
@app.route('/dashboard', methods=['GET', 'POST'])
def dashboard() :
return render template('dashboard.html') def
findMedicine(pred) :
if pred == 0:
29
return"fluorouracil"
elif pred return
"Aldara" elif pred -2:
return "Prescription Hydrogen Peroxide"
elif pred
return "fluorouracil"
elif pred
return "fluorouracil (5-FU):"
elif pred
return "fluorouracil"
elif pred return "fluorouracil"
@app.route('/detect', methods=['GET', 'POST'])
def detect() :
json_response = { }
if request.method 'POST':
try:
file = request.files['file']
except KeyError:
return make_response(j sonify( {
'error': 'No file part in the request',
'code': 'FILE',
'message': 'file is not valid'
400)
imagePil = Image.open(io.BytesIO(file.read()))
# Save the image to a BytesIO object
imageBytesIO = io.BytesIO()
imagePil.save(imageBytesIO,format='JPEG')
imageBytesIO.seek(0)
print("detected ")
path imageBytesIO
fi_le = open('model.json', 'r')
loaded_json_model = j file.read()
j_file.close()
model = model son_model)
30
model.load_weights('model.h5')
img image.load_img(path,
target_size=(224, 224))
img = np.array(img) img=img.reshape((l,224,224,3))
img = img/255
prediction=model.predict(img)
pred=np.argmax(prediction)
disease=SKIN_CLASSES[pred]
accuracy=prediction[0][pred]
accuracy=round(accuracy*100,2)
medicine=findMedicine(pred)
json response = {
"detected": False if pred == 2 else True,
"disease": disease,
"accuracy". accuracy,
"medicine" : medicine,
"img_path": file.filename,
<title>MedicineAI</title>
<meta name="description" content="Skin Disease detection and treatment management
susceptibility by Al">
31
<meta name="viewport" content="width=device-width, initial-scale=l .0"
SEO Meta Tags -->
<meta name="keywords" content="medicine, Al, disease detection, treatment management">
<meta name="author" content="MedAI">
<meta name="robots" content="index, follow">
<!-- OpenGraph Meta Tags -->
<meta property="og:title" content="MedicineAI">
<meta property="og:description" content="Skin Disease detection and treatment management
susceptibility by Al">
<meta property="og:image" content="/static/images/og-image.jpg">
<meta property="og:url" content="https://medai.onrender.com">
<meta property="og:type" content="website">
<!-- CSS Stylesheets -->
<link rel="stylesheet" href="/static/css/index.css">
<link rel="stylesheet" href="/static/css/styles.css">
<!-- JavaScript -->
<script </head>
<body>
<div class="upper">
<!-- <img src="/static/images/medAi 2.png"> -->
<img src="/static/images/logo.png">
<p>Skin Disease detection and treatment management susceptibility by Al</p>
32
<meta
<link rel="icon" type="image/x-icon" href=" { { url for('static', filename='images/favicon.ico') } }
<meta name="viewport" content="width=device-width, initial-scale=l .0">
<title>sign in</title>
<link rel="stylesheet" href="/static/css/sign.css">
<link rel="stylesheet" href="/static/css/styles.css">
</head>
<body>
<a href="/">
<img src—"/static/images/logo.png" class—
<div class="center">
<hl>Sign in</hl>
<form action="dashboard" method="post">
<label for="E-mail">E-mail</label><br>
<input id="E-mail" type="text" placeholder="Please enter your email"> <br>
<label for="password">password</label><br>
<input id—"password" type—"password" placeholder="Please enter your password"><br>
<div class="btn div"
<button id="btn" onclick="location.href='welcome.html';">login</button>
<div class="singup_link">
<h3> Not a member?
</h3>
<a href="/signup">sing up here</a>
</div>
</div>
</div>
</form>
</body>
</html>
33
SIGNUP.HTML
html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/x-icon" href=" { { url for('static', filename='images/favicon.ico') } }
<meta name="viewport" content="width=device-width, initial-scale=l .0">
<title>sign in</title>
<link rel="stylesheet" href="/static/css/sign.css">
<link rel="stylesheet" href="/static/css/styles.css">
</head>
<body>
<a href="/">
<img src="/static/images/logo.png" class—
<div class="center">
1 >Sign in</hl>
<form action="dashboard" method="post">
<label for="E-mail">E-mail</label><br>
<input id="E-mail" type="text" placeholder="Please enter your email"> <br>
<label for="password">password</label><br>
<input id="password" type="password" placeholder="Please enter your password"><br>
<div class="btn div">
<button id="btn" onclick="location.href='welcome.html';">login</button>
<div class="singup_link">
<h3> Not a member?
</h3>
<a href="/signup">sing up here</a>
</div>
</div>
</div>
</form>
34
</html>
INFO.HTML
html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/x-icon" href=" { { url_for('static', filename='images/favicon.ico')
35
7.3 ACCEPTANCE TESTING
User Acceptance Testing is a critical phase of any project and requires significant participation by the
end user. It also ensures the system meets the functional requirements.
1
Test Case No.
Sample Input
Skin Disease image
7.4 SCREENSHOTS
36
Fig 4.7.2 sign-in page
37
Fig 4.7.4 skin disease type 1
38
Fig 4.7.6 skin disease type 3
39
CHAPTER-8
CONCLUSION AND FUTURE WORK
Detection of skin diseases is avery important step to reduce death rates, disease transmitrions and
development of the skin disease. Clinical procesdures to detect skin diseases are very expensive and
time consuming. Image processing techniques helps to build automated screening system for
dermatology at an initial stage. The extraction of features plays a key role in helping to clacify skin
diseases.
In this reaseach the method of detection was designed by using pre trained SVM abnd navie bayas. In
conclusion, we must not forget that this research has an effective role in the detection skin diseases in
soudhi Arabia because it has very hot weather for the presence oh=f weather: thses indicate =s that
skin diseases are widw spread. The reaserch supports medical efficiency in soudhi Arabia.
Future enhancement
Futuree scopes of improment in present methodologies are
• A common model should be adopted for the identification of all types of skin disesases
• Support for muiltilingualism to develop user-freidlyness.
• To expand the muilti platform capability throuth an introduction to ios compatability.
40
REFERENCES
41