# Indonesian Car Retrieval System: End-to-end vision pipeline — Luthfi Arifin

> An end-to-end computer-vision pipeline for vehicle retrieval using YOLOv12n detection and an EfficientNet-B4 embedding backbone. This pipeline watches traffic…

Canonical page: https://luthfiarifin.com/projects/car-retrieval
Last updated: 2026-11-29

- **Type:** Computer Vision
- **Role:** Solo project
- **Year:** 2025
- **Tags:** Computer Vision, Research, Open Source
- **Stack:** YOLOv12n, EfficientNet-B4, CBAM, PyTorch
- **Link:** [canva.link/tm49kcgz1goap0l](https://canva.link/tm49kcgz1goap0l?ref=https://luthfiarifin.com)

*End-to-end vision pipeline*

## The story

This pipeline watches traffic video and labels every car it sees by body type. It works in two stages: a detector finds the cars, then a classifier decides whether each one is an MPV, a sedan, a pickup and so on.

I built every stage. A scraper collected Indonesian car photos from OLX, Carmudi and Mobil123, then validated, cropped and split them into an eight-class dataset that I published on [Kaggle](https://www.kaggle.com/datasets/muhammadluthfiarifin/indonesian-cars-classification-dataset). For detection I fine-tuned YOLOv12n on vehicle images from COCO. For classification I trained a PyTorch model with an EfficientNet-B4 backbone and CBAM blocks, which add channel and spatial attention, using augmentation and a weighted loss to handle class imbalance. The last notebook runs both models frame by frame on a test video and writes an annotated copy.

A car-detection case like this one opens my talk [The Right AI for The Right Problem](https://luthfiarifin.com/talks/the-right-ai-for-the-right-problem): a small detector plus a CNN cost about $0.001 per image and answered in about 50 ms, against $0.01–0.03 and 3–5 seconds for GPT-4V.

## Highlights

- Two stages: YOLOv12n detection, then EfficientNet-B4 + CBAM classification
- My own eight-class dataset of Indonesian cars, scraped from three marketplaces and published on Kaggle
- Class imbalance handled with augmentation and a weighted loss
- Runs end to end on video and outputs an annotated clip

## Figures

- [Precision-recall curve of the fine-tuned detector.](https://luthfiarifin.com/images/projects/car-retrieval-1.webp) — Precision-recall curve of the fine-tuned YOLOv12n car detector, labelled 0.585 mAP@0.5.
- [Class balance of the scraped dataset.](https://luthfiarifin.com/images/projects/car-retrieval-2.webp) — Bar chart of valid images per car class after scraping and validation, with MPV the largest class and pickup and truck the smallest.

## Resources

- [Source code](https://github.com/luthfiarifin/hybrid-envit-car-retrieval) — GitHub notebooks
- [Indonesian Cars Classification Dataset](https://www.kaggle.com/datasets/muhammadluthfiarifin/indonesian-cars-classification-dataset) — Kaggle
- [The Right AI for The Right Problem](https://luthfiarifin.com/talks/the-right-ai-for-the-right-problem) — Talk
