Portfolio

Portfolio

Applied machine learning projects on natural language processing, computer vision, credit scoring and forecasting.

Applied machine learning projects on natural language processing, computer vision, credit scoring and forecasting.


The portfolio collects applied machine learning projects that are larger than a single blog post. Each card describes the problem, the modelling approach and the lessons that transfer to other tasks. Three featured projects come first:

Further projects on computer vision, forecasting, tabular data and open-source tooling are grouped below.


Text Readability Prediction with Transformers

Stack of books illustrating text readability

Highlights

  • a complete PyTorch / Hugging Face text regression pipeline
  • BERT, RoBERTa and related transformers with custom pooling heads
  • an interactive app that scores the reading complexity of any custom text

Tags: natural language processing, deep learning, web app

Summary

Estimating how difficult a text is to read matters to teachers: students develop reading skills fastest when passages are challenging but not overwhelming. Classic readability formulas rely on weak proxies such as sentence length and syllable counts, which leaves a lot of accuracy on the table.

The project replaces those heuristics with an ensemble of eight transformer models. Each model uses a regression head on top of a concatenation of several hidden layers, which captures both surface-level and semantic signals. Training relies on text augmentation – sentence-order shuffling, back-translation and target noise – to make the most of roughly 2,800 labelled passages from the CommonLit Readability Prize data set.

Two of the trained models power a small Streamlit app: paste a paragraph and the app returns a readability score together with example texts for comparison. The blog post on text readability walks through the pipeline and the app code.

Readability app demo

Image-to-Text Translation of Molecules

Chemical structure images

Highlights

  • a CNN-LSTM encoder-decoder that turns structure drawings into chemical formula strings
  • a PyTorch image captioning pipeline that runs on both GPUs and TPUs
  • an ensemble of encoder-decoder models evaluated with the Levenshtein distance

Tags: computer vision, natural language processing, deep learning

Summary

Chemists usually draw molecules as structural diagrams. Decades of scanned publications and medical documents therefore contain images that are not annotated with machine-readable formulas, and converting them reliably requires time-consuming expert work. Automated recognition of optical chemical structures could speed up research and development in the field.

The project frames the task as image captioning: translating an unlabelled chemical image into its InChI text string. An EfficientNet encoder extracts features from each drawing, and a multi-layer LSTM decoder generates the formula token by token. Training uses the Bristol-Myers Squibb Molecular Translation data set with more than four million chemical images, so an efficient data pipeline matters as much as the architecture.

Predictions are scored with the Levenshtein distance between the generated and the true string – the number of character edits needed to fix a prediction. Combining several encoder-decoder models into an ensemble lowers that distance compared with any single model.


Fair Machine Learning in Credit Scoring

Fair machine learning pipeline

Highlights

  • a benchmark of eight fairness processors on seven credit scoring data sets
  • a profit-fairness trade-off analysis that puts a price on fairness
  • practical guidance on choosing a fairness criterion for scorecards

Tags: tabular data, fairness, profit maximization

Summary

Lenders use scorecards to approve or reject loan applications, which makes algorithmic discrimination a real concern. The project looks at fairness from three angles:

  • which statistical fairness criteria – independence, separation or sufficiency – make sense for credit decisions
  • where fairness goals can enter the modelling pipeline: pre-processing the data, constraining the learner, or post-processing the scores
  • how much profit a lender gives up when a fairness constraint is enforced on real-world data

The experiments show that several criteria can be approximately satisfied at the same time, that separation is a sensible default for scorecards, and that in-processing methods tend to offer the best balance between profit and fairness. The tutorial on algorithmic fairness in R shows how to compute the underlying metrics.

Profit and fairness trade-off


Further projects

More projects, grouped by application area. Several of them have a matching post on the blog.

Computer vision

Pet Popularity Prediction

Pet adoption illustration
  • predicts how appealing a pet photo is to adopters from image and tabular data
  • combines vision transformers and CNN backbones with metadata features
  • includes a small app for scoring custom photos

Cassava Leaf Disease Classification

Cassava leaf samples
  • CNNs and vision transformers that recognise four cassava diseases and healthy leaves
  • a stacking ensemble on top of several computer vision models

Catheter and Tube Position Detection on Chest X-Rays

Chest x-ray samples
  • deep learning models that detect catheter and tube positions on x-ray images
  • a comprehensive PyTorch computer vision pipeline that trains on GPUs and TPUs

Detecting Blindness on Retina Photos

Retina photos
  • CNN models that grade diabetic retinopathy on fundus photographs
  • image preprocessing to correct lighting and crop uninformative borders
  • pre-training on a larger related data set before fine-tuning – see the blindness detection post

Forecasting and tabular data

Profit-Driven Demand Forecasting with Gradient Boosting

Custom profit loss function
  • a two-stage LightGBM pipeline for item-level demand prediction
  • thorough cleaning, aggregation and feature engineering on transactional data
  • custom asymmetric loss functions that reflect the retailer's profit – explained in the demand forecasting post

Probabilistic Demand Forecasting with Graph Neural Networks

Graph neural network forecasting architecture
  • a DeepAR forecaster extended with a graph neural network encoder
  • product graphs built from attribute similarity instead of a fixed structure
  • probabilistic forecasts that support inventory decisions under uncertainty

Google Analytics Customer Revenue Prediction

Feature importance chart
  • two years of transactional data from an online merchandise store
  • LightGBM models that predict future revenues generated by customers

Open-source tooling

fairness: an R package for fair ML metrics

Fairness package logo
  • computes, visualises and compares group fairness metrics for classifiers
  • supports predictive rate parity, equalised odds, demographic parity and more
  • available on CRAN – the R tutorial shows it in action

dptools: a Python package for data processing

Data processing illustration
  • helper functions for recurring data processing tasks
  • covers feature engineering, aggregation, missing values and memory reduction
  • designed to shorten the boilerplate at the start of every tabular project