César Hernandez Alvarez

About me

I am a Research Scientist with a PhD in Medical Engineering, specialising in deep learning for complex physical signals. My doctoral work focused on reconstructing objects hidden inside scattering media, a problem that required understanding the physics of light before touching a single line of code. That grounding shapes how I approach every modelling problem.

I build and evaluate models end-to-end, from raw data curation and preprocessing decisions to training from scratch, failure analysis, and deployed interactive demos. I have trained architectures with 50M+ parameters on 600K+ image datasets and translated research experiments into accessible tools on Hugging Face. I am currently expanding my work toward multimodal medical imaging and data-constrained problems where getting the evaluation right matters as much as getting the model right.

MY WORK

Projects and contributions

To learn more about a specific project, visit the repository or to try a demo version, click on the corresponding links in each of the cards.

Optical imaging in scattering media (Doctoral thesis)

The aim of this project was to improve the quality and remove the randomness present in optical imaging reconstruction through scattering media.

Article on hyperparameters for optimisation processes

This article describes a method for reducing computational time and the need for human intervention when tuning parameters for the PSO algorithm applied to image reconstruction.

Close-up of various sterilized surgical tools laid out on a blue surface, ready for medical procedures.

Surgical Instrument Detection – Laparoscopic Video

A fine-tuning study applying YOLOv8s to surgical instrument detection across 7 classes, with per-class failure analysis, a documented evaluation framework, and a live interactive demo.

A vertical shot of a doctor's hand holding a lung x-ray in a medical clinic, focusing on healthcare diagnosis.

Chest X-Ray pneumonia detection – Transfer Learning comparison

A transfer learning study comparing a ViT fine-tuned from scratch against a purpose-built specialized model, with side-by-side Grad-CAM visualizations and a live interactive demo.

Optical imaging in scattering media (Doctoral thesis)

Turbid (or scattering) media refers to materials that do not allow light to pass through, such as opaque substances. The main challenge in applying Deep Learning-based image reconstruction algorithms is that each model is specific to the medium it was trained on. If the medium changes – even if the object remains the same – the model’s performance drops significantly.

This issue becomes more complex in the case of human skin, which is a dynamic medium. Even when training data is collected from a single person, the skin’s properties change over time, meaning the conditions seen during training are not stable.

The aim of this thesis was to improve the generalisation of Deep Learning-based imaging models for the reconstruction of objects hidden behind or within scattering media in optical systems. To address this, several network architectures and parameterisation strategies were explored.

The models presented here – Dense CNN and U-net – were trained using both intensity distribution images (known as speckles) and Fourier information of the objects derived from those speckles, specifically autocorrelation and Fourier spectrum data. The full analysis and results can be found in the published thesis at the link indicated on the project card.

Journal article on hyperparameter tuning for optimisation processes

Imaging through scattering media is a major challenge in optical systems because the phase information of light is lost in the speckle patterns recorded behind a diffuser or other complex medium. Traditional phase retrieval algorithms can reconstruct the hidden object from intensity measurements, but they depend critically on user-chosen parameters (e.g., filter settings or thresholds) that are usually picked with prior knowledge of the object’s characteristics, something that isn’t available in real imaging applications.

This published work proposes using Particle Swarm Optimization (PSO), a biologically inspired search algorithm, to automatically determine the optimal parameter values for phase retrieval, eliminating the need for manual tuning or object-specific assumptions. By integrating PSO with a single-shot imaging approach based on object-modulated speckles, the method achieves faster convergence and improved reconstruction quality without repeated searches for the best settings.

The study highlights how combining optimization techniques with optical phase retrieval can make speckle-based imaging more robust and practical, especially in situations where prior object information is unavailable.

Close-up of various sterilized surgical tools laid out on a blue surface, ready for medical procedures.

Surgical Instrument Detection – Laparoscopic Video

Surgical instrument detection in laparoscopic video sits at the intersection of two hard problems: a heavily imbalanced class distribution and a significant domain gap between general-purpose vision models and the realities of a surgical environment. This project investigates how well a pretrained object detection model transfers to that domain with limited annotated data.

The model is YOLOv8s, pretrained on COCO, a large-scale general-purpose detection dataset with 80 object classes. None of those classes are surgical instruments. The question was whether the visual representations learned on natural images would transfer meaningfully to a specialised clinical domain, and where exactly that transfer breaks down.

Fine-tuning was performed on the Cholec80-boxes dataset, covering 7 instrument classes across 14,195 annotated frames. The class distribution is heavily skewed: the Hook instrument dominates the dataset, while classes like Clipper and Scissors appear rarely. This imbalance is not incidental, it reflects the reality of laparoscopic surgery, and it is where the model’s performance diverges most sharply.

Results tell two stories at once. Overall mAP@50 reached 0.685, and the dominant class achieved 0.986. But rare classes fell well below 50%, a direct consequence of dataset imbalance that augmentation alone does not solve. The evaluation framework was deliberately built around failure characterisation: identifying where the model fails, why, and what that implies for the next iteration. Key failure modes include partial occlusion by tissue, motion blur during fast instrument movement, and visual similarity between certain instruments and anatomical structures.

The interactive demo is deployed on Hugging Face Spaces via Gradio, making failure behaviour directly inspectable on real laparoscopic frames rather than just reported as aggregate metrics.

A vertical shot of a doctor's hand holding a lung x-ray in a medical clinic, focusing on healthcare diagnosis.

Chest X-Ray pneumonia detection – Transfer Learning comparison

Transfer learning is one of the most powerful tools in medical AI, but how much does it matter whether you start from a general-purpose model or a purpose-built one? This project investigates that question using chest X-ray pneumonia detection as a controlled experiment.

Both models share the exact same backbone: google/vit-base-patch16-224-in21k, a Vision Transformer pretrained on ImageNet-21K with 14 million images. The reference model, nickmuchi/vit-finetuned-chest-xray-pneumonia, was already fine-tuned specifically for this task. The goal was to train a model from that same starting point from scratch and measure the gap – if any.

Training followed a two-phase approach on the Kaggle Chest X-Ray Images dataset (~5,800 images, binary classification: Normal vs Pneumonia). In the first phase, the backbone was frozen and only the new classification head was trained, allowing the model to learn the task without disturbing the pre-trained representations. In the second phase, the full model was fine-tuned end-to-end with a significantly lower learning rate to avoid catastrophic forgetting. Class weighting was applied throughout to handle the 3:1 Pneumonia:Normal imbalance in the training set.

The interactive demo runs both models simultaneously on any uploaded chest X-ray, showing predictions, confidence scores, and Grad-CAM heatmaps side by side – making it possible to see not just whether the models agree, but where in the image each one is looking when it makes its decision.

Technical skills

A curated list of the tools, frameworks, and methods I have worked with across my PhD research, portfolio projects, and self-directed learning. Grouped by purpose, each entry includes a short description of how I actually used it, not just that I know it exists.

Python

My primary language for everything: data processing, model training, experimentation, and deployment. From optical signal analysis during my PhD to building and deploying portfolio projects, Python has been at the centre of it all.

MATLAB

Used during the early phase of my PhD for signal processing, algorithm development, and working with optical data before transitioning to Python-based deep learning workflows.

PyTorch

My main framework for building and training deep learning models in my portfolio projects. Used for designing custom architectures, fine-tuning pretrained transformers, and running training pipelines end-to-end.

TensorFlow

My primary framework during my PhD research, where I designed and trained CNN and U-Net architectures from scratch on large-scale datasets. Used extensively alongside Keras throughout my doctoral work.

Keras

My high-level interface of choice during my PhD, used alongside TensorFlow for building, testing, and iterating on model architectures throughout my doctoral research.

scikit-learn

Used throughout my deep learning workflows for data preprocessing, preparation, evaluation metrics, and machine learning utilities. A consistent presence across both my PhD work and portfolio projects.

OpenCV

My primary library for image loading, preprocessing, and manipulation. Used extensively throughout my PhD and portfolio projects for handling raw image data before feeding it to models.

scikit-image

Used occasionally for specific image processing operations where it offered cleaner implementations than OpenCV, particularly for certain filtering and morphological tasks.

Pillow

Used for straightforward image loading and basic manipulation tasks where OpenCV would have been overkill. Reliable and simple for quick file handling.

NumPy

The backbone of every numerical computation in my work. Arrays, matrix operations, data transformations: NumPy is involved at every stage of the pipeline.

Pandas

Used for data handling, analysis, and experiment logging throughout my PhD. Particularly useful for managing large sets of experimental results and keeping track of training runs across different configurations.

SciPy

Used for scientific computing tasks during my PhD, including signal processing operations, statistical analysis, and numerical methods that complemented my deep learning workflows.

SymPy

Used primarily in a teaching context to demonstrate symbolic mathematics to undergraduate students, making abstract mathematical concepts more tangible through code.

Jupyter

My environment of choice for research and experimentation during my PhD. Used for prototyping, testing ideas, and documenting experiments in a way that kept code, results, and notes in one place.

Google Colab

My go-to environment for portfolio projects, combining the familiar notebook interface with free GPU access. Useful for running training experiments without needing local compute resources.

Hugging Face

Where I host and share my models and interactive demos. Both portfolio projects are deployed there, and I use the Transformers library for working with pretrained vision models.

Gradio

The tool I use to turn model experiments into interactive demos. Both of my deployed projects use Gradio to make model behaviour directly inspectable by anyone, no code required.

CUDA

Used for GPU-accelerated training throughout my PhD and portfolio projects. Running large-scale experiments on HPC clusters required working directly with CUDA configurations and memory management.

Git

Used for version control across all my projects, keeping track of experiments, architectural changes, and pipeline iterations in a reproducible and documented way.

GitHub

Where I store and version my code projects. Currently hosts my earlier skin cancer detection work and web development experiments, with portfolio projects hosted directly on Hugging Face rather than mirrored here.

I worked with raw optical signals, speckle patterns, autocorrelations, and Fourier-domain representations throughout my PhD. Understanding the physics of the signal shaped every modelling and preprocessing decision I made.

I explored how pretrained visual backbones encode information and how those representations transfer across domains, both in my chest X-ray comparison project and in the surgical instrument detection work.

A recurring theme across my work. I investigated how representations learned on general-purpose datasets transfer to specialised domains with limited data, and where that transfer breaks down.

From my PhD ablation studies to my portfolio projects, I designed controlled experiments that isolate one variable at a time, making results interpretable and decisions defensible.

Every pipeline I built was designed to be reproducible: documented, version-controlled, and structured so that other researchers could run the same experiments independently without modification.

I systematically tested different input representations to understand which carried the most useful information for generalisation. The preprocessing pipeline was never an afterthought, it was the research.

I developed two-phase fine-tuning approaches: first freezing the backbone to train the task head, then unfreezing for end-to-end refinement. Applied in both portfolio projects to maximise transfer from pretrained weights.

I built evaluation frameworks deliberately focused on failure characterisation, not just headline metrics. Understanding where and why a model fails matters more than reporting its best-case performance.

During my PhD I ran systematic experiments across dataset sizes ranging from 500 to 40,000 training samples to understand how performance scaled with data and compute, establishing empirical scaling laws for my domain.

A metaheuristic optimisation algorithm I applied during my PhD to tune the parameters of phase retrieval algorithms, reducing computational requirements by 45% without sacrificing reconstruction accuracy.