How I Used Machine Learning to Automate Fish Counting on Our Farm

The Quick Version:

I collaborated with software developers to streamline the fish counting process on our farm, resulting in faster counting, increased savings and healthier fish.

When I started my apprenticeship on my family’s fish farm, I expected to learn about water quality, feeding schedules, and the rhythm of farm life. Eventually, I did learn those things – but counting fish was what I learned on day 1.

And not just a few fish. Thousands of them. Every. Single. Week.

The process was completely manual. Fish had to be handled repeatedly, counted by hand, and moved through containers. It was a time-consuming and tedious job. As someone who has always been fascinated by technology and efficiency, my brain immediately went into optimizing mode.

With the modern technological resources that we have, could this process be made more efficient?

Researching the Problem

My first instinct was to see what solutions already existed. Surely someone had invented a machine to automate fish counting, right? As it turns out, yes, they had.

I found several impressive fish-counting systems on the market. They used sensors, cameras, and sophisticated hardware designed specifically for aquaculture operations. They were also… unbelievably expensive. One machine I came across cost about the equivalent of an entire year’s salary for some employees.

Even if the farm could justify the initial investment, there was another issue: machines require maintenance. And maintenance means ongoing costs, downtime, and additional complexity.

That didn’t sit well with me. I wanted something simpler.

The “Solution in My Pocket”

Then it hit me: I was already carrying a powerful piece of technology everywhere I went — my phone.

A smartphone has everything you need for basic machine vision:

  • A camera that can capture high-quality images
  • A processor that can analyze those images
  • A platform for apps built specifically to recognize objects

So I started researching mobile apps that could potentially count objects from photos or videos.

That’s when I discovered CountThings — an app designed to do exactly what its name suggests.

Training the System to Recognize Corydoras

The software already existed, but there was one problem: it didn’t know what our fish looked like, so initially it didn’t work.

Our farm raises corydoras, small bottom-dwelling freshwater catfish that are popular in aquariums. For the app to count them accurately, it had to be trained to recognize them in images.

So I reached out to the CountThings team (which I highly recommend by the way).

Over the course of several weeks, I submitted hundreds of photos of corydoras that they used to train their recognition model. But collecting photos alone wasn’t enough.

We had to figure out what conditions produced images the software could reliably process.

That meant experimenting with:

  • Lighting conditions
  • Color contrast
  • Camera distance
  • Fish density in each photo

And there was one major complication: the fish were alive and constantly moving.

Engineering the Perfect Photo Setup

After a lot of trial and error, it became clear that consistency was everything.

If the camera angle or distance changed too much, accuracy dropped. So I designed a simple but effective solution: a custom-built counting table.

The table was made entirely from PVC. That choice wasn’t accidental:

  • PVC won’t rust
  • It won’t rot
  • It’s inexpensive
  • It’s lightweight and easy to move

Most importantly, the table held the phone at the exact focal distance needed to consistently produce images the software could process.

What started as a simple idea turned into a practical piece of farm equipment.

Building the Workflow

But the table and the app were only part of the solution. Technology alone doesn’t solve problems — process does.

To actually save time, I had to design a clear workflow that anyone on the farm could follow:

  • What to do
  • When to do it
  • How each step should be performed

The goal was to create a system that was simple, repeatable, and fast enough to make sense during busy farm operations.

Once everything was in place, the results were immediate.

The Results Were Better Than Expected

The new system didn’t just make counting faster. It improved almost every aspect of the process.

First, the fish were handled far less frequently, which reduced stress and lowered the risk of harming them before shipment.

Second, the accuracy improved dramatically.

Before implementing the system, manual counting errors were costing us more than we realized. Inaccurate counts meant we were effectively giving away hundreds of fish every week.

Once the app-based system was in place, those fish stayed on the farm and were included in the following week’s shipments instead.

By the end of the year, that added up to real money saved — money that could be reinvested into improving the farm.

A Simple Lesson About Technology

This project reinforced something I’ve seen again and again: You don’t always need expensive machinery or complex systems to solve operational problems.

Sometimes the best solution is simply reimagining how to use the technology you already have.

In this case, a smartphone, a simple PVC table, and a little experimentation turned into a practical system that improved efficiency, accuracy, and fish welfare.

Not bad for something that started with a question I asked on my first day on the farm: “Is there a better way to count these?”

Wanna keep reading?