syaha commited on
Commit
2d8e8ae
1 Parent(s): 94e41b5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -104
README.md CHANGED
@@ -9,107 +9,4 @@ app_file: app.py
9
  pinned: false
10
  license: mit
11
  python_version: 3.12
12
- ---
13
-
14
- ---
15
- tags:
16
- - skin-cancer-detection
17
- - medical
18
- - image-classification
19
- - tensorflow
20
- - keras
21
- license: mit
22
- datasets:
23
- - HAM10000
24
- metrics:
25
- - accuracy
26
- model-index:
27
- - name: Skin Cancer Detection Model
28
- results:
29
- - task:
30
- type: image-classification
31
- name: Image Classification
32
- dataset:
33
- name: HAM10000
34
- type: HAM10000
35
- metrics:
36
- - name: Accuracy
37
- type: accuracy
38
- value: 0.73
39
- ---
40
-
41
- # Skin Cancer Detection Model
42
-
43
- This model is built to detect different types of skin cancer from dermatoscopic images. It was trained using the **HAM10000** dataset and is designed to classify seven types of skin lesions. The goal of this model is to assist in the early detection of skin cancer, particularly in regions where temperatures are rising, making skin cancer detection increasingly important.
44
-
45
- ## Model Overview
46
- The model is a Convolutional Neural Network (CNN) developed using **TensorFlow** and **Keras**. It takes input images of skin lesions and predicts one of the seven skin cancer classes. The model achieved an accuracy of **85%**, which can be further improved with fine-tuning and larger datasets.
47
-
48
- ## Classes Detected
49
- The model predicts the following seven types of skin cancer:
50
-
51
- 1. **akiec**: Actinic Keratoses and Intraepithelial Carcinoma (pre-cancerous)
52
- 2. **bcc**: Basal Cell Carcinoma (a common type of skin cancer)
53
- 3. **bkl**: Benign Keratosis (non-cancerous lesion)
54
- 4. **df**: Dermatofibroma (benign skin lesion)
55
- 5. **nv**: Melanocytic Nevus (a common mole)
56
- 6. **vasc**: Vascular Lesions (non-cancerous lesions of blood vessels)
57
- 7. **mel**: Melanoma (most dangerous type of skin cancer)
58
-
59
- ### Explanation of Each Class:
60
- - **Actinic Keratoses (akiec)**: A rough, scaly patch on the skin that develops from years of sun exposure. It is considered pre-cancerous and can lead to squamous cell carcinoma.
61
- - **Basal Cell Carcinoma (bcc)**: A type of skin cancer that starts in the basal cells and is often caused by UV radiation. It rarely spreads to other parts of the body.
62
- - **Benign Keratosis (bkl)**: Non-cancerous skin growths that resemble moles but do not pose any risk.
63
- - **Dermatofibroma (df)**: A common, benign fibrous skin lesion, usually found on the legs.
64
- - **Melanocytic Nevus (nv)**: Also known as a mole, these are benign proliferations of melanocytes but can sometimes develop into melanoma.
65
- - **Vascular Lesions (vasc)**: Benign growths formed by abnormal blood vessels, generally harmless.
66
- - **Melanoma (mel)**: The most serious type of skin cancer, arising from melanocytes. Early detection is critical for effective treatment.
67
-
68
- ## Dataset
69
- The **HAM10000** dataset, which contains 10,015 dermatoscopic images of different skin lesions, was used to train this model. The dataset is publicly available and widely used for research on skin lesion classification.
70
-
71
- ## Model Architecture
72
- The model is based on a Convolutional Neural Network (CNN) architecture with multiple layers of convolution, max-pooling, and fully connected layers to classify images. The input images were resized to **224x224** pixels and normalized to ensure uniformity across the dataset.
73
-
74
- Key architecture components include:
75
- - Convolution layers with ReLU activation
76
- - Max Pooling layers for down-sampling
77
- - Fully connected dense layers
78
- - Softmax activation for the final classification
79
-
80
- ## Training
81
- The model was trained on 80% of the HAM10000 dataset, with 20% used for validation. **Data augmentation** was applied to the training set to improve generalization, including techniques like rotation, flipping, and scaling.
82
-
83
- The training configuration:
84
- - Optimizer: **Adam**
85
- - Loss function: **Categorical Crossentropy**
86
- - Batch size: **32**
87
- - Epochs: **10**
88
-
89
- ## Metrics
90
- - **Accuracy**: The primary evaluation metric was accuracy. The model achieved **73%** accuracy on the validation set.
91
-
92
- Further improvements can be achieved with additional training or fine-tuning using transfer learning methods.
93
-
94
- ## How to Use
95
- You can use this model to classify skin lesion images. Below is an example code snippet to load the model and make predictions:
96
-
97
- ```python
98
- from tensorflow.keras.models import load_model
99
- from tensorflow.keras.preprocessing import image
100
- import numpy as np
101
-
102
- # Load the model from Hugging Face
103
- model = load_model('skin_cancer_model.h5')
104
-
105
- # Preprocess the image and make a prediction
106
- img = image.load_img('test_image.jpg', target_size=(224, 224))
107
- img_array = image.img_to_array(img)
108
- img_array = np.expand_dims(img_array, axis=0) / 255.0
109
-
110
- predictions = model.predict(img_array)
111
- predicted_class = np.argmax(predictions, axis=1)[0]
112
-
113
- # Mapping class index to class name
114
- class_names = ['akiec', 'bcc', 'bkl', 'df', 'nv', 'vasc', 'mel']
115
- print(f"Predicted class: {class_names[predicted_class]}")
 
9
  pinned: false
10
  license: mit
11
  python_version: 3.12
12
+ ---