Clear Sky Science · en
Diamond-DETR: lightweight real-time quality evaluation algorithm for synthetic diamonds
Why tiny flaws in man-made diamonds matter
Synthetic diamonds are the unsung workhorses of modern industry, cutting, grinding, and polishing everything from metal parts to electronics. Their performance and price, however, depend on tiny surface imperfections—chips, cracks, and irregular shapes—that are hard for people to spot quickly under a microscope. This paper introduces Diamond-DETR, a compact artificial intelligence system designed to automatically inspect synthetic diamonds in real time, aiming to make quality checks faster, more reliable, and easier to deploy on ordinary factory hardware.

From human eyeballs to automated eyes
For decades, factories have relied on mechanical sorting methods and human experts peering through microscopes to judge diamond quality. Mechanical methods like vibrating screens or density-based separation struggle when particles are very small or very pure, and they cannot tell a perfect crystal from one with a chipped edge. Human inspection, while flexible, is slow, tiring, and subjective. As demand grows for precise, high-volume sorting of synthetic diamond particles, manufacturers need automated visual systems that can spot tiny defects quickly and consistently, even when particles are packed closely together or vary in size and shape.
Marrying local detail with the big picture
Modern computer vision tools fall broadly into two camps. Lightweight convolutional neural networks excel at picking up local details—like the sharpness of a corner—but can struggle to understand the broader context across an image. Transformer-based models, by contrast, are good at seeing the whole scene and handling long-range relationships, but tend to be heavy and slower, especially for real-time inspection. Diamond-DETR builds on a recent transformer detector called RT-DETR and reshapes it for industrial diamond inspection. The goal is to keep the strong global reasoning of transformers while trimming the computation and sharpening the network’s eye for subtle, small-scale geometric flaws on diamond surfaces.
A leaner inspection engine under the hood
The authors redesign three main parts of the detection pipeline. First, they swap the standard backbone network for a customized “RepFasterNet” block that processes only a fraction of image channels with more expensive spatial operations, then merges them efficiently. This step cuts the amount of computation while preserving key edge and corner details where defects often appear. Second, they introduce a high-level screening feature fusion pyramid, which uses an attention mechanism to let strong, high-level signals guide which lower-level details to emphasize or suppress across different magnifications. Third, they upgrade a cross-stage fusion module with dilated convolutions, effectively widening the area each neuron “sees” without making the network deeper. Together, these changes help the model recognize diamonds and their defects across a range of sizes and complex backgrounds, while still running fast on mid-range hardware.

Putting the system to the test
To evaluate Diamond-DETR, the team built their own microscope image dataset of synthetic diamond particles, labeling each instance as either high-quality or defective based on visible surface features. They compared the new model against the original RT-DETR and several well-known detectors, including popular YOLO variants and classic two-stage systems such as Faster R-CNN. On this in-house diamond dataset, Diamond-DETR improved precision, overall detection score, and processing speed while using fewer parameters than RT-DETR. Visual explanations using heat maps showed that the new model focused more tightly on meaningful geometric regions—especially edges and corners—than the baseline. In additional tests on a different industrial dataset of metal nuts, Diamond-DETR maintained strong performance, suggesting that its design generalizes to other manufactured parts defined by complex shapes.
What this means for factories and beyond
In practical terms, Diamond-DETR offers a more compact, accurate, and faster “automatic inspector” for microscopic diamond sorting lines. With a model size of only a few dozen megabytes and real-time processing speeds, it is well-suited for resource-limited setups that cannot host very large AI systems. The method is not a complete quality solution—it cannot see internal cracks or analyze chemical composition—but it provides a powerful visual front end that could be paired with other sensing tools. By showing that transformer-based detectors can be carefully slimmed down and tuned for fine geometric discrimination, this work points toward broader use of similar models in automated inspection of small industrial parts, from abrasives to fasteners, where tiny surface flaws make a big economic difference.
Citation: Yan, X., Yang, S., Zhang, S. et al. Diamond-DETR: lightweight real-time quality evaluation algorithm for synthetic diamonds. Sci Rep 16, 10711 (2026). https://doi.org/10.1038/s41598-026-44951-1
Keywords: synthetic diamonds, automated inspection, object detection, industrial vision, transformer models