--- tags: - skin-cancer-detection - medical - image-classification - tensorflow - keras license: mit datasets: - HAM10000 metrics: - accuracy model-index: - name: Skin Cancer Detection Model results: - task: type: image-classification name: Image Classification dataset: name: HAM10000 type: HAM10000 metrics: - name: Accuracy type: accuracy value: 0.85 --- # Skin Cancer Detection Model ## Overview This model was created as part of a final project for an AI bootcamp. It is a **skin cancer detection** model trained to classify skin lesions from dermatoscopic images using the **HAM10000 dataset**. The model is capable of predicting **seven different types of skin lesions**, each corresponding to various forms of skin cancer and other skin conditions. The model has been trained using a **Convolutional Neural Network (CNN)** with **TensorFlow** and **Keras**. The goal of this project is to help in early detection of skin cancer by classifying images into seven distinct categories, which could assist healthcare professionals in diagnosis. ## Model Architecture The model utilizes a CNN architecture fine-tuned for image classification tasks. Below is a brief description of the architecture: - **Input size**: 224x224 RGB images - **Base architecture**: Pretrained CNN (e.g., ResNet, VGG) - **Output layer**: 7 softmax units, each corresponding to one of the skin lesion categories ## Model Performance The model was trained on the HAM10000 dataset and achieved an accuracy of **85%** on the validation set. Further improvements could be made by additional fine-tuning and hyperparameter optimization. ## Datasets The model was trained using the **HAM10000 dataset**, which consists of over 10,000 dermatoscopic images of skin lesions. The dataset includes seven types of lesions, described as follows: | Label | Full Name | Description | |-------|------------|-------------| | **akiec** | Actinic Keratoses and Intraepithelial Carcinoma | A type of skin lesion that can develop into squamous cell carcinoma if left untreated. | | **bcc** | Basal Cell Carcinoma | A common form of skin cancer that rarely metastasizes. | | **bkl** | Benign Keratosis | Non-cancerous skin lesions like seborrheic keratosis. | | **df** | Dermatofibroma | A benign skin lesion usually found on the lower legs. | | **nv** | Melanocytic Nevus | Commonly known as a mole, usually benign but can develop into melanoma. | | **vasc** | Vascular Lesions | Skin lesions that involve blood vessels, like angiomas. | | **mel** | Melanoma | The most dangerous form of skin cancer, often caused by UV radiation exposure. | ### Gradio Demo You can try out the **skin cancer detection model** using the interactive demo hosted on Hugging Face Spaces [here](https://huggingface.co/spaces/syaha/skin-cancer-detection-gradio). ## Usage To use this model for inference, you can load it using TensorFlow: ```python from tensorflow.keras.models import load_model # Load the model model = load_model("path_to_model.h5") # Preprocess input image and make predictions image = preprocess_image("path_to_image.jpg") # Custom image preprocessing function prediction = model.predict(image)