How to create an image classifier using F# and ML.NET

As an ode to Silicon Valley and Jìan-Yáng’s app that could detect if a picture contained a hot dog or not, I decided to implement my own version with a Christmas twist.

Image for post
Image for post
Silicon Valley — Hot Dog / Not Hot Dog

I wanted to see if I was able to create a binary image classifier, using F#, that could recognise whether an image contained Santa Claus or not.

The code for this is available on GitHub.

Data Gathering

To get images for training and evaluating the model I used the Bing Image Search API.

The API facilitates querying for images and returns a JSON response that includes image metadata alongside URLs for downloading them. …


Image for post
Image for post

The F# mentorship program is a 6 week community driven event where mentors volunteer to help you learn topics related to the language.

There are many topics you can get guidance on. Like a beginner’s introduction to F#, contributing to open source, or F# for machine learning.

This post is part of a series documenting my experience as a mentee, learning about and contributing to the F# compiler.

Week 2 Summary

  • Beginning Our Contribution
  • The First Two Errors
  • Investigating the Invalid Field Label Error
  • Resolving the Invalid Field Label Error

The Beginning Of Our Contribution

At the second meeting of the F# mentorship program, Avi Avni and I discussed my progress in Week 1 and our next adventure through the compiler! …


Image for post
Image for post

The F# mentorship program is a 6 week community driven event where mentors volunteer to help you learn topics related to the language.

There are many topics you can get guidance on. Like a beginner’s introduction to F#, contributing to open source, or F# for machine learning.

This post is part of a series documenting my experience as a mentee, learning about and contributing to the F# compiler.

Week 1 Summary

  • Introductions & Building The Repo
  • Debugging The Compiler
  • Practice — Parsing

Introductions & Building The Repo

Applications closed on the 5th February and by the 12th I’d found out I was paired with Avi Avni. We organised a time to talk over Slack and for me to fork and build the visualfsharp repo beforehand. …


I’ve been learning about Domain Driven Design and applying Command Query Separation (CQS) at an architectural level. The Decorator Pattern, using dependency injection (DI), works well with CQS but .NET Core’s dependency injection doesn’t have any nice functionality to register these decorators. I wanted a way to decorate my Command and Query handlers without adding a different DI library, that was readable and allowed me to define the decoration structure once.

CQS and Decorators

I’m going to brush over the concepts of using CQS to structure an application but to give you some background, here is a basic example of a query and query handler. …

About

Willie Tetlow

Software Engineer at Streamba, C#/F#/.NET and Javascript.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store