A KFP Model artifact represents a trained machine-learning model in a pipeline. Use it for trained models, checkpoints, weights, or pretrained model artifacts. Its type supports framework-specific metadata and helps track lineage from training data and parameters to the resulting model. section 7.2.3
A training component consumes an Input[Dataset], produces an Output[Model], and saves the trained model at the output artifact’s path. section 7.2.3
Downstream components declare Input[Model] to receive that output. Keep the roles distinct: Dataset carries validation data, Model carries the trained weights, and Metrics records evaluation results. section 7.2.3 section 8.1.4
Listing 8.13 Loading the YOLO model and computing validation metrics
@dsl.component(...)
def validate_model(...):
from ultralytics import YOLO
import os
model_path = os.path.join(model.path, "best.pt") #1
model = YOLO(model_path)
val_results = model.val( #2
data=os.path.join(data_yaml.path, "data.yaml"),
imgsz=640,
batch=1,
verbose=True
)
metrics.log_metric("map50-95", val_results.box.map) #3
metrics.log_metric("map50", val_results.box.map50) #3
metrics.log_metric("map75", val_results.box.map75) #3
In the YOLO validation component, the model is loaded from best.pt under model.path. Validation then logs mAP values to Output[Metrics], rather than treating those measurements as the model artifact. section 8.1.4
For tracking across experiments, MLflow provides centralized model artifact storage and model lineage tracking. Its run-based model loading is a separate workflow from passing a typed KFP Model between components. section 9.3.4 section 7.2.3

