Labeling and Semi-Supervised Learning on Medical Images (Brain MRI)
Python, Computer Vision, Deep Learning, Semi-Supervised Learning, Clustering, PyTorch, Scikit-learn, ResNet, Healthcare AI
Labeling and Semi-Supervised Learning for Brain Tumor Detection
Overview
This project implements a comprehensive analytical exploration of a largely unlabeled medical dataset, as part of an R&D project for automated brain tumor detection from MRI. The objective is to leverage a large volume of unlabeled images and a limited subset of expert labels to build a weak labeling pipeline followed by a semi-supervised classification model.
The project applies best practices of Computer Vision and semi-supervised learning to maximize the value of a partially labeled dataset, while evaluating the budgetary feasibility of scaling to several million images.
Objectives
- Explore and qualify a medical image dataset (resolution, channels, structure).
- Extract relevant visual features via a pre-trained model.
- Identify natural groupings through unsupervised clustering.
- Build a "weakly" labeled dataset from the clusters, without ever mixing it with expert labels.
- Implement and evaluate a semi-supervised approach, in comparison with classic supervised training.
- Formulate quantified recommendations for scaling (4M images, budget €5,000).
Demonstrated Skills
Data Exploration and Preparation
- Loading and visual exploration of an MRI dataset (resolution, color channel, file structure, metadata consistency).
- Preprocessing adapted to vision models: resizing, normalization.
- Methodical work on a reduced sample before scaling.
Feature Extraction by Transfer Learning
- Extraction of visual embeddings via a pre-trained ResNet-type model (frozen convolutional layers).
- Evaluation of several extraction layers to identify the most relevant representation.
- Constitution of a feature table usable for subsequent steps.
Clustering and Weak Labeling
- Dimensionality reduction (PCA, t-SNE) for visualization and interpretation of groupings.
- Application and comparison of several clustering algorithms (K-Means, DBSCAN).
- Generation of a "weakly" labeled dataset, kept strictly separate from the "strongly" labeled dataset.
- Validation of cluster relevance via the ARI score, calculated on the expert subset.
Semi-Supervised Learning
- Training a CNN model on the weakly labeled set, then continuing training on the strongly labeled set.
- Rigorous comparison of performance between purely supervised and semi-supervised approaches.
- Definition of metrics adapted to business risk (accuracy, F1-score, precision) and a clear "definition of done".
- Train/test split ensuring no data leakage during evaluation.
Feasibility Analysis and Recommendations
- Evaluation of AI labeling cost relative to available budget (€300 for the initial dataset).
- Argumented technical recommendations for scaling to 4 million images with a budget of €5,000, including feasibility conditions.
- Synthesis of results and trade-offs in the form of a presentation support for the project team.
Architecture
MRI Dataset (majority unlabeled
+ expert labeled subset)
│
▼
Exploration & preprocessing
(resolution, normalization, channels)
│
▼
Feature Extraction (Frozen ResNet)
│
▼
Dimensionality Reduction (PCA / t-SNE)
│
▼
Clustering (K-Means / DBSCAN)
│
┌─────────────┴─────────────┐
▼ ▼
"Weakly" Labeled "Strongly" Labeled
Set (clusters) Set (experts)
│ │
▼ │
CNN Training │
(weak labeling) │
│ │
└─────────────┬─────────────┘
��
Semi-Supervised Training Continuation
│
▼
Supervised vs Semi-Supervised Comparison
│
▼
Scaling Recommendations
Technical Stack
Deep Learning & Computer Vision
- PyTorch / torchvision
- Pre-trained Models (ResNet)
Clustering & Dimensionality Reduction
- Scikit-learn (K-Means, DBSCAN, PCA)
- t-SNE
Data Manipulation & Visualization
- NumPy, pandas
- Matplotlib, seaborn, plotly
- OpenCV
Deliverables
- Jupyter Notebooks (.ipynb): feature extraction, clustering, semi-supervised approach
- Presentation Support (synthesis and recommendations)
Applied Best Practices
- Strict separation of weakly and strongly labeled datasets
- Freezing convolutional layers for stable transfer learning
- Cross-validation of clusters via a quantitative score (ARI) rather than purely visual interpretation
- A priori definition of evaluation metrics and a success criterion ("definition of done")
- Train/test split ensuring no data leakage
- Scaling recommendations based on a real budgetary constraint
Results
At the end of this project, the pipeline allows to:
- extract exploitable visual representations from a pre-trained model;
- generate reliable weak labeling on unlabeled images;
- train a semi-supervised model and quantify its performance gain compared to a classic supervised approach;
- determine the budgetary feasibility of scaling to 4 million images;
- provide a clear and actionable summary to a Data Science project team.
Acquired Skills
- Feature extraction by transfer learning (pre-trained CNNs)
- Unsupervised clustering and dimensionality reduction
- Construction and exploitation of weak labeling
- Semi-supervised learning and comparison of training protocols
- Definition of relevant metrics and success criteria
- Budgetary feasibility analysis and scaling recommendations
- Communication of technical results to a project team