nerdexam
Amazon

MLS-C01 · Question #289

A social media company wants to develop a machine learning (ML) model to detect inappropriate or offensive content in images. The company has collected a large dataset of labeled images and plans to…

The correct answer is C. Compress the training and validation directories by using the gzip compression library. Upload the. To prepare images stored in classified folders with accompanying .lst files for SageMaker built-in image classification training using Pipe mode, compressing the image directories into gzipped files is a viable input method.

Data Engineering

Question

A social media company wants to develop a machine learning (ML) model to detect inappropriate or offensive content in images. The company has collected a large dataset of labeled images and plans to use the built-in Amazon SageMaker image classification algorithm to train the model. The company also intends to use SageMaker pipe mode to speed up the training. The company splits the dataset into training, validation, and testing datasets. The company stores the training and validation images in folders that are named Training and Validation, respectively. The folders contain subfolders that correspond to the names of the dataset classes. The company resizes the images to the same size and generates two input manifest files named training.lst and validation.lst, for the training dataset and the validation dataset, respectively. Finally, the company creates two separate Amazon S3 buckets for uploads of the training dataset and the validation dataset. Which additional data preparation steps should the company take before uploading the files to Amazon S3?

Options

  • AGenerate two Apache Parquet files, training.parquet and validation.parquet, by reading the
  • BCompress the training and validation directories by using the Snappy compression library. Upload
  • CCompress the training and validation directories by using the gzip compression library. Upload the
  • DGenerate two RecordIO files, training.rec and validation.rec, from the manifest files by using the

How the community answered

(13 responses)
  • A
    15% (2)
  • B
    8% (1)
  • C
    77% (10)

Why each option

To prepare images stored in classified folders with accompanying .lst files for SageMaker built-in image classification training using Pipe mode, compressing the image directories into gzipped files is a viable input method.

AGenerate two Apache Parquet files, training.parquet and validation.parquet, by reading the

Apache Parquet is a columnar storage format primarily for structured data and is not a suitable input format for image classification algorithms.

BCompress the training and validation directories by using the Snappy compression library. Upload

While Snappy is a compression library, the SageMaker built-in image classification algorithm specifically recognizes common archive formats like `.tar.gz` or `.zip` for bundled image inputs, not just generically compressed directories.

CCompress the training and validation directories by using the gzip compression library. Upload theCorrect

The SageMaker built-in image classification algorithm can consume input data in image format, where images are stored in S3, often within compressed archives like gzipped tarballs, and referenced by an accompanying .lst file. Compressing directories into gzip format and uploading them to S3 can be used as an input for SageMaker training, allowing the algorithm to access the data.

DGenerate two RecordIO files, training.rec and validation.rec, from the manifest files by using the

Generating RecordIO files is the most performant and explicitly recommended method for SageMaker built-in image classification with Pipe mode, but it requires an additional conversion step using tools like `im2rec`, which might not be considered the most direct preparation step compared to simply archiving existing directories.

Concept tested: SageMaker built-in image classification input data formats

Source: https://docs.aws.amazon.com/sagemaker/latest/dg/image-classification-input-output.html

Topics

#Data Preparation#SageMaker Built-in Algorithms#SageMaker Pipe Mode#Image Classification

Community Discussion

No community discussion yet for this question.

Full MLS-C01 Practice