# A Novel Hybrid Approach for a Content-Based Image Retrieval Using Feature Fusion
## 3 Materials and Methods
### Structure of System  
This paper uses ResNet50 and the VGG16 architectures of deep learning. ResNet50 won the competition that was held in 2015 on ILSVRC ImageNet 2015 as the base [46]. Instead of starting CNN from scratch, the ResNet50 and VGG 16 models are used as the base transfer learning methods [47; 48]. Thus, the accretion ResNet50 and VGG16 of a pre-trained model are utilized instead of creating a new model. We used ResNet50 because it successfully solves many problems related to image processing and classification of biomedical images [49]. Moreover, Resnet50 reduces computational costs and time complexity. We used VGG16 for the feature fusion purpose to achieve high accuracy using the final feature vector.  
The input layers of both models are modified to accept information in the forms of 224, 224, and 3. After the input layer is modified and used as the foundation for the new model, the ResNet50 and VGG16 models no longer have any input, pooling, fully connected, softmax, or classification layers. The hybrid model adds a new GlobalMaxpooling2D layer to retrieve the single vector array. The architecture of the proposed CBIR is shown in Figure 1, and the parameters of the network are listed in Table 2.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Ref No** & **Year** & **Features** & **Similarity Measure** & **Model Used** \\ \hline
[42] & 2022 & High-Level features by using DCNN & - & K-means clustering \\
[43] & 2023 & SVD, UMLBP, Color autocorrelogram & Mahalanobis distamce & - \\
[38] & 2023 & SURF & - & - \\
[44] & 2023 & CNN & Hamming Distance & Random Forest \\ \hline \hline \end{tabular}
\end{table}
Table 1: _Cont._  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Layers** & **Output Shape** & **Parameters** & **Feature** & **Total Features** \\ \hline ResNet50 (Functional) & 7, 7, 2048 & 23,587,712 & - & \\ Global\_max\_pooling2d & 2048 & 0 & 2048 & \\ VGG16 (Functional) & 7, 7, 512 & 14,714,688 & - & 2560 \\ Global\_max\_pooling2d & 512 & 0 & 512 & \\ \hline \hline \end{tabular}
\end{table}
Table 2: Parameters of the network’s layers.  
Database images are initially pre-processed and transformed from RGB to BGR and then passed through the two pre-trained deep learning models, ResNet50 and VGG16, for extracting features. GlobalMaxpooling2D layer is added to convert the feature vector into a one-dimensional array. A total of 2048 features are extracted with ResNet50 and 512 with VGG16. After the feature extraction, all the features are combined to create the final feature vector.  
Similar features are clustered together by applying the machine learning model k Nearest Neighbor. K-NN is a technique utilized to retrieve images that closely resemble the query image. It works by identifying the nearest neighbors to the query image and retrieving their corresponding indices. Essentially, K-NN makes groups of similar images and retrieves those that are most similar to the query image. After clustering the features to determine the distance between similar images, the Euclidean distance similarity measure is used. In the image retrieval phase, the images comparable to the query image or those closest to it are indexed and retrieved. Figure 2 depicts the image retrieval process.