An Adaptive Attention-Driven Quadruplet Deep Hashing Method for Retrieving Histopathological Images
Abstract
1. Introduction
- A novel adaptive quadruplet deep hashing attention-based model to retrieve histopathological images is introduced for the first time.
- An efficient hash layer is proposed for tackling the vanishing gradient issue.
- We present an adaptive quadruplet loss function that boosts retrieval performance and also contributes to generating high-accuracy binary codes.
- A simple yet effective attention module is provided to focus on more details in histopathology images, improving the feature extraction process.
- Experimental results show that HAQDH outperforms the most advanced hashing-based techniques on three public histopathology datasets.
2. Related Work
2.1. Hashing Strategies
2.2. Attention Mechanisms
2.3. Histopathological Image Retrieval
3. Methods
3.1. Deep Hashing Models Framework
3.1.1. Presented Attention Module
3.1.2. Deep Hashing Design
3.2. The Proposed Loss Function
| Algorithm 1: The HAQDH training method |
| Input: Histopathological images Output: The parameters , , and Initialization: Set up and Repeat
Based on a particular number of repetitions |
3.3. Phase of Retrieval
4. Experimental Results
4.1. Datasets
4.2. Details of Implementation
4.3. Metrics
4.4. Results
4.5. Ablation Study
4.6. Discussion
4.7. Visual Retrieval Results
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Shi, X.; Sapkota, M.; Xing, F.; Liu, F.; Cui, L.; Yang, L. Pairwise based deep ranking hashing for histopathology image classification and retrieval. Pattern Recognit. 2018, 81, 14–22. [Google Scholar] [CrossRef]
- Fang, J.; Fu, H.; Liu, J. Deep triplet hashing network for case-based medical image retrieval. Med. Image Anal. 2021, 69, 101981. [Google Scholar] [CrossRef] [PubMed]
- Cao, Z.; Long, M.; Wang, J.; Yu, P.S. Hashnet: Deep learning to hash by continuation. In Proceedings of the IEEE International Conference on Computer Vision; IEEE: Piscataway, NJ, USA, 2017; pp. 5608–5617. [Google Scholar]
- Zhang, Z.; Zou, Q.; Lin, Y.; Chen, L.; Wang, S. Improved deep hashing with soft pairwise similarity for multi-label image retrieval. IEEE Trans. Multimed. 2019, 22, 540–553. [Google Scholar] [CrossRef]
- Zhu, J.; Chen, Z.; Zhao, L.; Wu, S. Quadruplet-based deep hashing for image retrieval. Neurocomputing 2019, 366, 161–169. [Google Scholar] [CrossRef]
- Dif, N.; Attaoui, M.O.; Elberrichi, Z.; Lebbah, M.; Azzag, H. Transfer learning from synthetic labels for histopathological images classification. Appl. Intell. 2022, 52, 358–377. [Google Scholar]
- Siddique, M.F.; Umar, M.; Ahmad, W.; Kim, J.-M. Advanced fault diagnosis in milling cutting tools using vision transformers with semi-supervised learning and uncertainty quantification. Sci. Rep. 2025, 15, 42460. [Google Scholar] [CrossRef] [PubMed]
- Woo, S.; Park, J.; Lee, J.-Y.; Kweon, I.S. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Li, G.; Fang, Q.; Zha, L.; Gao, X.; Zheng, N. HAM: Hybrid attention module in deep convolutional neural networks for image classification. Pattern Recognit. 2022, 129, 108785. [Google Scholar] [CrossRef]
- Li, X.; Xu, M.; Xu, J.; Weise, T.; Zou, L.; Sun, F.; Wu, Z. Image retrieval using a deep attention-based hash. IEEE Access 2020, 8, 142229–142242. [Google Scholar] [CrossRef]
- Gu, Y.; Yang, J. Densely-connected multi-magnification hashing for histopathological image retrieval. IEEE J. Biomed. Health Inform. 2018, 23, 1683–1691. [Google Scholar] [PubMed]
- Yang, P.; Zhai, Y.; Li, L.; Lv, H.; Wang, J.; Zhu, C.; Jiang, R. A deep metric learning approach for histopathological image retrieval. Methods 2020, 179, 14–25. [Google Scholar] [CrossRef] [PubMed]
- Qin, Q.; Huang, L.; Xie, K.; Wei, Z.; Wang, C.; Zhang, W. Deep adaptive quadruplet hashing with probability sampling for large-scale image retrieval. IEEE Trans. Circuits Syst. Video Technol. 2023, 33, 7914–7927. [Google Scholar] [CrossRef]
- Gionis, A.; Indyk, P.; Motwani, R. Similarity search in high dimensions via hashing. In VLDB’99: Proceedings of the 25th International Conference on Very Large Data Bases; ACM: New York, NY, USA, 1999; pp. 518–529. [Google Scholar]
- Gong, Y.; Lazebnik, S.; Gordo, A.; Perronnin, F. Iterative quantization: A procrustean approach to learning binary codes for large-scale image retrieval. IEEE Trans. Pattern Anal. Mach. Intell. 2012, 35, 2916–2929. [Google Scholar] [CrossRef]
- Shen, F.; Shen, C.; Liu, W.; Shen, H.T. Supervised discrete hashing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2015; pp. 37–45. [Google Scholar]
- Li, W.-J.; Wang, S.; Kang, W.-C. Feature learning based deep supervised hashing with pairwise labels. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence; ACM: New York, NY, USA, 2016; pp. 1711–1717. [Google Scholar]
- Liu, H.; Wang, R.; Shan, S.; Chen, X. Deep supervised hashing for fast image retrieval. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2016; pp. 2064–2072. [Google Scholar]
- Yılmaz, A.; Erkan, U.; Toktas, A.; Lai, Q.; Gao, S. AHIR: Deep learning-based autoencoder hashing image retrieval. Neurocomputing 2026, 671, 132639. [Google Scholar] [CrossRef]
- Wang, X.; Shi, Y.; Kitani, K.M. Deep supervised hashing with triplet labels. In Computer Vision–ACCV 2016: 13th Asian Conference on Computer Vision, Taipei, Taiwan, 20–24 November 2016, Revised Selected Papers, Part I 13; Springer: Berlin/Heidelberg, Germany, 2017; pp. 70–84. [Google Scholar]
- Liu, B.; Cao, Y.; Long, M.; Wang, J.; Wang, J. Deep triplet quantization. In Proceedings of the 26th ACM International Conference on Multimedia; ACM: New York, NY, USA, 2018; pp. 755–763. [Google Scholar]
- Öztürk, Ş.; Çelik, E.; Çukur, T. Content-based medical image retrieval with opponent class adaptive margin loss. Inf. Sci. 2023, 637, 118938. [Google Scholar] [CrossRef]
- Cheng, S.; Xiao, X.; Wang, L. Deep hashing image retrieval based on CNN and visual transformer network. Appl. Soft Comput. 2025, 177, 113244. [Google Scholar] [CrossRef]
- Alotaibi, A.; AlSaeed, D. Skin cancer detection using transfer learning and deep attention mechanisms. Diagnostics 2025, 15, 99. [Google Scholar] [CrossRef] [PubMed]
- Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. ECA-Net: Efficient channel attention for deep convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2020; pp. 11534–11542. [Google Scholar]
- Hussain, I.; Lai, Z.; Kong, H.; Hussain, F. Multi-scale feature fusion for breast tumor grading using dual-adaptive attention mechanisms. Pattern Recognit. 2026, 169, 111838. [Google Scholar] [CrossRef]
- Ghojogh, B.; Ghodsi, A. Attention Mechanism and Transformers. In Elements of Deep Learning; Springer: Berlin/Heidelberg, Germany, 2026; pp. 231–257. [Google Scholar]
- Lee, H.; Kim, H.-E.; Nam, H. Srm: A style-based recalibration module for convolutional neural networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: Piscataway, NJ, USA, 2019; pp. 1854–1862. [Google Scholar]
- Ma, Y.; Jiang, Z.; Zhang, H.; Xie, F.; Zheng, Y.; Shi, H.; Zhao, Y. Breast histopathological image retrieval based on latent dirichlet allocation. IEEE J. Biomed. Health Inform. 2016, 21, 1114–1123. [Google Scholar] [CrossRef] [PubMed]
- Sukhia, K.N.; Riaz, M.M.; Ghafoor, A.; Ali, S.S.; Iltaf, N. Content-based histopathological image retrieval using multi-scale and multichannel decoder based LTP. Biomed. Signal Process. Control 2019, 54, 101582. [Google Scholar] [CrossRef]
- Yazdi, M.; Erfankhah, H. Multiclass histology image retrieval, classification using Riesz transform and local binary pattern features. Comput. Methods Biomech. Biomed. Eng. Imaging Vis. 2020, 8, 595–607. [Google Scholar] [CrossRef]
- Alizadeh, S.M.; Helfroush, M.S.; Müller, H. A novel Siamese deep hashing model for histopathology image retrieval. Expert Syst. Appl. 2023, 225, 120169. [Google Scholar] [CrossRef]
- Nuñez-Fernández, C.; Farias, H.; Solar, M. Content-based histopathological image retrieval. Sensors 2025, 25, 1350. [Google Scholar] [CrossRef] [PubMed]
- Howard, A.; Sandler, M.; Chen, B.; Wang, W.; Chen, L.-C.; Tan, M.; Chu, G.; Vasudevan, V.; Zhu, Y.; Pang, R.; et al. Searching for mobilenetv3. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: Piscataway, NJ, USA, 2019; pp. 1314–1324. [Google Scholar]
- Saxena, S.; Shukla, S.; Gyanchandani, M. Pre-trained convolutional neural networks as feature extractors for diagnosis of breast cancer using histopathology. Int. J. Imaging Syst. Technol. 2020, 30, 577–591. [Google Scholar] [CrossRef]
- Alizadeh, S.M.; Helfroush, M.S.; Celebi, M.E. An Innovative Attention-based Triplet Deep Hashing Approach to Retrieve Histopathology Images. J. Imaging Inform. Med. 2024, 38, 2337–2354. [Google Scholar] [CrossRef] [PubMed]
- Spall, J.; Guo, X.; Lvovsky, A.I. Training neural networks with end-to-end optical backpropagation. Adv. Photonics 2025, 7, 016004. [Google Scholar] [CrossRef]
- Kather, J.N.; Weis, C.-A.; Bianconi, F.; Melchers, S.M.; Schad, L.R.; Gaiser, T.; Marx, A.; Zöllner, F.G. Multi-class texture analysis in colorectal cancer histology. Sci. Rep. 2016, 6, 27988. [Google Scholar] [CrossRef] [PubMed]
- Kumar, M.D.; Babaie, M.; Zhu, S.; Kalra, S.; Tizhoosh, H.R. A comparative study of CNN, BoVW and LBP for classification of histopathological images. In 2017 IEEE Symposium Series on Computational Intelligence (SSCI); IEEE: Piscataway, NJ, USA, 2017; pp. 1–7. [Google Scholar]
- Tizhoosh, H.R.; Babaie, M. Representing medical images with encoded local projections. IEEE Trans. Biomed. Eng. 2018, 65, 2267–2277. [Google Scholar] [CrossRef] [PubMed]
- Babaie, M.; Kalra, S.; Sriram, A.; Mitcheltree, C.; Zhu, S.; Khatami, A.; Rahnamayan, S.; Tizhoosh, H.R. Classification and retrieval of digital pathology scans: A new dataset. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops; IEEE: Piscataway, NJ, USA, 2017; pp. 8–16. [Google Scholar]
- Zhang, Z. Improved adam optimizer for deep neural networks. In 2018 IEEE/ACM 26th International Symposium on Quality of Service (IWQoS); IEEE: Piscataway, NJ, USA, 2018; pp. 1–2. [Google Scholar]
- Li, X.; Yu, J.; Wang, Y.; Chen, J.-Y.; Chang, P.-X.; Li, Z. DAHP: Deep attention-guided hashing with pairwise labels. IEEE Trans. Circuits Syst. Video Technol. 2021, 32, 933–946. [Google Scholar] [CrossRef]
- Bansal, M.; Kumar, M.; Sachdeva, M.; Mittal, A. Transfer learning for image classification using VGG19: Caltech-101 image data set. J. Ambient Intell. Humaniz. Comput. 2023, 14, 3609–3620. [Google Scholar] [PubMed]
- Chen, L.; Liu, R.; Zhou, Y.; Ma, X.; Chen, Y.; Zhang, D. Deep hashing with semantic hash centers for image retrieval. ACM Trans. Inf. Syst. 2025, 43, 160. [Google Scholar] [CrossRef]
- Hashimoto, N.; Takagi, Y.; Masuda, H.; Miyoshi, H.; Kohno, K.; Nagaishi, M.; Sato, K.; Takeuchi, M.; Furuta, T.; Kawamoto, K.; et al. Case-based similar image retrieval for weakly annotated large histopathological images of malignant lymphoma using deep metric learning. Med. Image Anal. 2023, 85, 102752. [Google Scholar] [CrossRef] [PubMed]








| Approaches | 32-Bits | 64-Bits | 128-Bits |
|---|---|---|---|
| HAQDH (ours) | 0.9832 ± 0.012 | 0.9894 ± 0.007 | 0.9940 ± 0.004 |
| OCAM | 0.8883 ± 0.022 | 0.9078 ± 0.009 | 0.9149 ± 0.010 |
| ATH | 0.8859 ± 0.009 | 0.8947 ± 0.005 | 0.9057 ± 0.012 |
| IDHN | 0.8857 ± 0.018 | 0.8857 ± 0.018 | 0.8930 ± 0.024 |
| DTQ | 0.8705 ± 0.010 | 0.8790 ± 0.002 | 0.8868 ± 0.008 |
| HashNet | 0.8649 ± 0.021 | 0.8714 ± 0.016 | 0.8790 ± 0.014 |
| DSH | 0.8351 ± 0.026 | 0.8491 ± 0.021 | 0.8612 ± 0.017 |
| DPSH | 0.8602 ± 0.013 | 0.8693 ± 0.014 | 0.8713 ± 0.016 |
| ITQ | 0.7063 ± 0.058 | 0.7381 ± 0.041 | 0.7530 ± 0.038 |
| LSH | 0.7001 ± 0.068 | 0.7238 ± 0.039 | 0.7470 ± 0.045 |
| Approaches | 32-Bits | 64-Bits | 128-Bits |
|---|---|---|---|
| HAQDH (ours) | 0.9849 ± 0.004 | 0.9908 ± 0.001 | 0.9983 ± 0.001 |
| OCAM | 0.9322 ± 0.019 | 0.9635 ± 0.016 | 0.9679 ± 0.015 |
| ATH | 0.9205 ± 0.007 | 0.9476 ± 0.022 | 0.9564 ± 0.018 |
| IDHN | 0.9446 ± 0.011 | 0.9590 ± 0.016 | 0.9666 ± 0.015 |
| DTQ | 0.9015 ± 0.005 | 0.9295 ± 0.010 | 0.9418 ± 0.012 |
| HashNet | 0.8709 ± 0.011 | 0.9070 ± 0.002 | 0.9136 ± 0.006 |
| DSH | 0.8649 ± 0.004 | 0.8885 ± 0.009 | 0.8963 ± 0.007 |
| DPSH | 0.8436 ± 0.008 | 0.8706 ± 0.012 | 0.8930 ± 0.010 |
| ITQ | 0.7250 ± 0.033 | 0.7581 ± 0.048 | 0.7728 ± 0.061 |
| LSH | 0.7192 ± 0.083 | 0.7401 ± 0.071 | 0.7589 ± 0.054 |
| Approaches | 32-Bits | 64-Bits | 128-Bits |
|---|---|---|---|
| HAQDH (ours) | 0.9854 | 0.9935 | 0.9968 |
| OCAM | 0.9080 | 0.9303 | 0.9451 |
| ATH | 0.8503 | 0.8749 | 0.8952 |
| IDHN | 0.8867 | 0.9179 | 0.9344 |
| DTQ | 0.8383 | 0.8663 | 0.8902 |
| HashNet | 0.8412 | 0.8591 | 0.8731 |
| DSH | 0.8510 | 0.8636 | 0.8817 |
| DPSH | 0.8622 | 0.8748 | 0.8992 |
| ITQ | 0.6497 | 0.6873 | 0.7350 |
| LSH | 0.6255 | 0.6608 | 0.7168 |
| Methods | Hash Layer | Attention Module | Loss Function | The Best MAP |
|---|---|---|---|---|
| HAQDH-V1 | ours | ours | [22] | 0.9589 |
| HAQDH-V2 | ours | ours | [5] | 0.9698 |
| HAQDH-V3 | ours | ECA | ours | 0.9543 |
| HAQDH-V4 | ours | CBAM | ours | 0.9601 |
| HAQDH-V5 | ours | SRM | ours | 0.9639 |
| HAQDH-V6 | [43] | ours | ours | 0.9425 |
| HAQDH-V7 | [3] | ours | ours | 0.9670 |
| HAQDH-V8 | ours | - | ours | 0.9630 |
| HAQDH-V9 | ours | - | ours | 0.9347 |
| HAQDH | ours | ours | ours | 0.9983 |
| Approaches | Training | Search |
|---|---|---|
| HAQDH (ours) | 183.15 | 0.85 |
| ATH | 294.35 | 2.25 |
| HashNet | 256.01 | 1.69 |
| DSH | 263.17 | 1.55 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Alizadeh, S.M.; Müller, H.; Helfroush, M.S. An Adaptive Attention-Driven Quadruplet Deep Hashing Method for Retrieving Histopathological Images. J. Imaging 2026, 12, 321. https://doi.org/10.3390/jimaging12070321
Alizadeh SM, Müller H, Helfroush MS. An Adaptive Attention-Driven Quadruplet Deep Hashing Method for Retrieving Histopathological Images. Journal of Imaging. 2026; 12(7):321. https://doi.org/10.3390/jimaging12070321
Chicago/Turabian StyleAlizadeh, Seyed Mohammad, Henning Müller, and Mohammad Sadegh Helfroush. 2026. "An Adaptive Attention-Driven Quadruplet Deep Hashing Method for Retrieving Histopathological Images" Journal of Imaging 12, no. 7: 321. https://doi.org/10.3390/jimaging12070321
APA StyleAlizadeh, S. M., Müller, H., & Helfroush, M. S. (2026). An Adaptive Attention-Driven Quadruplet Deep Hashing Method for Retrieving Histopathological Images. Journal of Imaging, 12(7), 321. https://doi.org/10.3390/jimaging12070321

