Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • AI
    • Cloud
Google Cloud Platform icon
Labs

Creating an MXNet Image Classifier in Amazon SageMaker

Apache MXNet is an open-source machine learning framework focusing on deep learning with neural networks. In this lab, you will use MXNet to create a neural network that performs a basic image classification task: deciding which LEGO brick is in an image to help you sort your giant pile of blocks. MXNet supports many programming languages, but we will use Python.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Advanced
Last updated
Sep 24, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Navigate to the Jupyter Notebook

    Log in to the AWS console and navigate to the AWS SageMaker page. From there, load the Jupyter Notebook that has been provided with this hands-on lab.

    When prompted, select the conda_python3 kernel. In the notebook, the code line of %pip install mxnet installs the needed mxnet package.

  2. Challenge

    Load and Prepare the Data
    1. Load the training images and labels into an NDArray using Pickle. The images and labels are provided in the lego-simple-mx-train file.
    2. Load the testing images and labels into an NDArray using Pickle. The images and labels are provided in the lego-simple-mx-test file.
    3. Add in the human-readable class names for the labels.
    4. Convert the training and testing NDArrays to MXNet Tensors. For better results, normalize the data using the mean of 0.13 and standard deviation of 0.31, which have been precomputed for this dataset.
    5. Visualize the first few images from the training data set to better understand the data.
  3. Challenge

    Train the MXNet Model
    1. Create a neural network model using Gluon.
      • Remember to check your input shape and adjust if necessary.
      • You can get decent performance from a single hidden layer, but feel free to experiment with different model architectures.
      • You should have as many output nodes as labels you are trying to predict. Remember to pick an activation function that will output categorical probabilities.
    2. Keep track of accuracy during your training process.
    3. Choose a loss function appropriate for classification tasks.
    4. Train the model using the training data and training labels. You won't need to train for many epochs. Save the history of the training process.
  4. Challenge

    Evaluate the Model
    1. Calculate the accuracy of the model on the testing data.
    2. View the raw output of a model prediction for an image in the test set.
    3. Determine the label that the model predicted for the image and compare that to the actual label.
  5. Challenge

    Make a Batch Prediction
    1. Predict the labels for all of the testing data.
    2. Compare the predictions against the actual labels.
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight