1) Inspiration: Skin cancer is one of the most common types of cancer worldwide, and early detection plays a critical role in improving survival rates. Despite the advancements in medical technology, skin cancer diagnosis often depends on visual inspection by dermatologists, which can be subjective and time-consuming. The inspiration behind this project is to leverage the power of Convolutional Neural Networks (CNNs) to create a system that can assist in the early detection of skin cancer, making the process more accurate, scalable, and accessible to people in underserved regions.
2) What it does: The project aims to develop a deep learning model using Convolutional Neural Networks (CNN) to automatically detect skin cancer from images of skin lesions. The system classifies images into two categories: malignant (cancerous) or benign (non-cancerous). The model takes an image of a skin lesion as input and outputs the probability of it being malignant, aiding in quicker and more accurate diagnoses.
3) How we built it Data Collection: We used the HAM10000 dataset, a widely available dataset containing labeled images of various types of skin lesions. This dataset includes over 10,000 images labeled with the type of skin condition.
Data Preprocessing: We preprocessed the images by resizing them to a uniform dimension, normalizing pixel values to a 0-1 range, and performing data augmentation (like rotations and flips) to make the model more robust to variations in skin lesion images.
Model Selection: A Convolutional Neural Network (CNN) was chosen for this task due to its effectiveness in image classification. We implemented a CNN architecture with multiple convolutional layers, max-pooling layers, and fully connected layers. We used the Keras library with a TensorFlow backend.
Training: The dataset was split into training, validation, and test sets. We used categorical cross-entropy as the loss function and Adam optimizer to train the model. The model was trained for 30 epochs with early stopping to prevent overfitting.
Evaluation: We evaluated the model's performance using accuracy, precision, recall, and F1-score. The model showed good performance in identifying malignant lesions.
4) Challenges we ran into Data Imbalance: The dataset had a disproportionate number of benign images compared to malignant ones, which caused the model to be biased towards predicting benign cases. To address this, we used techniques like oversampling the minority class (malignant) and class weights during training to balance the impact of both classes.
Model Overfitting: Since the dataset isn't very large, we faced the challenge of overfitting. To mitigate this, we employed techniques such as data augmentation, dropout, and early stopping during training.
Image Quality and Variability: The images had different lighting conditions, image quality, and angles, which affected the model's ability to generalize well across unseen data. We tackled this by applying various augmentation techniques to make the model more robust.
Computational Resources: Training a deep learning model on a large dataset can be computationally intensive. We leveraged Google Colab for its free GPU resources to speed up the training process.
5) Accomplishments that we're proud of High Accuracy: The model achieved an accuracy of over 90% on the validation set, demonstrating its potential in distinguishing between malignant and benign lesions. Deployment: We successfully created a user-friendly web-based interface where users can upload images of skin lesions, and the model provides a prediction in real-time. Scalability: The model has the potential to scale to other medical image domains by fine-tuning on different datasets.
6) What we learned Model Interpretability: We learned the importance of using tools like Grad-CAM to visualize which parts of the image the model focuses on when making predictions. This helps in improving the trustworthiness of the model's predictions. Data Augmentation: The power of data augmentation was clearly evident in improving model robustness and generalization. Handling Imbalanced Data: Balancing datasets is crucial in medical image classification, and we learned that leveraging techniques like oversampling and class weights can significantly improve model performance. Optimizing Hyperparameters: We learned how hyperparameter tuning (e.g., learning rate, number of layers, etc.) can substantially affect model performance.
7) What's next for Skin Cancer Detection using CNN Model Improvement: We plan to experiment with more advanced architectures like ResNet or EfficientNet for improved accuracy and speed. Real-World Deployment: We aim to deploy this model in a mobile app, enabling users to take pictures of their skin and receive real-time predictions, integrating with telemedicine platforms for doctor consultations. Expand Dataset: We would work on gathering more diverse datasets from different populations to reduce bias and improve the model's generalization. Explainability and Trust: We plan to further integrate explainable AI (XAI) techniques, such as SHAP values, to increase the transparency and trust of the model’s decisions, which is critical in the healthcare domain. Collaborate with Dermatologists: We plan to collaborate with dermatologists to validate and further refine the system in clinical settings.
Built With
- cnn
- image-processing
Log in or sign up for Devpost to join the conversation.