0

How can I perform data augmentation when I use ROI-Pooling in a CNN network which I developed using MXnet ?

For example suppose I have a resnet50 architecture which uses a roi-pooling layer and I want to use random-crops data augmentation in the ImageRecord Iterator.

Is there an automatic way that data coordinates in the rois passed to the roi pooling layer, transform so as to be applied in images generated by the data-augmentation process of the ImageRecord Iterator ?

obelix
  • 880
  • 2
  • 16
  • 43

1 Answers1

1

You should be able to repurpose the ImageDetRecordIter for this. It is intended for use with Object Detection data containing bounding boxes, but you could define the bounding boxes as your ROIs. And now when you apply augmentation operations (such as flip and rotation), the coordinates of the bounding boxes will be adjusted in-line with the images.

Otherwise you can easily write your own transform function using Gluon, and can make use of any OpenCV augmentation to apply to both your image and ROIs. Just write a function that takes data and label, and returns the augmented data and label.

Thom Lane
  • 993
  • 9
  • 9