## 2 Materials and Methods
### Feature Extraction by the Backbone Network
Therefore, in our work, we will focus on the feature maps output by each layer of the ResNet rather than directly processing the top-layer output. Considering the case of the output for a single image, let \(l\in\{1,2,\dots,\ N\}\) represent the selected convolutional layer. The feature map output for the current layer can be denoted as \(x_{l}\):  
\[x_{l}= \begin{bmatrix}x_{11}&x_{12}&\dots&x_{1w}\\ x_{21}&x_{22}&\dots&x_{2w}\\ \dots&\dots&\dots&\dots\\ x_{h1}&x_{h2}&\dots&x_{hw}\end{bmatrix} _{h\times w},l\in\{1,2,\dots,N\} \tag{2}\]  
Figure 5: ResNet152 architecture diagram. Here, \(w\) and \(h\) represent the width and height of the image, respectively, and \(N\) is the total number of layers in the network. The feature map \(x_{l}\) is flattened into a one-dimensional vector to construct the image feature descriptor:  
\[x_{i}^{l}=\left[x_{11}^{i},x_{12}^{i},\dots x_{1w}^{i},x_{21}^{i},x_{22}^{i}, \dots x_{hw}^{i}\right],i\in\{1,2,\dots c\} \tag{3}\]  
Here, \(i\in\{1,2,\dots c\}\) represents the total number of output feature maps for the \(l\)-th convolutional layer. Now, we obtain the feature vectors of the \(i\)-th image in the sequence from the \(l\)-th layer of ResNet152. Keeping \(l\) unchanged, by combining the feature vectors of all feature maps, we can obtain the feature matrix \(X_{l}\):  
\[X_{l}=\left[x_{1}^{l},x_{2}^{l},\dots x_{c}^{l}\right] \tag{4}\]  
\(X_{l}\) can be considered as an overall descriptor for the image features. However, due to the interference of redundant information in dynamic environments, the accuracy of \(X_{l}\) in similarity detection may decline. The redundant information in the feature maps can be attributed to the presence of dynamic objects, environmental changes, and factors like occlusion, where the output loop after similarity detection often represents the same scene. In different periods of a day, variations in background, moving objects, and lighting conditions within the same scene can lead to changes in the features extracted from the images. Based on these considerations, the authors of this study chose to investigate the New College and City Center datasets. The images collected in the New College dataset contain numerous dynamic objects, primarily people, with most appearing in the same scene. The City Center dataset primarily captures images of communities and roads, featuring a variety of static objects such as cars, pedestrians, and obstacles. Detailed information about the datasets will be presented in the experimental section. To analyze the differences in features extracted from the same scene in dynamic environments, this study utilizes Grad CAM (Gradient-weighted Class Activation Mapping) [34] to visualize the feature maps output by ResNet152. This process involves converting the network's output feature maps into heatmap representations, allowing observation of the regions that the network focuses on. Figures 6 and 7 demonstrate the impact of people as moving objects in the same scene on the network's feature maps in the New College dataset. In Figure 6, the red area indicates the part of the image that is of interest to the network, while the blue area represents the part that the network is not interested in. From Figure 6a,b, it can be observed that the pedestrian area in the image is of interest, and the network treats the trees as part of the background of the image. In Figure 6c,d, the pedestrian blocks are not significantly activated, and the network treats the grass as the image background. In Figure 6e,f, only a small portion of the pedestrian blocks are activated, and most of them remain unactivated. Figure 6: _Cont._  
From Figure 7a-d, it can be seen that the influence of pedestrians as moving objects is more pronounced, and the pre-trained network focuses more on the architectural features in the scene, such as windows, walls, etc., paying relatively little attention to pedestrians. Figures 8 and 9 illustrate the impact of environmental changes and occlusions on network feature maps in the City Center dataset within the same scene.