File size: 2,921 Bytes
dd678df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
license: mit
metrics:
- accuracy
pipeline_tag: image-classification
tags:
- medical
---
# **Skin Cancer Detection Model**

This is a **deep learning model** designed to detect skin cancer from images. It is trained on a diverse dataset of skin lesions and uses advanced convolutional neural network (CNN) architectures to classify images as **cancerous** or **non-cancerous**. The model is highly specialized in detecting common skin cancers such as melanoma, basal cell carcinoma, and squamous cell carcinoma.

---

## **Model Details**

- **Model Architecture**: VGG16-based convolutional neural network.
- **Input**: RGB images of skin lesions.
- **Output**: A classification label indicating whether the lesion is cancerous or non-cancerous.
- **Dataset**: The model was trained using a dataset from the **International Skin Imaging Collaboration (ISIC)**. The dataset contains labeled images of different skin lesions categorized into cancerous and non-cancerous groups.

---

## **Model Performance**

- **Accuracy**: Achieved an accuracy of **97.5%** on the test set.
- **Loss**: Final test loss: **0.29**.
- **Confusion Matrix**: ![Confusion Matrix](./confusion_matrix.png)


---

## **Usage**

You can use this model to classify skin lesions by providing an image. Here's an example of how to use the model:

```python
from transformers import pipeline

# Load the model from the Hugging Face Hub
classifier = pipeline("image-classification", model="VRJBro/skin-cancer-detection")

# Example usage
image_path = "path_to_your_image.jpg"
result = classifier(image_path)
print(result)
```

### **Limitations**

- This model is **not a substitute for medical advice**. Always consult a dermatologist or medical professional for accurate diagnosis and treatment.
- The model may not perform well on images with low resolution, extreme lighting, or non-standard viewpoints.

---

## **Training Process**

The model was trained using a multi-phase approach:

1. **Data Augmentation**: The images were augmented with random flips, rotations, and zooms to improve generalization.
2. **Initial Training**: The model was trained with frozen layers of the base VGG16 architecture using a learning rate of **0.001**.
3. **Fine-Tuning**: The model was fine-tuned with partially unfrozen layers to boost performance.
4. **Loss Function**: The training process used `sparse_categorical_crossentropy` to handle the multi-class classification problem.

---

## **License**

The model is released under the **MIT License**. You are free to use, modify, and distribute the model, provided that proper credit is given.

---

## **Citation**

If you use this model in your research or applications, please cite it as follows:

```
@inproceedings{vrjbro_skin_cancer_detection,
  title={Skin Cancer Detection Model},
  author={VRJBro},
  year={2024},
  howpublished={\url{https://huggingface.co/VRJBro/skin-cancer-detection}},
}
```