Skip to content

Self-supervised Active Learning

Compare
Choose a tag to compare
@philippmwirth philippmwirth released this 11 Mar 12:18
· 949 commits to master since this release
34cdbfd

Lightly gets support for Active-Learning

We're excited to offer our new active-learning functionality! Use the strong representations learned in a self-supervised fashion together with model predictions to further improve the data selection process.

This release introduces breaking changes with respect to the API calls.

Active-Learning

The self-supervised representations together with the model predictions provide a great basis for deciding which samples should be annotated and which ones are redundant.

This release brings a completely new interface with which you can add active-learning to your ML project with just a few lines of code.:

  • ApiWorkflowClient: lightly.api.api_workflow_client.ApiWorkflowClient
    The ApiWorkflowClient is used to connect to our API. The API handles the selection of the images based on embeddings and active- learning scores. To initialize the ApiWorkflowClient, you will need the datasetId and the token from the Lightly Platform.
  • ActiveLearningAgent: lightly.active_learning.agents.agent.ActiveLearningAgent
    The ActiveLearningAgent builds the client interface of our active-learning framework. It helps with indicating which images are preselected and which ones to sample from. Furthermore, one can query it to get a new batch of images. To initialize an ActiveLearningAgent you need an ApiWorkflowClient.
  • SamplerConfig: lightly.active_learning.config.sampler_config.SamplerConfig
    The SamplerConfig allows the configuration of a sampling request. In particular, you can set the number of samples, the name of the resulting selection, and the SamplingMethod. Currently, you can set the SamplingMethod to one of the following:
    • Random: Selects samples uniformly at random.
    • Coreset: Selects samples that are diverse.
    • Coral: Combines Coreset with scores to do active-learning.
  • Scorer: lightly.active_learning.scorers.scorer.Scorer
    The Scorer takes as input the predictions of a pre-trained model on the set of unlabeled images. It evaluates different scores based on how certain the model is about the images and passes them to the API so the sampler can use them with Coral.

Check out our documentation to learn more!

API (breaking)

With the refactoring of our API, we are switching to using a generated Python client. This leads to clearer and unified endpoints, fewer errors, and better error messages. Unfortunately, this means that previous versions of the package are no longer compatible with our new API.
Note that this only affects all API calls. Using the package for self-supervised learning is unaffected.

Models