# Small object detection

Small object detection is a particular case of object detection where various techniques are employed to detect small objects in digital images and videos. "Small objects" are objects having a small pixel footprint in the input image. In areas such as aerial imagery, state-of-the-art object detection techniques under performed because of small objects.

## Uses

Small object detection has applications in various fields such as Video surveillance (Traffic video Surveillance, Small object retrieval, Anomaly detection, Maritime surveillance, Drone surveying, Traffic flow analysis, and Object tracking.

## Problems with small objects

* Modern-day object detection algorithms such as You Only Look Once heavily uses convolution layers to learn features. As an object passes through convolution layers, its size gets reduced. Therefore, the small object disappears after several layers and becomes undetectable.
* Sometimes, the shadow of an object is detected as a part of object itself. So, the placement of the bounding box tends to centre around a shadow rather than an object. In the case of vehicle detection, pedestrian and two-wheeler detection suffer because of this.
* At present, drones are very widely used in aerial imagery. They are equipped with hardware (sensors) and software (algorithms) that help maintain a particular stable position during their flight. In windy conditions, the drone automatically makes fine moves to maintain its position and that changes the view near the boundary. It may be possible that some new objects appear near the image boundary. Overall, these affect classification, detection, and eventually tracking accuracy.

## Methods

Various methods are available to detect small objects, which fall under three categories:

### Improvising existing techniques

There are various ways to detect small objects with existing techniques. Some of them are mentioned below,

#### Choosing a data set that has small objects

The machine learning model's output depends on "How well it is trained." So, the data set must include small objects to detect such objects. Also, modern-day detectors, such as YOLO, rely on anchors. Latest versions of YOLO (starting from YOLOv5) uses an auto-anchor algorithm to find good anchors based on the nature of object sizes in the data set. Therefore, it is mandatory to have smaller objects in the data set.

#### Generating more data via augmentation, if required

Deep learning models have billions of neurons that settle down to some weights after training. Therefore, it requires a good amount of quantitative and qualitative data for better training. Data augmentation is useful technique to generate more diverse data from an existing data set.

#### Increasing image capture resolution and model’s input resolution

These help to get more features from objects and eventually learn the best from them. For example, a bike object in the 1280 X 1280 resolution image has more features than the 640 X 640 resolution.

#### Auto learning anchors

Selecting anchor size plays a vital role in small object detection. Instead of hand picking it, use algorithms that identify it based on the data set. YOLOv5 uses a K-means algorithm to define anchor size.

#### Tiling approach during training and inference

State-of-the-art object detectors allow only the fixed size of image and change the input image size according to it. This change may deform the small objects in the image. The tiling approach helps when an image has a high resolution than the model's fixed input size; instead of scaling it down, the image is broken down into tiles and then used in training. The same approach is used during inference as well.

#### Feature Pyramid Network (FPN)

Use a feature pyramid network to learn features at a multi-scale: e.g., Twin Feature Pyramid Networks (TFPN), Extended Feature Pyramid Network (EFPN). FPN helps to sustain features of small objects against convolution layers.

### Add-on techniques

Instead of modifying existing methods, some add-on techniques are there, which can be directly placed on top of existing approaches to detect smaller objects. One such technique is Slicing Aided Hyper Inference(SAHI). The image is sliced into different-sized multiple overlapping patches. Hyper-parameters define their dimensions. Then patches are resized, while maintaining the aspect ratio during fine-tuning. These patches are then provided for training the model.

### Well-Optimised techniques for small object detection

Various deep learning techniques are available that focus on such object detection problems: e.g., Feature-Fused SSD, YOLO-Z. Such methods work on "How to sustain features of small objects while they pass through convolution networks."

## Other applications

* Crowd counting
* Vehicle re-identification
* Animal detection
* Fish detection