MMDetection Object Detection Toolbox
repository·main·Indexed 12 days ago
https://github.com/open-mmlab/mmdetectionA comprehensive, modular object detection toolbox based on PyTorch and part of the OpenMMLab ecosystem. It supports various detection tasks, including instance and panoptic segmentation, and integrates tools like Albumentations for image augmentation and ATSS (Adaptive Training Sample Selection) for improved sample selection in anchor-based and anchor-free detectors.
What's inside MMDetection
- CrowdDet is a proposal-based object detector designed to handle highly-overlapped instances in crowded scenes. Unlike traditional frameworks where one proposal predicts a single instance, CrowdDet allows each proposal to predict a set of correlated instances. It utilizes techniques such as EMD Loss and Set NMS to improve detection performance in dense environments. It is robust enough to provide improvements even on less crowded datasets like COCO.
Overview of Sparse R-CNN
mainSparse R-CNN is an end-to-end object detection method that uses a fixed sparse set of learned object proposals instead of dense anchor boxes. This approach eliminates the need for hand-designed object candidates and many-to-one label assignment. A key advantage is that final predictions can be output directly without requiring Non-Maximum Suppression (NMS) post-processing. It is designed to be efficient, with performance comparable to established detector baselines on the COCO dataset.Overview of GN + WS (Group Normalization + Weight Standardization)
mainGN + WS is a configuration approach designed to improve deep network training, particularly for micro-batch training (where each GPU handles only 1-2 images). This is common in memory-constrained tasks like object detection and semantic segmentation where Batch Normalization (BN) is often ineffective.
Key components:
- Weight Standardization (WS): Standardizes weights in convolutional layers to smooth the loss landscape by reducing Lipschitz constants.
- Batch-Channel Normalization (BCN): Combines batch and channel normalizations to keep networks away from elimination singularities.
Using GN+WS with micro-batch training can match or outperform BN with large-batch training.
Overview of Deformable Convolutional Networks (DCN) in MMDetection
mainDeformable Convolutional Networks (DCN) enhance the geometric transformation modeling capacity of CNNs by augmenting spatial sampling locations with learnable offsets. MMDetection provides implementations for both deformable convolution and deformable RoI pooling. These modules can replace standard convolutional or pooling layers and are trained end-to-end via back-propagation.
Key features include:
- Deformable Convolution (
dconv): Augments sampling locations with offsets. In MMDetection configs,dconv(c3-c5)indicates the module is applied to ResNet stages 3 through 5. - Deformable RoI Pooling (
dpool): Enhances the pooling mechanism for Region of Interest tasks. - Efficiency: The DCN operations are optimized for better memory efficiency and speed compared to the original implementation.
- Deformable Convolution (
Overview of NAS-FPN models and configurations
mainNAS-FPN (Neural Architecture Search - Feature Pyramid Network) is a learned feature pyramid architecture that uses a combination of top-down and bottom-up connections to fuse features across scales. It is designed to improve the accuracy-latency tradeoff in object detection, particularly within the RetinaNet framework.
Available models in this directory include:
- R-50-FPN: A standard ResNet-50 backbone with a traditional FPN.
- R-50-NASFPN: A ResNet-50 backbone using the NAS-FPN architecture, which provides higher accuracy (40.5 AP vs 37.9 AP) at a similar inference speed.
Training Note: The NAS-FPN architecture can be unstable during training; there is a small possibility that results may be up to 3% mAP lower than expected.
Overview of SoftTeacher Semi-Supervised Object Detection
mainSoftTeacher is an end-to-end semi-supervised object detection framework. Unlike multi-stage methods, it uses an end-to-end training approach that gradually improves pseudo-label quality through a curriculum.
Key mechanisms include:
- Soft Teacher Mechanism: The classification loss for each unlabeled bounding box is weighted by the classification score produced by the teacher network.
- Box Jittering: A technique used to select reliable pseudo-boxes for learning box regression.
It is designed to perform well across various labeling ratios (e.g., 1%, 5%, 10%) and can significantly improve baseline detectors when leveraging large amounts of unlabeled data.
Overview of Grid R-CNN and Grid R-CNN Plus
mainGrid R-CNN is an object detection framework that replaces traditional box offset regression with a grid-guided localization mechanism. It captures spatial information explicitly using a multi-point supervision formulation and a two-stage information fusion strategy to fuse feature maps of neighboring grid points.
Grid R-CNN Plus is an optimized version designed to be faster and more accurate than the original. On the COCO dataset, the Res50-FPN based Grid R-CNN Plus detector achieves an mAP of 40.4%, providing a significant improvement over the baseline with similar inference times.
Overview of VarifocalNet (VFNet)
mainVarifocalNet (VFNet) is an IoU-aware dense object detector designed to improve candidate detection ranking. It achieves this by learning an IoU-aware Classification Score (IACS), which serves as a joint representation of object presence confidence and localization accuracy.
Key technical components include:
- Varifocal Loss (VFL): A loss function designed to train the detector to predict the IACS.
- Star-shaped bounding box feature representation: A method using features at nine sampling points to improve IACS prediction and bounding box refinement.
- Bounding box refinement branch: An additional branch to further improve object localization accuracy.
VFNet is built upon the FCOS+ATSS architecture.
Overview of VISION-Datasets
mainVISION Datasets is a benchmark for vision-based industrial inspection consisting of 14 diverse industrial datasets. It includes 18,000 images covering 44 defect types. Key features include:
- Versatility in defect detection with annotation masks across all splits.
- Support for instance-segmentation annotation for precise defect identification.
- Real-world production scenario mirroring.
The datasets are hosted on Hugging Face:
https://huggingface.co/datasets/VISION-Workshop/VISION-Datasets.Overview of SOLO instance segmentation models
mainSOLO (Segmenting Objects by Locations) is a single-shot instance segmentation framework that treats instance segmentation as a classification task based on object location and size. Instead of the traditional 'detect-then-segment' approach (like Mask R-CNN), SOLO assigns 'instance categories' to pixels, allowing for a simpler and more flexible framework.
Available variants in MMDetection include:
- SOLO: The original framework.
- Decoupled SOLO: An efficient variant that uses a decoupled head. It provides equivalent accuracy to the original SOLO but with a different head structure.
- Decoupled Light SOLO: A lightweight version using a decoupled structure, a light-weight head, and smaller input sizes, optimized for higher inference speeds (FPS) and lower memory usage.
Overview of TridentNet
mainTridentNet (Scale-Aware Trident Networks) is an object detection architecture designed to handle scale variation by generating scale-specific feature maps. It uses a parallel multi-branch architecture where each branch shares transformation parameters but maintains different receptive fields.
Key features include:
- Scale-specific branches: Parallel branches with different receptive fields.
- Scale-aware training: A scheme to specialize branches by sampling object instances of appropriate scales (Note: The specific implementation of the scale-aware training scheme from section 4.2 of the original paper is not implemented in this repository).
- Inference efficiency: During inference, only one branch is used, allowing for efficient deployment.
Overview of PointRend for Image Segmentation
mainPointRend (Point-based Rendering) is a neural network module that treats image segmentation as a rendering problem. It performs point-based segmentation predictions at adaptively selected locations using an iterative subdivision algorithm. This approach allows for high-quality, crisp object boundaries, especially in regions that are typically over-smoothed by other methods.
Key features include:
- Flexibility: Can be applied to both instance and semantic segmentation tasks by building on top of existing state-of-the-art models.
- Efficiency: Enables high-resolution outputs that are computationally and memory-efficient compared to traditional approaches.
- High Quality: Produces sharper boundaries through adaptive point-based sampling.