On this page
Facebook AI Research (FAIR), now part of Meta, has released many open-source machine learning libraries. The best known is PyTorch, and the others cover computer vision, privacy, forecasting, optimization, text classification and C++ research. This article describes each one as it stood in 2021.
Key takeaways
- PyTorch is the core framework, and many other Facebook libraries are built on top of it.
- Detectron2, PyTorch3D and Classy Vision cover computer vision tasks such as detection, 3D data and image classification.
- Opacus adds differential privacy to PyTorch training, and BoTorch supports Bayesian optimization.
- Prophet forecasts time series data, and fastText handles text classification and representation learning.
- Open-source release lets researchers worldwide use and extend these tools.
Why do companies open-source machine learning libraries?
Large technology companies such as Google, Microsoft and Facebook publish machine learning and deep learning tools that give AI researchers worldwide a common foundation. Open-source libraries on GitHub help developers build flexible and scalable models for uses ranging from self-driving cars and weather forecasting to recommendation systems and chatbots.
Well-known deep learning frameworks include Google’s TensorFlow and Facebook’s PyTorch and Caffe2. FAIR has also released a range of specialized libraries, summarized below.
Which machine learning libraries did Facebook open-source?
| Library | Purpose |
|---|---|
| PyTorch | Deep learning framework |
| Flashlight | Machine learning research in C++ |
| Opacus | Training PyTorch models with differential privacy |
| PyTorch3D | 3D computer vision research |
| Detectron2 | Object detection and segmentation |
| Detectron | Earlier object detection software built on Caffe2 |
| Prophet | Time series forecasting |
| Classy Vision | Image and video classification at scale |
| BoTorch | Bayesian optimization |
| fastText | Text classification and representation learning |
| Tensor Comprehensions | High-performance machine learning kernels in C++ |
PyTorch
PyTorch is a widely used deep learning framework. Facebook developed both PyTorch and Caffe2 (Convolutional Architecture for Fast Feature Embedding), but models defined in the two frameworks were generally not compatible with each other.
To address this, Facebook and Microsoft launched the Open Neural Network Exchange (ONNX) project in September 2017 for converting models between frameworks. Caffe2 was merged into PyTorch at the end of March 2018.
PyTorch is Python-first and provides NumPy-like tensor computation with strong GPU acceleration. It also offers TorchScript, which makes it easy to move between eager mode and graph mode.
Flashlight
Flashlight is an open-source library for building machine learning applications with a C++ API. Because it supports research directly in C++, it does not need external bindings to handle tasks such as threading, memory mapping or working with low-level hardware. That keeps code integration quick and direct.
Opacus
Opacus is an open-source library for training PyTorch models with differential privacy (DP). It is designed to require few code changes and to have little effect on training performance.
It lets researchers track the privacy budget that has been spent at any point during training. Its lightweight API centers on the PrivacyEngine abstraction, which tracks the privacy budget and works on the model’s gradients. It attaches to a standard PyTorch optimizer, so you do not need to call it directly for it to work.
PyTorch3D
PyTorch3D is a modular, optimized library with reusable components for 3D computer vision research with PyTorch. It is meant to integrate with deep learning methods for predicting and manipulating 3D data. It is implemented with PyTorch tensors, handles small batches of heterogeneous data and can use GPUs for acceleration.
Detectron2
Detectron2 is a library that provides detection and segmentation algorithms. It combines Detectron and the maskrcnn-benchmark project, and it supports a number of computer vision research projects and applications. Its supported algorithms include Mask R-CNN, RetinaNet, Faster R-CNN, RPN and TensorMask.
Detectron
Detectron is open-source software that implements object detection algorithms such as Mask R-CNN. It is written in Python, and its deep learning framework is Caffe2. It supported a number of research projects at Facebook, including feature pyramid networks, Mask R-CNN, non-local neural networks, focal loss for dense object detection and DensePose.
Prophet
Prophet is an open-source tool from Facebook’s Core Data Science team for forecasting time series data. It uses an additive model in which non-linear trends are fitted together with yearly, weekly and daily seasonality, plus holiday effects.
It works best with time series that have several seasons of historical data, such as weather records, economic indicators or patient health measurements. The code is available on CRAN and PyPI.
Classy Vision
Classy Vision is an end-to-end, PyTorch-based framework for large-scale training of image and video classification models. Facebook described it as flexible for researchers. Many computer vision libraries lead to duplicated effort and force users to move research between systems and relearn distributed training and data loading, and Classy Vision aims to offer one solution for training at scale and deploying to production.
BoTorch
BoTorch provides a modular and easily extensible interface for building Bayesian optimization components such as probabilistic models, acquisition functions and optimizers. It also integrates with deep and convolutional architectures in PyTorch.
fastText
fastText is an open-source library for efficient text classification and representation learning. It runs on standard, generic hardware, and its models can be compressed to run on mobile devices.
Tensor Comprehensions
Tensor Comprehensions is a C++ library that generates high-performance machine learning kernels using Halide, ISL, NVRTC or LLVM. It can be integrated with Caffe2 and PyTorch and is designed to be extensible and independent of any single machine learning framework. It requires a basic tensor library that handles memory allocation, offloading and synchronization.
Frequently asked questions
What is the most important machine learning library from Facebook?
PyTorch is the most widely used. Many of the other libraries, including Opacus, PyTorch3D, Classy Vision and BoTorch, are built on it.
What happened to Caffe2?
Caffe2 was merged into PyTorch at the end of March 2018. ONNX, launched with Microsoft in 2017, was created to convert models between frameworks.
Which Facebook library is used for forecasting?
Prophet, which fits an additive model with yearly, weekly and daily seasonality and holiday effects to time series data.
What is the difference between Detectron and Detectron2?
Detectron is the earlier software built on Caffe2. Detectron2 is the newer, PyTorch-based library that combines Detectron with the maskrcnn-benchmark project.
Conclusion
Facebook’s open-source machine learning portfolio spans general frameworks, computer vision, privacy, forecasting and optimization. PyTorch sits at the center, and most of the specialized libraries extend it. Check each project’s repository for its current status, since this overview reflects 2021.



