Multimodal Diamond Inclusion Detection and Clarity Grading via Enhanced YOLOv7 with ECA and ASFF Modules
Abstract
The detection of micro-inclusions and the representation of interpretable results compatible with gemological standards are two major bottlenecks to the automation of diamond clarity grading. In this work, we propose a novel solution using an enhanced YOLOv7 model in a multimodal framework to overcome the above bottlenecks. Specifically, our contributions are threefold: Firstly, we improve the original YOLOv7 by incorporating the Efficient Channel Attention (ECA) mechanism to enhance the extracted fine-grained features and the Adaptively Spatial Feature Fusion (ASFF) module for capturing more robust multi-scale representations; secondly, we build a three-channel input consisting of optical grayscale, gray-level co-occurrence matrix (GLCM) texture linked with the optical properties of inclusions, and morphological operation-enhanced images. Thirdly, we design a traceable grading system by combining the XGBoost classifier with programmable GIA (Gemological Institute of America) rules. Our method achieves 91.3% mAP@0.5 on the Roboflow Diamond Inclusion dataset, outperforming the baseline YOLOv7 by 9.2%. The clarity grading performance on this dataset attains an accuracy of 86.7%, a Kappa coefficient of 0.82, and a weighted F1-score of 0.87, resulting in high consistency with human expert evaluations. Ablation experiments confirm that the proposed components all make individual and complementary contributions. This work represents a significant advance towards the automatic, accurate, and interpretable grading of diamonds, and it creates a practical tool for use within the jewelry industry.References
E. Barrie, S. Teuthof, and S. Eaton-Magaña, “HPHT-Processed DIAMOND with Counterfeit GIA Inscription.,” Gems & Gemology, vol. 57, no. 3, 2021.
S. Eaton-Magaña, M. F. Hardman, and S. Odake, “LABORATORY-GROWN DIAMONDS: AN UPDATE ON IDENTIFICATION AND PRODUCTS EVALUATED AT GIA.,” Gems & Gemology, vol. 60, no. 2, 2024. http://dx.doi.org/10.5741/GEMS.60.2.146
S. N. Kigo, E. O. Omondi, and B. O. Omolo, “Assessing predictive performance of supervised machine learning algorithms for a diamond pricing model,” Sci Rep, vol. 13, no. 1, p. 17315, 2023. https://doi.org/10.1038/s41598-023-44326-w
Z. OuYang, “Research on the diamond price prediction based on linear regression, decision tree and random forest,” Highlights in Business, Economics and Management, vol. 24, pp. 248–257, 2024.
M. F. Hardman, A. Homkrajae, S. Eaton-Magaña, C. M. Breeding, and A. C. Palke, “CLASSIFICATION OF GEM MATERIALS USING MACHINE LEARNING.,” Gems & Gemology, vol. 60, no. 3, 2024.
Y. Luo, D. Nelson, T. Ardon, and C. M. Breeding, “MEASUREMENT AND CHARACTERIZATION OF THE EFFECTS OF BLUE FLUORESCENCE ON DIAMOND APPEARANCE.,” Gems & Gemology, vol. 57, no. 2, 2021. http://dx.doi.org/10.5741/GEMS.57.2.102
U. F. S. D’Haenens-Johansson, J. E. Butler, and A. N. Katrusha, “Synthesis of diamonds and their identification,” Rev Mineral Geochem, vol. 88, no. 1, pp. 689–753, 2022. https://doi.org/10.2138/rmg.2022.88.13
Y. Ma et al., “Chinese Colorless HPHT Synthetic Diamond Inclusion Features and Identification,” Crystals (Basel), vol. 12, no. 9, p. 1266, 2022. https://doi.org/10.3390/cryst12091266
E. Fritsch, G. Choudhary, C. M. Beeding, and L. Tai-An Lai, “‘ Floating Flower’ inclusions in aventurine quartz bangle.,” Gems & Gemology, vol. 57, no. 4, 2021.
N. J. Ahline and J. Rizzo, “ANALYSIS OF GEMSTONES AT GIA LABORATORIES.,” Gems & Gemology, vol. 60, no. 4, 2024.
Y. Gao et al., “Jedi Spinel from Man Sin, Myanmar: Color, Inclusion, and Chemical Features,” Crystals (Basel), vol. 13, no. 1, p. 103, 2023. https://doi.org/10.3390/cryst13010103
S. T. Pham, N. Koniuch, E. Wynne, A. Brown, and S. M. Collins, “Microscopic crystallographic analysis of dislocations in molecular crystals,” Nat Mater, pp. 1–6, 2025. https://doi.org/10.1038/s41563-025-02138-5
A. Chepurov et al., “Surface porosity of natural diamond crystals after the catalytic hydrogenation,” Crystals (Basel), vol. 11, no. 11, p. 1341, 2021. https://doi.org/10.3390/cryst11111341
E.-M. Sally and A. Troy, “Laboratory-grown diamond: A gemological laboratory perspective,” Journal of Gems & Gemmology, vol. 23, no. 6, pp. 25–39, 2021.
F. E. I. Wenqian, Z. Fengxia, D. U. Quanbin, and W. Qinghai, “Diamond particle clarity detection method based on CBAM-ResNet50,” 金刚石与磨料磨具工程, vol. 44, no. 5, pp. 588–598, 2024.
Y. Jianxin, L. A. N. Xiaoping, W. Bo, Y. A. N. Lei, Z. Zhen, and F. Yadong, “Detection method based on deep learning for yellow industrial diamond,” 金刚石与磨料磨具工程, vol. 40, no. 6, pp. 13–19, 2020.
M. S. A. Basha and P. M. Oveis, “Predictive modeling and benchmarking for diamond price estimation: integrating classification, regression, hyperparameter tuning and execution time analysis,” International Journal of System Assurance Engineering and Management, vol. 15, no. 11, pp. 5279–5313, 2024. https://doi.org/10.1007/s13198-024-02535-0
T.-H. Tsai, U. F. S. D’Haenens-Johansson, T. Smith, C. Zhou, and W. Xu, “Multi-excitation photoluminescence spectroscopy system for gemstone analysis,” Opt Express, vol. 32, no. 14, pp. 24839–24855, 2024. https://doi.org/10.1364/OE.525832
M. Navale, M. Bikchandani, V. Bhosale, P. Bhosale, and S. Ghadge, “DIAMOND QUALITY ASSESSMENT SYSTEM USING MACHINE LEARNING APPROACH,” DIAMOND, vol. 7, no. 04, 2020.
V. Nagargoje, M. Hannure, V. Kokane, K. Kondekar, G. Parate, and V. Deotare, “Diamond Price Prediction using Machine Learning Algorithm,” 2023. https://doi.org/10.32628/IJSRCSEIT
S. Eaton-Magaña, T. Ardon, C. M. Breeding, and J. E. Shigley, “NATURAL-COLOR D-TO-Z DIAMONDS: A CRYSTAL-CLEAR PERSPECTIVE.,” Gems & Gemology, vol. 56, no. 3, 2020.
X. Liu and Y. Guo, “Feasibility Study on Color Grading of Blue Iolite Based on GemDialogue Color Comparison Charts,” Applied Sciences, vol. 13, no. 11, p. 6475, 2023. https://doi.org/10.3390/app13116475
F. B. Pena, D. Crabi, S. C. Izidoro, É. O. Rodrigues, and G. Bernardes, “Machine learning applied to emerald gemstone grading: framework proposal and creation of a public dataset,” Pattern Analysis and Applications, vol. 25, no. 1, pp. 241–251, 2022. https://doi.org/10.1007/s10044-021-01041-4
M. S. Sánchez, “Optimization of diamond price prediction strategies using machine learning techniques,” 2024. DOI: 10.5897/JEIF2024.1223
H. Hao et al., “High-accuracy and broadband polarization detection via metasurface vector beam modulation,” Photonics Res, vol. 13, no. 9, pp. 2487–2496, 2025. https://doi.org/10.1364/PRJ.565136
X. Huang et al., “Polarization structured light 3D depth image sensor for scenes with reflective surfaces,” Nat Commun, vol. 14, no. 1, p. 6855, 2023. https://doi.org/10.1038/s41467-023-42678-5
S. Zhang and M. Xie, “MIPANet: optimizing RGB-D semantic segmentation through multi-modal interaction and pooling attention,” Front Phys, vol. 12, p. 1411559, 2024. https://doi.org/10.3389/fphy.2024.1411559
L. Von Rueden et al., “Informed machine learning–a taxonomy and survey of integrating prior knowledge into learning systems,” IEEE Trans Knowl Data Eng, vol. 35, no. 1, pp. 614–633, 2021. https://doi.org/10.1109/TKDE.2021.3079836
N. Anjomani and T. Ardon, “Unusual Laser Drill Holes in a Laboratory-Grown Diamond,” 2022, GEMOLOGICAL INST AMER 5345 ARMADA DR, CARLSBAD, CA 92008 USA.
P. J. Wallace, T. Plank, R. J. Bodnar, G. A. Gaetani, and T. Shea, “Olivine-hosted melt inclusions: a microscopic perspective on a complex magmatic world,” Annu Rev Earth Planet Sci, vol. 49, no. 1, pp. 465–494, 2021. https://doi.org/10.1146/annurev-earth-082420-060506
Y. Liu et al., “Fractal-based pattern quantification of mineral grains: A case study of Yichun rare-metal granite,” Fractal and Fractional, vol. 8, no. 1, p. 49, 2024. https://doi.org/10.3390/fractalfract8010049
B. H. Y. Chow and C. C. Reyes-Aldasoro, “Automatic gemstone classification using computer vision,” Minerals, vol. 12, no. 1, p. 60, 2021. https://doi.org/10.3390/min12010060
D. Zhu, Y. Liu, X. Yao, and M. M. Fischer, “Spatial regression graph convolutional neural networks: A deep learning paradigm for spatial multivariate distributions,” Geoinformatica, vol. 26, no. 4, pp. 645–676, 2022. https://doi.org/10.1007/s10707-021-00454-x
R. Dwivedi et al., “Explainable AI (XAI): Core ideas, techniques, and solutions,” ACM Comput Surv, vol. 55, no. 9, pp. 1–33, 2023. https://doi.org/10.1145/3561048
M.-H. Guo, C.-Z. Lu, Z.-N. Liu, M.-M. Cheng, and S.-M. Hu, “Visual attention network,” Comput Vis Media (Beijing), vol. 9, no. 4, pp. 733–752, 2023.
K. Li, Y. Zhang, K. Li, Y. Li, and Y. Fu, “Image-text embedding learning via visual and textual semantic reasoning,” IEEE Trans Pattern Anal Mach Intell, vol. 45, no. 1, pp. 641–656, 2022. https://doi.org/10.1109/TPAMI.2022.3148470
DOI:
https://doi.org/10.31449/inf.v50i8.12773Downloads
Published
How to Cite
Issue
Section
License
Authors retain copyright in their work. By submitting to and publishing with Informatica, authors grant the publisher (Slovene Society Informatika) the non-exclusive right to publish, reproduce, and distribute the article and to identify itself as the original publisher.
All articles are published under the Creative Commons Attribution license CC BY 3.0. Under this license, others may share and adapt the work for any purpose, provided appropriate credit is given and changes (if any) are indicated.
Authors may deposit and share the submitted version, accepted manuscript, and published version, provided the original publication in Informatica is properly cited.







