In-domain versus out-of-domain transfer learning in plankton image classification

Andrea Maracani, Vito Paolo Pastore, Lorenzo Natale, Lorenzo Rosasco, Francesca OdoneScientific 2023

Abstract

Plankton microorganisms are vital components of aquatic food webs and serve as sensitive biosensors for environmental changes. While high-resolution automatic acquisition systems generate vast quantities of plankton imagery, the scarcity of expert annotations and the "long-tailed" nature of these datasets present significant challenges for automated classification. This study evaluates three transfer learning pipelines to compare the efficacy of in-domain (plankton-specific) versus out-of-domain (general-purpose) pre-training. Our findings reveal that pre-training on the massive ImageNet22K dataset outperforms domain-specific pre-training by approximately 6% in test accuracy. Furthermore, we demonstrate that single Vision Transformer models, specifically BEiT, can match or exceed the performance of complex convolutional neural network ensembles, establishing a new state-of-the-art for plankton classification.

Introduction

Plankton are often referred to as the "canaries in the coal mine" for aquatic ecosystems. Their rapid physiological responses to minimal environmental perturbations make them excellent indicators of climate change and pollution levels. Modern in-situ imaging systems, such as ZooScan and WHOI, have enabled the collection of millions of images. However, the bottleneck remains the labor-intensive process of manual annotation.

Example of a plankton specimen (copepod) captured by in-situ imaging systems.

Transfer learning is the standard approach to mitigate data scarcity. Traditionally, models are pre-trained on ImageNet1K. This research investigates whether utilizing large-scale plankton datasets for pre-training offers superior performance compared to even larger, more diverse general-purpose datasets like ImageNet22K.

Methodology

The study compares three distinct transfer learning pipelines:

  1. In-domain Pipeline: A ResNet50 model is pre-trained from scratch on large-scale plankton datasets (e.g., ZooScan98) before fine-tuning on target evaluation sets.
  2. Out-of-domain Pipeline: Models are pre-trained on ImageNet1K or ImageNet22K and then fine-tuned directly on plankton targets.
  3. Two-stage Pipeline: A hybrid approach where a model pre-trained on ImageNet is first fine-tuned on a large-scale plankton dataset and then further fine-tuned on the specific target dataset.

Beyond standard CNNs, the researchers evaluated modern architectures including Vision Transformers (ViT, Swin, BEiT) and ConvNeXt to determine their potential in this specialized domain.

Datasets

The experimental framework utilized a hierarchy of datasets:

  • Source Datasets: ImageNet1K (1.2M images), ImageNet22K (14M images), and large-scale plankton sets like ZooScan98 (1.4M images) and WHOI80 (253k images).
  • Target Datasets: Curated subsets for benchmarking, including WHOI22, Kaggle38, and ZooScan20.
Diversity in plankton morphology, such as this colonial form, necessitates robust feature extraction.

Results and Discussion

Diversity vs. Specificity

A key finding is that diversity in the pre-training set is more beneficial than domain specificity. Despite the ZooScan98 dataset having a similar volume to ImageNet1K, the ImageNet-pre-trained models achieved higher accuracy. The authors posit that the vast variety of features in ImageNet (ranging from animals to mechanical objects) forces the model to develop a more robust and discriminative "feature vocabulary" that generalizes better to the unique structures of plankton.

The Superiority of Scale and Transformers

Scaling from ImageNet1K to ImageNet22K provided a significant performance boost. In terms of architecture, the BEiT (BERT Pre-training of Image Transformers) model emerged as the top individual performer, achieving 96.1% accuracy on WHOI22 and 91.4% on ZooScan20. This is particularly noteworthy as it matches or exceeds previous state-of-the-art results that required ensembles of up to 11 different CNN models.

Ensemble Performance

While a single BEiT model is highly effective, an ensemble of ViT, Swin, BEiT, and ConvNeXt set new performance records across all target datasets. However, this ensemble provides only a marginal accuracy gain (~0.6%) at a significant computational cost, reducing processing speed from 65 images/sec to 17 images/sec.

Conclusion

This research demonstrates that for plankton classification, "bigger and more diverse" pre-training data is superior to domain-specific data. The success of Vision Transformers like BEiT simplifies the deployment of high-accuracy models. Future work will focus on knowledge distillation to compress these powerful models for use in power-constrained autonomous underwater vehicles (AUVs) and exploring the potential of even larger in-domain datasets as they become available.

Summary updated

BibTeX
@inproceedings{maracani2023domain,
  author = {Andrea Maracani and Vito Paolo Pastore and Lorenzo Natale and Lorenzo Rosasco and Francesca Odone},
  title = {{In-domain versus out-of-domain transfer learning in plankton image classification}},
  booktitle = {Scientific},
  year = {2023},
  doi = {10.1038/s41598-023-37627-7},
}
Figure