# YOLOv8 with Post-Processing for Small Object Detection Enhancement
## 3 Proposed Methodology  
### Improvement Using CARAFE Module  
Detecting small objects in images with low-resolution or complex backgrounds presents a significant challenge. In such cases, small objects often lack sufficient pixel information in the feature map, leading to a substantial degradation in detection accuracy due to unclear or vague features. This issue is exacerbated by information loss and feature blurring during upsampling. Traditional upsampling methods, such as Bilinear Interpolation and Deconvolution [24], primarily rely on local information around individual pixels. However, these methods are limited in capturing contextual information and global features, which are crucial for detecting small objects effectively. This study employs the YOLO architecture with the CARAFE module to address these challenges [25]. The CARAFE module creates an adaptive upsampling kernel based on the content of the input feature map [22], facilitating more sophisticated feature map reconstruction. This approach enhances the representation of small objects and minimizes information loss during upsampling. CARAFE incorporates global contextual information by utilizing a larger receptive field, significantly improving small object detection performance, particularly in complex background scenarios. The YOLO architecture with the CARAFE module builds on the backbone, neck, and head structure of the existing YOLOv8n model, with the CARAFE module integrated explicitly into the neck component. The structure is illustrated in Figure 2.  
The backbone processes the input image to generate a multi-scale feature map. YOLOv8's backbone is based on the cross-stage partial network (CSPNet) structure, which ensures efficient feature extraction while reducing the computational cost [26]. This design is essential for preserving global and regional information and detecting small objects. The neck component further strengthens the multi-scale features by combining feature maps generated in the backbone and propagating semantic information from the higher to lower layers. In the YOLOv8 architecture, the CARAFE module replaces the Path Aggregation Network (PANNet)-based upsampling module used in previous YOLO models [27]. This replacement enables the integration of broader contextual information and maximizes the expressive power of the feature map during the upsampling process. CARAFE generates a dynamically adapted upsampling kernel based on the content of the input feature map, enabling more detailed and accurate feature restoration compared to traditional upsampling methods [28; 29; 30]. The head component then predicts the location and class of objects based on the multi-scale features provided by the neck. The Decoupled head structure separates detection and classification tasks, optimizing the performance of each task independently and ensuring high accuracy for both small and large objects. The CARAFE module is a lightweight upsampling operator, as depicted in Figure 3, consisting of two main components: a kernel prediction module and a content-aware reassembly module. As shown in Figure 3, given a feature map \(\chi\) of size \(C\times H\times W\) and an upsampling ratio \(\sigma\), CARAFE generates a new feature map \(\chi^{\prime}\) of size \(C\times\sigma H\times\sigma W\). For each target position \(\chi^{\prime}_{f}\) in the output, \(l^{\prime}=\left(i^{\prime},j^{\prime}\right)\) corresponds to an input position \(1=\left(i,j\right)\), where \(i=\left[\frac{i^{\prime}}{\sigma}\right],j=\left[\frac{i^{\prime}}{\sigma}\right]\). Here, \(N(\chi_{l},k)\) represents a neighborhood region of size \(k\times k\) centered at position \(l\). The kernel prediction module predicts the reassembly kernel \(\omega_{l^{\prime}}\) for each position \(l^{\prime}\), based on the neighborhood of \(\chi_{l}\).