## 3 Materials and Methods  
Our research categorizes document search services into two distinct groups: weak DIR systems and robust DIR systems. Within the vulnerable group, we include DIR systems that can swiftly locate the most similar images in extensive document image datasets in less than a second. However, the rankings of these images may be approximate. On the other hand, strong DIR systems employ precise but computationally demanding techniques to calculate pairwise similarities between query and data images. Moreover, strong DIR systems do not exhibit the same scalability as their weak counterparts. Our study incorporates three different weak DIR systems alongside one strong DIR system. The results generated by these vulnerable DIR systems are subsequently channeled into the strong DIR system. This strong DIR system serves as either the ultimate decision-maker for identifying the most relevant document images for a given query or acts as a prominent voter, with its weight typically surpassing that of the weak DIR systems. This ensemble approach ensures a balanced trade-off between computational efficiency and accuracy in DIR. The first weak DIR system, \"Key-Based DIR\", operates by extracting visual features from local regions, specifically contours, within the document image. These visual features are then grouped into clusters. Subsequently, keys are generated based on the spatial relationships between these local regions. The collection of these keys serves as the representation of the document image. Regarding indexing, the key-based DIR employs an inverted index to tally the occurrences of the query keys within the document image dataset. The second weak learner, \"OCR-Based DIR\", uses OCR to extract text information from the document images. To mitigate potential OCR errors, shingling is applied to the extracted text. This approach enhances the accuracy and robustness of textual information extraction from document images. For textual representation, we employ TFIDF-weighted vectors, and an inverted index structure is utilized to efficiently compute the similarity of textual data across document images and perform ranking. The other weak DIR system, \"Global Image Features-Based DIR\", focuses on extracting run-length features from document images. Instead of concentrating on certain document parts, documents are represented and compared in the context of DIR, utilizing features that capture the qualities of the complete image. Features of a whole document's form, texture patterns, and general color distribution are examples of global image features. During the retrieval process, these characteristics are utilized to gauge how similar or dissimilar certain documents are. They also give an all-encompassing depiction of the document picture. Thus, Global Image Features-Based DIR uses features that consider the document picture as a whole to facilitate the efficient and successful retrieval of pertinent documents based on their general visual attributes. We employ the Fast Library for Approximate Nearest Neighbors (FLANN) library [15]. The FLANN library is a versatile tool used in computer science applications that involve large datasets and the need to efficiently find approximate nearest neighbors. Our proposed robust DIR system, \"Word-Based DIR\", leverages maximally stable extremal region (MSER)-based detectors to identify local regions within document images [26]. MSER is a computer vision technique that is useful for tasks like object recognition and picture segmentation since it recognizes stable and distinguishable areas in images. Its capacity to manage changes in scale, intensity, and noise in real-world pictures is what makes it so strong. We then extract Speeded-Up Robust Features (SURF) features over these identified regions [27]. SURF is a feature detection and description method that is used for tasks including object recognition, registration, and picture stitching.