Downloads · 30 days
0
syaha/skin_cancer_detection_model
skin_cancer_detection_model is a image classification model from syaha. Use it when you need a label for an image. It is set up for keras. The card lists the license as mit.
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 a…
Downloads · 30 days
0
Access
Public
Updated Oct 10, 2024
Repo size
134 MB
Likes
2
Public
Click a slice to open those files.
.h5134 MB · 100%
From the Hugging Face model README
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.
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 73%, which can be further improved with fine-tuning and larger datasets.
The model predicts the following seven types of skin cancer:
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.
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.
Key architecture components include:
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.
The training configuration:
Accuracy: The primary evaluation metric was accuracy. The model achieved 73% accuracy on the validation set.
Further improvements can be achieved with additional training or fine-tuning using transfer learning methods.
You can use this model to classify skin lesion images. Below is an example code snippet to load the model and make predictions:
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing import image
import numpy as np
# Load the model from Hugging Face
model = load_model('skin_cancer_model.h5')
# Preprocess the image and make a prediction
img = image.load_img('test_image.jpg', target_size=(224, 224))
img_array = image.img_to_array(img)
img_array = np.expand_dims(img_array, axis=0) / 255.0
predictions = model.predict(img_array)
predicted_class = np.argmax(predictions, axis=1)[0]
# Mapping class index to class name
class_names = ['akiec', 'bcc', 'bkl', 'df', 'nv', 'vasc', 'mel']
print(f"Predicted class: {class_names[predicted_class]}")