Menu

Robotics · Software · Cloud

What Matters More: The Model or The Data?

My First Lessons From Training AI Models for a Real Robot

By Sebastian Rychlik · Published

  • TerraScanAI
  • YOLOv8
  • Computer Vision
  • Machine Learning
  • Vertex AI
  • Dataset Training
  • Object Detection
  • NVIDIA T4
  • NVIDIA L4
Comparison of three detections of a decorative vase: YOLOv4 Tiny COCO labels it a cat with 78%, YOLOv8 trained on 17 images detects a vase with 0.36, YOLOv8 trained on 42 images detects a vase with 0.84

When I started building the AI training pipeline for TerraScanAI, I assumed that improving the model would be the biggest factor affecting detection quality.

I was wrong.

The biggest improvement came from improving the data. Over the last few weeks I completed the first end-to-end training loop inside TerraScanAI:

Collection → Annotation → Dataset → Version → Training → Registry → Deployment

The goal was deliberately simple:

Teach a robot to recognize a decorative garden vase.

Simple goals often produce the most interesting engineering lessons.

The Flower Pot That Used To Be A Cat

Readers of my previous post may remember the now-famous flower pot that was confidently classified as a cat by the factory model running on my OAK-D Pro camera.

Detection from the factory YOLOv4 Tiny COCO model: the decorative vase is labelled 'cat 78%' in a green bounding box
Factory YOLOv4 Tiny COCO model: the flower pot is detected as a cat (78%).

The original system used the factory YOLOv4 Tiny COCO model supplied with the camera ecosystem. While surprisingly capable, it occasionally produced entertaining results.

  • The flower pot became a cat.
  • Actual cats occasionally became dogs.
  • Sometimes neither was recognized correctly.

It was clear that if TerraScanAI was going to identify objects specific to my environment, a custom training pipeline would eventually be required.

Replacing YOLOv4 With YOLOv8

The first step was migrating from YOLOv4 to YOLOv8. The newer architecture offered:

  • Better training tooling
  • Better deployment support
  • Easier future customization
  • Stronger ecosystem support

The migration itself immediately improved detection quality. However, another problem quickly appeared. The flower pot was no longer classified as a cat. But it still wasn’t recognized as a vase.

The reason was simple:

The model had never seen my vase before.

Building The First Dataset

To solve that problem, I built the first custom dataset inside TerraScanAI.

TerraScanAI Gallery showing the Vase_Dataset draft with 17 images and 17 annotations, each image annotated with a vase bounding box
The first dataset in the TerraScanAI Gallery: 17 annotated images.

The initial dataset contained only 17 manually annotated photographs collected in the garden. At the time, that seemed sufficient. After all, the object was large, highly visible and easy to annotate.

I was about to learn my first lesson.

Why 17 Images Were Not Enough

The first training job completed successfully. The model recognized the vase. Technically.

The problem was confidence. Even when the vase occupied a large portion of the image, confidence remained around 36%.

YOLOv8 detection of the decorative vase labelled 'vase 0.36' in a green bounding box
YOLOv8 trained on 17 images: the vase is detected with a confidence of 0.36.

The model had learned something. Just not enough to be trusted by a robotic platform operating in the real world.

More Data Changes Everything

Instead of changing the architecture, I decided to change the dataset. I added another 25 photographs collected indoors.

Different:

  • Lighting
  • Backgrounds
  • Viewing angles
  • Distances

The dataset grew from:

17 images → 42 images

TerraScanAI Gallery showing the vase_42_images dataset draft with 42 images and 42 annotations, including indoor and garden photographs
The expanded dataset in the TerraScanAI Gallery: 42 annotated images.

The model architecture remained the same. The training pipeline remained the same. Only the data changed.

The Result

Confidence increased dramatically:

YOLOv8 detection of the decorative vase labelled 'vase 0.84' in a blue bounding box
YOLOv8 trained on 42 images: the vase is detected with a confidence of 0.84.
Chart titled 'Model confidence improvement': dataset V1 with 17 images gives 36% confidence, dataset V2 with 42 images gives 84% confidence
Detection confidence of the vase for the 17-image and 42-image datasets. These are confidence values of the reported detections, not overall model accuracy.

That was the moment when the biggest lesson became obvious.

The largest improvement did not come from changing the model. It came from improving the dataset.

YOLOv8 certainly helped.

But the difference between 17 and 42 carefully selected images was dramatically larger than I expected.

Benchmarking Vertex AI

While building the training workflow, TerraScanAI also gained support for:

  • Training job management
  • Machine selection
  • GPU selection
  • Vertex AI integration
  • Model registry workflows
  • Deployment automation

That allowed me to benchmark exactly the same training workload across multiple environments.

TerraScanAI training jobs table listing Vertex AI, local and simulation jobs with status, machine type, GPU, epochs, batch size, duration and region
Training jobs in TerraScanAI.

Training configuration:

  • Dataset: 42 images
  • Model: YOLOv8
  • Epochs: 50
  • Batch size: 16

Results

Vertex AI training benchmark results for the same dataset, model, epochs and batch size: local Intel Core i7-11800H 10m 44s, Vertex AI CPU only 44m 16s, Vertex AI NVIDIA Tesla T4 7m 16s, Vertex AI NVIDIA L4 about 11m, ranked by total time
Vertex AI training benchmark: same dataset, same model, different environments (total time).

At first glance, the NVIDIA Tesla T4 appeared to outperform the newer NVIDIA L4. However, these numbers represent end-to-end execution time, not pure training performance. For very small datasets like mine, infrastructure provisioning, scheduling and startup overhead become a significant part of the total runtime. For larger datasets, I expect cloud GPUs—especially newer accelerators like the L4—to become increasingly advantageous.

What Surprised Me Most

Before this experiment, I expected model architecture to be the dominant factor. Instead, the data itself turned out to be far more important than I anticipated.

The migration from YOLOv4 to YOLOv8 was valuable. But the jump from 17 images to 42 images produced a much larger improvement than I expected.

For anyone building custom AI systems, that may be the most valuable lesson from this entire experiment:

Better data often beats a better model.

What Comes Next?

Recognizing a vase was never the final goal. The real goal is recognizing individual cats.

If identifying a decorative vase required 42 carefully selected training images, how many examples will be needed before a robot can reliably distinguish:

  • Bonifacy
  • Lolek
  • Bianca
  • Frusia

from one another?

A flower pot was the easy part. Teaching a robot to recognize individual cats by name will be far more challenging. I already have a few ideas involving multi-stage AI pipelines and model chaining. That will be the subject of the next TerraScanAI article.

Screenshot from the OAK-D Pro camera: a decorative flower pot is labelled "cat 78%" with a green bounding box, while a real cat sits unlabelled in the lower right corner

Robotics · Software

When AI Mistakes a Flower Pot for a Cat

From YOLOv4 Tiny to YOLOv8 and Custom AI Training

One of the first AI models on the TerraScanAI robotics platform confidently labelled a flower pot as a cat and ignored the real one. Why better data, not just a different model, is the next step.

Read Article →

TerraScanAI illustration: the robotic platform with LiDAR and camera, a Cloud Run cloud with Spring Boot, Vertex AI, Firestore, Artifact Registry and IAM, and the Angular Mission Control dashboard, with a black cat lying in front

Robotics · Cloud · Software

Building AI-Powered Realtime Systems

Why Cloud Run Was the Right Choice for TerraScanAI

TerraScanAI is a real-world robotics project that combines edge AI on NVIDIA Jetson, a cloud layer on Google Cloud Run and an Angular Mission Control. Why Cloud Run beat Kubernetes.

Read Article →