# DI-SLAM: A Real-Time Enhanced RGB-D SLAM for Dynamic Indoor Environments
## 3 System Introduction
### Dynamic Filtering Strategy
#### 3.2.2 Object Detection Thread  
Object detection is a broad field that primarily utilizes neural networks to extract image features. These features are then used for calculations, and ultimately, the object is classified and localized in the form of a bounding box. Building on this foundation, we further process the detected dynamic object bounding boxes by merging them, generating a combined binary mask, \(mask_{object}\), to represent potential dynamic regions in the image. To balance real-time performance and computational efficiency, we select the Yolov5s neural network as the core of the object detection thread. Figure 3 illustrates the network architecture, which consists of four main components: input, backbone, neck, and prediction head. This structure allows for real-time object detection on each image frame, and the backbone is mainly composed of modules such as CBS, C3, and SPPF, which are used for efficiently extracting image features. For clarity, this subsection first provides a concise introduction to the fundamental modules highlighted in the purple region of Figure 3, including ConvBNSiLU, Bottleneck, and SPPF. ConvBNSiLU, alternatively referred to as CBS, initially performs local feature extraction via a two-dimensional convolutional operation (Conv2d). Subsequently, it employs batch normalization (BatchNorm2d) for feature distribution standardization, followed by the application of a Sigmoid-weighted Linear Unit (SiLU) activation function to introduce nonlinear transformations, thereby enhancing the network's expressive capability. The Bottleneck module adopts a \"dimensionality reduction--convolution--dimensionality restoration\" design: initially reducing channel dimensionality through \(1\times 1\) convolutions to minimize computational requirements, then performing spatial feature extraction via  
Figure 2: Epipolar geometry: the constraint \(p_{1}^{\mathrm{T}}Fq_{1}=0\) for static scenes. \(3\times 3\) convolutions and ultimately restoring the original channel dimensions through additional \(1\times 1\) convolutions. This architecture preserves feature fidelity while optimizing computational efficiency. The SPPF (Spatial Pyramid Pooling Fast) module concatenates feature maps with different receptive fields from multiple scales through maximum pooling layers and merges them to form a unified feature map, which enhances the network's ability to recognize multi-scale objects at a relatively low computational cost. To optimize the neural network processing efficiency, we strategically integrate the Convolutional Block Attention Module (CBAM) prior to the SPPF module in the backbone architecture. As illustrated in Figure 4, the SPPF module expands feature map receptive fields through its multi-scale max pooling operation, significantly enhancing multi-scale object detection performance. Meanwhile, CBAM combines channel attention with spatial attention, effectively strengthening the features of the target area while suppressing background interference. This structure helps reduce the model's parameter count and computational complexity to some extent. To more effectively enhance the feature representation capability of the neural network, we propose an enhanced version of the original C3 module in Yolov5s, designated as Nc2f. As depicted in Figure 5a, the baseline C3 module adopts a CSPNet-inspired architecture featuring, which divides the input features into two branches: one is processed only through the CBS module, and the other is processed through both CBS and the Bottleneck module. The features from both branches are then concatenated (Concat), followed by a CBS layer to restore the feature dimensions. Figure 4: CBAM network architecture diagram. Figure 3: Yolov5s framework diagram. The yellow and blue areas highlight the novel contributions of this work. Although the original C3 module achieves a certain balance between speed and accuracy, there is still redundancy in the information flow in the Bottleneck path.