Figure 1. Detectron2 by Meta
Detectron2 was built by Facebook AI Research (FAIR) to support rapid implementation and evaluation of novel computer vision research. Facebook introduced Detectron2 as a complete rewrite of Detectron (which was implemented in Caffe). Initially developed to cater to the research requirements of Facebook AI within FAIR, Detectron2 has garnered widespread adoption within the developer community and is now accessible to public teams. Its versatility and effectiveness have led to its popularity, positioning it as one of the most sought-after toolsets for object recognition tasks.
Facebook also uses Detectron2 in a wide array of their products, including Portal, and notes the framework accelerates the feedback loop between research and production.
Figure 2 . Facebook uses Detectron2 in their Portal Product
Detectron2 includes all the models that were available in the original Detectron, such as Faster R-CNN, Mask R-CNN, RetinaNet, and DensePose as well as some newer models including Cascade R-CNN, Panoptic FPN, and TensorMask. You can use Detectron2 to do key point detection, object detection, and semantic segmentation. Detectron2 registers datasets in COCO JSON format.
What Makes Detectron2 Stand Out?
Bringing Models to Production
Detectron2 now contains an extra layer called Detectron2go. This makes it easier to bring state-of-the-art models to production through features including model conversions for the cloud and mobile devices, network quantization, and standard training workflows.
Machine Learning Framework Transition
The original detection was implemented in Caffe2, but Detectron2 has shifted to PyTorch, offering developers a more intuitive approach to testing and modifying the model.
Pre-Trained Models
Equipped with models like Faster R-CNN and Mask R-CNN, Detectron2 is ready to be fine-tuned for various datasets, making it highly adaptable for different applications.
Modular Design
Detectron2’s modular structure allows users to easily tweak and expand various components, making customization a breeze. Whether it’s the backbone, neck, or head of the model, flexibility is the name of the game.
Enhanced Training Speed
The entire training pipeline of Detectron2 has been moved to GPUs, resulting in significantly improved speed and efficiency.
Structure of Detectron2 Architecture
The three main structures to point out in the Detectron2 architecture are as follows:
Backbone Network
Extracts feature maps from the input image at different scales. Base-RCNN-FPN’s output features are called P2 (1/4 scale), P3 (1/8), P4 (1/16), P5 (1/32) and P6 (1/64). Note that non-FPN (‘C4’) architecture’s output feature is only from the 1/16 scale.
Region Proposal Network
Detects object regions from multi-scale features. 1000 box proposals (by default) with confidence scores are obtained.
Box Head
Crops and warps feature maps using proposal boxes into multiple fixed-size features and obtain fine-tuned box locations and classification results via fully connected layers. Finally, 100 boxes (by default) in maximum are filtered out using non-maximum suppression (NMS). The box head is one of the sub-classes of ROI Heads. For example, Mask R-CNN has more ROI heads such as a mask head.
Figure 3. Detailed Architecture of Base-RCNN-FPN
Applications of Detectron2
Healthcare
Within the medical field, Detectron2 serves as a valuable resource for identifying abnormalities or specific organs within images, supporting critical diagnostic tasks.
Agriculture and Farming
Detectron2 plays a crucial role in agricultural settings by facilitating tasks such as identifying and monitoring crop health, detecting plant diseases, and analyzing farming practices. Moreover, it can be utilized for livestock counting and pest detection.
Robotics
In robotics applications, especially those where real-time responses are not required, Detectron2 proves beneficial for object detection tasks, enabling robots to identify and interact with objects across diverse environments.
Safety Fields
In safety fields, Detectron2 results can help to prevent emergencies, for example, in forest fire monitoring, or flood research. Then, generally, there are a lot of maritime industry applications, and biology research applications, too. Object detection technology helps researchers to observe natural systems and measure goals and objectives.
References :
[1] [2] Yuxin Wu, Alexander Kirillov, Francisco Massa, Wan-Yen Lo and Ross Girshick, Detectron2. https://github.com/facebookresearch/detectron2, 2019.
[3] T.-Y. Lin, P. Dollar, R. Girshick, K. He, B. Hariharan, and S. Belongie. Feature pyramid networks for object detection. In CVPR, 2017.