SkinSense: Skin Cancer Classifier
An ensemble of five models labels a lesion as benign or malignant from one RGB image.
Built during a research internship at HamsanTech. The pipeline covers data cleaning, feature extraction and model ensembling across XGBoost, LightGBM, AdaBoost, SVM and logistic regression, with full exploratory analysis of the image metadata.
README · rendered from GitHub
SkinSense: Multi-Model Skin Cancer Classifier
A machine learning project for binary classification of skin cancer as malignant or benign, utilizing models like XGBoost, LGBM Classifier, Adaboost, SVM, and Logistic Regression. This pipeline involves preprocessing, visualization, modeling, and evaluation, making it a powerful diagnostic aid in dermatology.
EDA & Preprocessing
Exploratory Data Analysis
-
Load and integrate image and metadata files.
-
Visualize sample images for quality checks.
-
Count of Targets by Anatomical Site
-
Count of Targets by Age
-
Count of Targets by Sex
-
Analyze class distribution (malignant vs. benign). Benign 400666 Malignant 393
- Review metadata (patient age, lesion location, etc.).
Preprocessing
-
Data Cleaning: Remove duplicates, handle missing values.
-
Data Augmentation: Random rotations, flips, brightness/contrast variations.
-
Normalization: Scale pixel intensities, normalize image dimensions.
-
Resizing: Uniform image dimensions while preserving aspect ratio.
Modeling & Training
Models Used
- XGBoost
- AdaBoost
- LightGBM (LGBMClassifier)
- Support Vector Machine (SVM)
- Logistic Regression
- (Optional) Neural Network (for deep learning approach)
Training Techniques
- Hyperparameter tuning using Grid/Random Search.
- K-Fold Cross-validation.
- Model-specific optimizations (e.g., SVM kernels, NN architecture).
Evaluation
- Metrics: Accuracy, Precision, Recall, F1-Score, AUC.
- Validation: Regular monitoring using a validation set.
- Confusion Matrix: For visualizing classification errors.
Tech Stack
| Category | Tool/Framework |
|---|---|
| Platform | Kaggle |
| Notebook | Jupyter Notebook |
| Language | Python |
| Libraries | scikit-learn, XGBoost, LightGBM, matplotlib, seaborn, OpenCV, NumPy, pandas |
How to Run
- Go to the Kaggle Notebook using the link below:
https://www.kaggle.com/code/masharjavid/final-skin-cancer-binary-classifier
- Open the notebook and run all cells.
- Dataset is already uploaded in the Kaggle environment and linked within the notebook.
Results
- Best AUC Score: 0.963
- Highest Accuracy: 90.02%
- Top Performing Model: LGBM-Classifier
- Train loss: 0.1646
- Validation loss: 0.1245
- Recall: 0.876
- Time taken: 60.94sec
Future Work
- Web/Mobile app deployment with UI for diagnosis.
- Explore larger datasets for improved generalization.
More in AI / ML
Related projects
Private repoAI / MLSummer 2026Trans-Neptunian Object Detection
A spatiotemporal U-Net that finds faint moving objects in telescope image sequences.
- PyTorch
- Python
- HDF5
- CANFAR
AI / ML2025RecycleVision
EfficientNetB0 transfer learning sorts waste into six recyclable categories.
- Python
- TensorFlow
- Keras
- EfficientNetB0
AI / ML2025CIFAR-100 with WideResNet-28×10
A reproducible high-accuracy training pipeline with MixUp, CutMix and RandAugment.
- Python
- PyTorch
- WideResNet
- NumPy