WHOI-Plankton Dataset

whoi_small_plankton_dataset(
  split = "val",
  transform = NULL,
  target_transform = NULL,
  download = FALSE
)

whoi_plankton_dataset(
  split = "val",
  transform = NULL,
  target_transform = NULL,
  download = FALSE
)

Arguments

split

One of "train", "val", or "test". Default is "val".

transform

Optional. A function that takes an image and returns a transformed version (e.g., normalization, cropping).

target_transform

Optional. A function that transforms the label.

download

Logical. If TRUE, downloads the dataset to root/. If the dataset is already present, download is skipped.

Value

A torch dataset with a

  • classes attribute providing the vector of class names.

Each element is a named list:

  • x: a H x W x 1 integer array representing an grayscale image.

  • y: the class id of the image.

Details

The WHOI-Plankton and WHOI-Plankton small are image classification datasets from the Woods Hole Oceanographic Institution (WHOI) of microscopic marine plankton. https://hdl.handle.net/10.1575/1912/7341 Images were collected in situ by automated submersible imaging-in-flow cytometry with an instrument called Imaging FlowCytobot (IFCB). They are small grayscale images of varying size. Images are classified into 100 classes, with an overview available in project Wiki page Dataset size is 957k and 58k respectively, and each provides a train / val / test split.

Examples

if (FALSE) { # \dontrun{
# Load the small plankton dataset and turn images into tensor images
plankton <- whoi_small_plankton_dataset(download = TRUE, transform = transform_to_tensor)

# Access the first item
first_item <- plankton[1]
first_item$x  # a tensor grayscale image with shape {1, H, W}
first_item$y  # id of the plankton class.
plankton$classes[first_item$y] # name of the plankton class

# Load the full plankton dataset
plankton <- whoi_plankton_dataset(download = TRUE)

# Access the first item
first_item <- plankton[1]
first_item$x  # grayscale image array with shape {H, W}
first_item$y  # id of the plankton class.
} # }