liveBook · Manning

Chapter 8: Model training and validation: Part 1

What you will learn in chapter 8 of Machine Learning Platform Engineering

This chapter introduction shifts the pipeline from data preparation to reproducible model training and validation, using object detection as the main example.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This chapter introduction shifts the pipeline from data preparation to reproducible model training and validation, using object detection as the main example.

Key terms: reproducible training processes, robust validation strategies, reliable ML systems, modular training components, validation components, You Only Look Once (YOLO), ID card detection system, ML pipelines, metrics and artifacts, tracking frameworks

8.1 Training an object detection model

This section introduces a component-based approach to training the ID card detection model with YOLO, explaining why it suits production pipelines and what the training component will do.

Key terms: reproducible, modular, pipeline infrastructure, source control, YOLO, Ultralytics YOLO, training component, training, validation, and test images, labels

8.1.1 Training YOLO on a custom dataset

This section prepares a custom ID-card dataset for YOLOv8 training by defining its data configuration and writing it to YAML.

Key terms: YOLOv8, data configuration, YAML, id_card, labels, images, train/labels

8.1.2 Training the model

This section explains how to configure YOLOv8 training for ID card detection, choose a model size, and retain outputs for evaluation.

Key terms: robust default configurations, hyperparameters, training component, Ultralytics, YOLO class, train method, data, imgsz, epochs, YOLOv8n

8.1.3 Container components for system dependencies

This section builds a YOLO training step as a Kubeflow container component so it can install system dependencies, run a training script, and pass typed artifacts through a pipeline.

Key terms: libGL.so.1, libgl1-mesa-glx, apt-get, @dsl.component, @dsl.container_component, parse_args, data.yaml, epochs, best model, model_output

8.1.4 Creating the validation component

This section builds a Kubeflow component that validates a trained YOLO model and records its performance as pipeline metrics.

Key terms: validation, model degradation, data segments, historical performance records, Artifact, Model, Dataset, Metrics, KFP, model.val()

8.1.5 Creating the pipeline

This subsection adds a validation component to the existing YOLO training pipeline and points to compiling, uploading, and executing it next.

Key terms: validation component, pipeline, compile, upload, execute

8.1.6 Executing the pipeline

The section shows how to run the object-detection pipeline in Kubeflow, interpret its execution, and find its metrics and output artifacts.

Key terms: KFP run, run parameters, pipeline topology, data dependencies, split-dataset, validate-model, Ultralytics, epoch, model architecture, GPU memory

8.1.7 Validating model artifacts

The section shows how to inspect YOLO object-detection artifacts manually, compare pretrained and trained predictions, and turn those observations into validation checks and training decisions.

Key terms: manual inspection, default YOLO model, YOLOv8 Nano, Output artifacts, project, best.pt, confidence score, bounding box, class label, ID card

8.2 Summary

The section summarizes how to choose a suitable model, deliver training data to automated pipelines, and make training results easy to inspect and validate.

Where this is used later

Concepts explained in this chapter

← Chapter 7: Data analysis and preparation Chapter 9: Model training and validation: Part 2 →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.