Skip to content

Graded Quiz: Checklist: Data Loading and Augmentation Using Keras :AI Capstone Project with Deep Learning (IBM AI Engineering Professional Certificate) Answers 2025

  1. Question 1 — Did you create the all_image_paths list with correct labels for each class?
    ✅ Yes
    ❌ No

Explanation: The all_image_paths list must pair each image path with its correct class label so the model receives accurate (image, label) pairs during training — otherwise labels and data would be misaligned.


  1. Question 2 — Did the custom data generator function include a while True: loop with shuffling at each epoch?
    ✅ Yes
    ❌ No

Explanation: A while True: loop makes the generator infinite (compatible with Keras .fit) and shuffling each epoch prevents learning order bias and improves generalization.


  1. Question 3 — Did the generator function yield batches of the correct shape and data type?
    ✅ Yes
    ❌ No

Explanation: Batches must match the model’s expected input shape (e.g., (batch_size, height, width, channels)) and appropriate dtype (usually float32) to avoid runtime errors during training.


  1. Question 4 — Did you test the custom generator by calling next(generator) and visualizing a batch?
    ✅ Yes
    ❌ No

Explanation: Calling next(generator) and visualizing is a quick sanity check to confirm images, labels, shapes, and augmentations are applied correctly before long training runs.


  1. Question 5 — Did the code define image augmentation steps within the map function for the tf.data.Dataset pipeline?
    ✅ Yes
    ❌ No

Explanation: Placing augmentation in the .map() keeps augmentations in the data pipeline (on-the-fly, efficient), increasing sample diversity and reducing overfitting.


  1. Question 6 — Did you create training and validation datasets using image_dataset_from_directory with correct parameters (batch size 8, image size 64×64)?
    ✅ Yes
    ❌ No

Explanation: Using image_dataset_from_directory with batch_size=8 and image_size=(64,64) ensures consistent preprocessing and optimized pipeline performance.


  1. Question 7 — Did the code specify a subset argument and validation_split when creating the validation dataset?
    ✅ Yes
    ❌ No

Explanation: validation_split together with subset='training'/'validation' ensures reproducible partitioning between training and validation sets without manual splitting.


  1. Question 8 — Did you inspect a batch from the tf.data.Dataset using .take(1)?
    ✅ Yes
    ❌ No

Explanation: .take(1) allows you to fetch and inspect a single batch from the dataset pipeline to verify tensor shapes and preprocessing before training.


  1. Question 9 — Did you complete all the tasks and questions in the lab and then download and save the JupyterLab notebook on your computer?
    ✅ Yes
    ❌ No

Explanation: Downloading the completed notebook is required for submission and preserves your work for evaluation and future reference.


🧾 Summary Table

Q # Correct Answer Key concept
1 ✅ Yes Correct pairing of image paths & labels
2 ✅ Yes Infinite generator + epoch shuffling
3 ✅ Yes Batch shape & dtype compatibility
4 ✅ Yes Sanity-check batches via next()
5 ✅ Yes On-the-fly augmentation in .map()
6 ✅ Yes Use image_dataset_from_directory with correct params
7 ✅ Yes Use validation_split + subset for partitioning
8 ✅ Yes Inspect dataset with .take(1)
9 ✅ Yes Download notebook for submission