Fine-tuning deep CNN models on specific MS COCO categories

Daniel Sonntag, Michael Barz, Jan Zacharias, Sven Stauden, Vahid Rahmani, Áron Fóthi, András LörinczarXiv 2017

Introduction

Researchers from DFKI and Eötvös Loránd University have introduced py-faster-rcnn-ft, a software library designed to streamline the fine-tuning of deep learning models on specific subsets of the MS COCO dataset. By automating manual configuration and image selection, the tool facilitates the creation of specialized object detectors that outperform general-purpose models on targeted categories.

Problem Statement

In computer vision, fine-tuning pre-trained models is a standard approach for niche tasks. However, using the Faster R-CNN framework to train on specific categories (e.g., "people" and "cars" instead of all 80 MS COCO categories) involves a cumbersome manual workflow:

  1. Identifying and hard-coding category IDs in multiple source files.
  2. Modifying neural network architecture files (.prototxt) to match the class count.
  3. Manually sifting through thousands of images for testing and demos.

These manual steps are error-prone and often lead to inconsistent software states. This paper introduces a fork of the original library that automates these hurdles.

Methodology

The py-faster-rcnn-ft library introduces several automation layers to resolve these developer bottlenecks:

  • Automated Prototxt Management: A Python wrapper automatically adjusts the network architecture files (e.g., modifying the final layers) based on the number of target classes.
  • Centralized Configuration: Users define category IDs in a single YAML file, which the system propagates throughout the pipeline, replacing the need to edit multiple source files.
Simplification of the configuration process in py-faster-rcnn-ft.
  • Smart Demo Selection: A tool randomly selects images containing at least one instance of the target categories for instant verification.
  • Bug Fixes: The library addresses a critical issue where the original framework failed to distinguish between selected and unselected categories, preventing crashes during training.

Dataset and Evaluation

The study primarily utilizes the MS COCO 2014 dataset for fine-tuning and evaluation. Initial pre-training was conducted on ImageNet (ILSVRC-2012) using the VGG_CNN_M_1024 model. The authors also referenced PASCAL-2007 VOC to verify that target-specific fine-tuning improves mean Average Precision (mAP).

Results and Insights

The core finding is that models specialized for a few categories achieve higher precision than general-purpose "jack-of-all-trades" models. Fine-tuning allows the model to adapt to specific visual contexts and backgrounds that might otherwise be misleading.

Comparing a model fine-tuned on "person" and "car" categories against a standard 80-category MS COCO model (Average Precision at IoU=[0.50, 0.95]):

  • Person Category: AP increased from 26.2% to 29.4%.
  • Car Category: AP increased from 11.2% to 15.6%.
Specialized detection results for 'person' (top) and 'car' (bottom) categories using the fine-tuned model.

Conclusion

While currently tailored to MS COCO, the authors plan to expand the tool to other datasets and integrate web-scale training via automated image retrieval. By treating the training pipeline as a software engineering challenge, this work makes specialized deep learning significantly more accessible to researchers and developers.

Summary updated

Abstract

Fine-tuning of a deep convolutional neural network (CNN) is often desired. This paper provides an overview of our publicly available py-faster-rcnn-ft software library that can be used to fine-tune the VGG_CNN_M_1024 model on custom subsets of the Microsoft Common Objects in Context (MS COCO) dataset. For example, we improved the procedure so that the user does not have to look for suitable image files in the dataset by hand which can then be used in the demo program. Our implementation randomly selects images that contain at least one object of the categories on which the model is fine-tuned.
BibTeX
@misc{sonntag2017fine,
  author = {Daniel Sonntag and Michael Barz and Jan Zacharias and Sven Stauden and Vahid Rahmani and Áron Fóthi and András Lörincz},
  title = {{Fine-tuning deep CNN models on specific MS COCO categories}},
  year = {2017},
  eprint = {1709.01476},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1709.01476},
}
Figure