Train and Deploy a CIFAR‑10 Image Classification Model with UAI Platform
This tutorial walks university students through the complete workflow of using the CIFAR‑10 dataset to train a convolutional neural network for image classification and then deploying the model as an online inference service on the UAI‑Train and UAI‑Inference platforms.
Course Overview
“U创营” is a cloud‑computing popular‑science series designed for university students, offering video lectures, illustrated explanations, and hands‑on labs to bridge the gap between theory and practice.
Lecture 8 – Artificial Intelligence
The eighth lecture focuses on a hot AI topic: using the CIFAR‑10 dataset to train a deep‑learning model for image classification and to demonstrate the full process of turning the trained model into an online service.
Dataset Introduction
CIFAR‑10 consists of 60,000 32×32 RGB images divided into 10 categories. The training goal is to enable a computer to automatically recognize the category of a given image.
Model Architecture
The model comprises convolutional layers, pooling layers, fully connected layers, and a softmax output. Convolutional layers extract image features, pooling layers reduce computational complexity, and fully connected layers act as the classifier.
Model Training on UAI‑Train
Training is performed on the UAI‑Train platform following these steps:
Prepare the environment: Linux or Linux‑like OS, install Docker, UFile SDK, and UCloud AI SDK.
Prepare code and data (see PPT slides for details).
Package the code into a Docker image using a Dockerfile.
Upload the Docker image and training data to UFile.
Configure training parameters, set input/output paths, and submit the training job.
After completion, the trained model checkpoint is automatically saved to the specified output path.
Model Inference Service Deployment on UAI‑Inference
Once training finishes, the model can be deployed for online inference:
Prepare the same environment as in the training stage.
Locate the checkpoint file in the output directory and prepare the inference service code.
Package the inference code and model into a Docker image.
Test the image locally and on UAI‑Inference, then obtain a service URL.
Example inference URL: http://9blce4d1-get30t2.uae.service.ucloud.cn/service. Submitting the image bird.jpeg returns the label “bird”, confirming successful classification.
Conclusion
The lesson completes a simple image‑classification workflow from dataset preparation to model training and online deployment. Detailed code and step‑by‑step instructions are available in the accompanying PPT and video tutorials.
UCloud Tech
UCloud is a leading neutral cloud provider in China, developing its own IaaS, PaaS, AI service platform, and big data exchange platform, and delivering comprehensive industry solutions for public, private, hybrid, and dedicated clouds.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
