MMPretrain classifies images from your tags

MMPretrain is OpenMMLab's toolbox for image classification and the successor of MMClassification. In Supervisely you train classifiers from the tags on your images: choose the tags to predict, the split and an ImageNet-pretrained architecture, and the served model tags new images or objects.

Poster of the Train MMPretrain app: a training dashboard for image classification
Publisher
OpenMMLab
Labels
  • Image tags; object tags in the older app
Apps
Train, Serve, Apply

Apps in the Supervisely Ecosystem

Every model in Supervisely comes as a Supervisely App: a module from the Ecosystem that plugs into the platform and runs on your own GPU, with no code to install. A Serve App puts the model behind the labeling tools, and where the model can be trained, a Train App fits it to your labeled project. All Apps work on the same projects, so you add a model, update it or swap it for another without changing anything else.

Classes come from tags

An image classification model answers "what is in this image" with a label, not with a shape. In Supervisely that label is a tag. The training app runs on a project of tagged images, previews every tag with example images, and lets you pick the tags the model will learn to predict. The tagging guide on the blog covers how to set tags up and apply them quickly.

Before training starts, the app checks the data for consistency and shows a report, which is where missing or rare tags show up. A tag with a handful of images is a class imbalance problem to fix before you spend GPU time.

Train MMClassification V2 (MMPretrain), step by step

  1. Connect a GPU computer as an agent, then run the app from the context menu of the tagged project.
  2. Split the images randomly, by tags such as train and val, or by datasets.
  3. Select the training tags.
  4. Read the data validation report.
  5. Choose augmentations, applied on the fly: a predefined pipeline, or your own exported from the ImgAug Studio app as a JSON file in Team Files.
  6. Pick the architecture and its initial weights: pretrained on ImageNet, or your own file from Team Files.
  7. Set the hyperparameters and press Generate. The app writes the MMPretrain Python configs, which advanced users can edit.
  8. Start training. Weights, metrics and visualizations go to /mmclassification-v2/<task id>_<project name>/ in Team Files.

The model list includes the ResNet, ResNeXt, SE-ResNet, MobileNet V2 and V3, ShuffleNet, EfficientNetV2, ConvNeXt and ConvNeXtV2, DeiT3 and MViT families in several sizes.

Tagging new data with the classifier

Right-click a .pth checkpoint in Team Files and run Serve MMClassification V2 (MMPretrain) on it, on a GPU or a CPU. Then use it from other apps:

The config files and .pth weights from Team Files also load in MMPretrain directly, without Supervisely.

Train MMClassification (v1)

The first-generation Train MMClassification app is still in the catalog and has two modes the V2 README does not describe. Multi-label mode trains a model that predicts every tag scoring above 0.5 for an image. Object mode trains on crops of tagged objects, so you no longer prepare a separate project of crops first. Its models are served with Serve MMClassification. For detection or masks instead of tags, see YOLO or MMDetection.

Frequently asked questions.

What is the difference between MMPretrain and MMClassification?

MMPretrain is the successor of MMClassification. In Supervisely the current apps are Train and Serve MMClassification V2 (MMPretrain); the first-generation Train MMClassification app stays in the catalog with its multi-label and object modes.

Where do the classes of an MMPretrain model come from?

From tags. The training app runs on a project of tagged images, previews every tag with example images and lets you pick the tags the model will learn to predict.

Can I use the trained classifier outside Supervisely?

Yes. The config files and `.pth` weights saved in Team Files load in MMPretrain directly, without Supervisely.

Train and serve models on your own data.

Label a project in a free account, train a model on it from the browser and deploy it on your own GPU. Or book a demo to run Supervisely on your servers.