Generate Perturbed Datasets

When data collects are infeasible, NRTK can be used to extend existing datasets by applying perturbations to simulate key operational risks.

NRTK provides multiple interfaces to accomplish this task for object detection datasets, detailed below. Note that these interfaces require COCO-format annotations. However, the library call avoids this requirement as annotations are provided via MAITE protocols.

Command-line Interface

nrtk-perturber

Generate NRTK perturbed images and detections from a given set of source images and COCO-format annotations.

The perturbed images are stored in subfolders named after the chosen perturbation parameter keys and values.

param dataset_dir:

Root directory of dataset.

param output_dir:

Directory to write the perturbed images to.

param config_file:

Configuration file specifying the PerturbImageFactory configuration.

param generate_config_file:

File to write default config file, only written if specified.

param verbose:

Display progress messages. Default is false.

nrtk-perturber [OPTIONS] DATASET_DIR OUTPUT_DIR CONFIG_FILE

Options

-g, --generate-config-file <generate_config_file>

write default config to specified file

-v, --verbose

print progress messages

Arguments

DATASET_DIR

Required argument

OUTPUT_DIR

Required argument

CONFIG_FILE

Required argument

NRTK-as-a-Service (NRTKaaS)

See NRTKaaS documentation here.

Containerized (AUKUS Data)

See container documentation here.

Library Call for MAITE-compliant Data

nrtk_perturber generates augmented MAITE dataset(s) based on a perturber factory configuration.

nrtk.interop.maite.utils.nrtk_perturber.nrtk_perturber(maite_dataset: Dataset, perturber_factory: PerturbImageFactory) Iterable[tuple[str, Dataset]]

Generate augmented dataset(s) of type maite.protocols.object_detection.Dataset.

Generate augmented dataset(s) of type maite.protocols.object_detection.Dataset given an input dataset of the same type and a perturber factory implementation. Each perturber dcombination will result in a newly generated dataset.

Parameters:
  • maite_dataset – A dataset object of type maite.protocols.object_detection.Dataset

  • perturber_factory – PerturbImageFactory implementation.