Skip to main content
QUICK REVIEW

[Paper Review] DeepAL: Deep Active Learning in Python

Kuan-Hao Huang|arXiv (Cornell University)|Nov 30, 2021
Machine Learning and AlgorithmsComputer Science11 references9 citations
TL;DR

DeepAL is a PyTorch-based Python library that provides a unified, extensible framework for deep active learning, enabling users to easily implement and experiment with diverse query strategies—such as uncertainty sampling, BALD, core-set selection, and adversarial margin—on custom datasets with minimal code changes. The key contribution is a modular, open-source tool designed specifically for deep learning applications in active learning.

ABSTRACT

We present DeepAL, a Python library that implements several common strategies for active learning, with a particular emphasis on deep active learning. DeepAL provides a simple and unified framework based on PyTorch that allows users to easily load custom datasets, build custom data handlers, and design custom strategies without much modification of codes. DeepAL is open-source on Github and welcome any contribution.

Motivation & Objective

  • To address the lack of modern, deep learning–native active learning libraries by providing a framework tailored for deep neural networks.
  • To enable researchers and practitioners to easily implement and compare various active learning query strategies within a unified PyTorch-based interface.
  • To support extensibility for custom datasets, data handlers, and novel query strategies with minimal code modification.
  • To bridge the gap between traditional active learning libraries and current deep learning practices by natively supporting PyTorch models and training pipelines.

Proposed method

  • The library is structured around three core components: Data (manages labeled, unlabeled, and test sets), Net (defines the neural network architecture and training parameters), and Strategy (implements query selection logic).
  • The Data class maintains labeled and unlabeled pools using PyTorch tensors and uses a handler object to preprocess data into tensor format via __getitem__ and __len__ methods.
  • The Net class encapsulates the model architecture (inheriting torch.nn.Module), training hyperparameters, and methods for prediction, probability output, and embedding extraction.
  • The Strategy class implements query strategies such as random sampling, least confidence, margin sampling, entropy sampling, dropout-based uncertainty, BALD, core-set selection, and adversarial margin using FGSM and DeepFool perturbations.
  • The training loop integrates model retraining after each query step, with the strategy updating the labeled pool and retraining the classifier iteratively.
  • The framework supports plug-and-play integration of new datasets, models, and query strategies through clear interface contracts and inheritance patterns.

Experimental results

Research questions

  • RQ1How can a unified, extensible framework be designed to support diverse deep active learning query strategies within a PyTorch ecosystem?
  • RQ2To what extent can a modular library reduce the implementation overhead for researchers developing new active learning strategies on deep neural networks?
  • RQ3Can a single library effectively support both standard uncertainty-based strategies and advanced methods like BALD and adversarial margin with minimal code changes?
  • RQ4How does the modularity of DeepAL facilitate integration with custom datasets and novel model architectures in active learning workflows?

Key findings

  • DeepAL provides a fully modular and extensible framework for deep active learning, enabling users to plug in custom datasets, data handlers, and query strategies with minimal code changes.
  • The library natively supports a comprehensive set of query strategies, including uncertainty sampling (least confidence, margin, entropy), dropout-based uncertainty estimation, BALD, core-set selection, and adversarial margin methods.
  • DeepAL integrates seamlessly with PyTorch, allowing users to define models via torch.nn.Module and manage training and inference through standardized methods like predict, predict_prob, and get_embeddings.
  • The framework enables iterative active learning through a clean loop: query → update labeled pool → retrain classifier, abstracting away low-level data management.
  • The library is open-source and hosted on GitHub, with a design that encourages community contributions and extension for both research and practical applications.
  • The implementation supports advanced techniques such as adversarial perturbations via the basic iterative method and DeepFool, enabling robust uncertainty estimation in deep models.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.