Skip to content

Case study for applying a Copy-and-Paste Augmentation for object detection and instance segmentation in zoologic collection boxes

Notifications You must be signed in to change notification settings

sRassmann/copy-and-paste-augmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copy-and-Paste Augmentation for Insect Detection

This repository is a case study and proof-of-concept for leveraging Copy-and-Paste Augmentation (CPA) to perform object detection and instance segmentation on insect collection boxes (e.g. integrated into Inselect). It was a university project of the Lab "Intelligent Vision Systems" during the summer term 2021 at the University of Bonn.

Basic principle

Instances are obtained from annotated full-sized or pre-cropped images that are recombined in front of a realistic background (in this case different empty collection boxes).

Fully random instance placements (R-CPA, left) and a placement pattern imitating real collection boxes (CB-CPA, right) were implemented.

R-CPA CB-CPA

The project was build on FAIR's dectron2 and used the TensorMask sliding-window instance segmentation model.

Data

The original data set only consisted of 3 unlabeled images of collection boxes containing bugs. As manual labeling turned out to be unfeasibly labor-intensive, the public dataset of Hansen et al., 2019 containing > 60,000 cropped bug images distributed between a variety of species was used. This data could be annotated using a rather simple intensity-based thresholding pipeline and a train-test iteration of TensorMask (rather an overkill, but the code was already there...). The created annotations are available here. These instances were used for training, whereas the partially annotated collection-box images were used for validation.

Results

quantitative results

The validation accuracies obtained using differnt CPA and training settings on the annotated crops (crop) and iamges imitating full-sized collection-box images (stitch) from the 3 validation images are as follows:

settingCB-CAP probR-CAP probLRBN momemtumpoolsizeadditional modificationsegm. AP cropbbox AP cropsegm. AP stitchbbox AP stitch
base0.50.50.0010.91556.770.527.136.3
lower LR0.50.50.00020.9915reduced LR (0.0002) and increased BN momentum (0.99)60.569.428.234.6
R-CAP only010.0010.93056.767.227.634.6
CB-CPA only100.0010.93055.668.727.337
alpha blending0.50.50.0010.915alpha blending added to CB-CPA58.370.927.336.5
scale augm.0.50.50.0010.915scale CB- and R-CPA instances by a factor drawn from [0.85, 1.175] and   [0.6, 1.66], respectively58.570.227.236
small train set (1)0.50.50.0010.9357.569.227.536.2
small train set (2)0.50.50.0010.935-fold increased count of augmentations per instance58.469.927.436.2

For more detailed explanations and results see the report.

qualitative results

All obtained models generalized very well to the beetle data published alongside Inselect, however, no ground truth and quantitative scores of Inselect's current object detection methods are provided.

CB-CPA trained TensorMask model Inselect

About

Case study for applying a Copy-and-Paste Augmentation for object detection and instance segmentation in zoologic collection boxes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published