Vertex AI Pipeline Components for Image Preprocessing

You are building a custom image classification model and plan to use Vertex AI Pipelines to implement the end-to-end training. Your dataset consists of images that need to be preprocessed before they can be used to train the model. The preprocessing steps include resizing the images, converting them to grayscale, and extracting features. You have already implemented some Python functions for the preprocessing tasks. Which components should you use in your pipeline?

  1. DataprocSparkBatchOp and CustomTrainingJobOp
  2. DataflowPythonJobOp, WaitGcpResourcesOp, and CustomTrainingJobOp Source Reference Answer
  3. dsl.ParallelFor, dsl.component, and CustomTrainingJobOp
  4. ImageDatasetImportDataOp, dsl.component, and AutoMLImageTrainingJobRunOp

Community Votes

B
100%

100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

This question tests the selection of scalable data processing components within Vertex AI Pipelines, specifically distinguishing between Dataflow for heavy preprocessing and standard custom components.

For scalable image preprocessing in Vertex AI Pipelines, use DataflowPythonJobOp alongside CustomTrainingJobOp. This approach leverages managed serverless data processing to prepare images before custom model training.

Selecting Option C (dsl.component) is a common mistake because, while flexible, it lacks the built-in scalability and efficiency of Dataflow for processing large volumes of image data.

Community Discussion (5 comments)

guilhermebutzke 👍 5 Selected: B
My Answer: B Looking for the options, DataflowPythonJobOp can be used for parallelizing the preprocessing tasks, which is suitable for image resizing, converting to grayscale, and extracting features. dsl.ParallelFor could be useful for parallelizing tasks but might not be the most straightforward option for image preprocessing. Generally DataflowPythonJobOp is followed by WaitGcpResourcesOp. https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/fe7d3e4b8edc137d90ec061789b879b7cc8d3854/notebooks/community/ml_ops/stage3/get_started_with_dataflow_flex_template_component.ipynb
Dirtie_Sinkie 👍 2 Selected: B
B is definitely right, no doubt
pinimichele01 👍 1 Selected: B
https://cloud.google.com/vertex-ai/docs/pipelines/dataflow-component#dataflowpythonjobop
b1a8fae 👍 2 Selected: B
I go with B. Custom training is surely required. Discarding A because Spark is not mentioned anywhere in the problem description. C involves Kubeflow which seems a bit overkill imo. DataflowPythonJobOp operator lets you create a Vertex AI Pipelines component that prepares data -> seems like the appropriate course of action to me. https://cloud.google.com/vertex-ai/docs/pipelines/dataflow-component#dataflowpythonjobop
pikachu007 👍 1 Selected: B
A. DataprocSparkBatchOp: While capable of data processing, it's less well-suited for image-specific tasks like resizing and grayscale conversion compared to DataflowPythonJobOp. C. dsl.ParallelFor, dsl.component: While offering flexibility, they require more manual orchestration and potentially less efficient for image preprocessing compared to DataflowPythonJobOp. D. ImageDatasetImportDataOp, AutoMLImageTrainingJobRunOp: These components are designed for AutoML Image training, not directly compatible with custom preprocessing and training tasks.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Option B is correct because DataflowPythonJobOp is designed to execute Apache Beam pipelines for scalable data transformation tasks like resizing and grayscale conversion. Since the requirement is a custom model, CustomTrainingJobOp is the necessary component for the training phase. Additionally, WaitGcpResourcesOp is required to pause the pipeline until the asynchronous Dataflow preprocessing job finishes before training begins.

Why the Other Options Are Wrong

Option A is incorrect because Dataproc is typically used for big data analytics with Spark/ Hadoop and is less integrated for standard Python preprocessing tasks than Dataflow. Option C is incorrect because dsl.component runs on the GKE cluster and may not efficiently handle large-scale image processing compared to Dataflow. Option D is incorrect because the question specifies a "custom image classification model," which rules out AutoML-specific components like AutoMLImageTrainingJobRunOp.

Community Comment Notes

The community unanimously supports Option B, emphasizing that Dataflow is the standard for parallelizing preprocessing tasks effectively. Users noted that DataflowPythonJobOp is the most direct method to implement data preparation within a pipeline, whereas generic Kubeflow components are considered overkill or less efficient. Several comments cited official Google Cloud documentation to confirm the usage of the Dataflow component for these specific scenarios.

Official Reference

Exam Strategy

Identify keywords like "preprocessing," "resizing," or "feature extraction" in pipeline questions to signal the need for DataflowPythonJobOp. Always pair this with a wait operator if the job runs asynchronously to ensure the pipeline executes steps in the correct order.

Related Analysis

Practice All PMLE Questions

Access 65 questions with complete answers and detailed explanations.

View Full PMLE Practice Test →

← Back to PMLE Study Guide