Clear Sky Science · en
Confidence–gradient reweighting and lightweight feature enhancement algorithm for steel surface defect detection
Sharper Eyes for Steel Quality
From cars and bridges to smartphones, modern life depends on steel made with few defects. Tiny scratches, pits or inclusions on a steel surface can weaken products or shorten their lifespan, yet these flaws are often so small and low in contrast that even advanced cameras and software overlook them. This paper introduces GRACE, a new computer-vision method that helps automated inspection systems spot these subtle defects more reliably and quickly, aiming to improve both safety and manufacturing efficiency.
Why Small Flaws Are Hard to Catch
In steel mills and electronics factories, quality control teams rely on high-speed cameras and algorithms to scan every strip of metal as it rolls by. The challenge is that many defects are tiny, irregular in shape and barely stand out from the complex textures of the steel surface. Traditional rule-based systems depend on hand-tuned thresholds and handcrafted features, which can easily be thrown off by changes in lighting, noise or production conditions. Deep-learning systems have improved matters, but they still struggle with two key issues: first, some types of defects occur far less often than others, so the model tends to learn more from common patterns and ignore rare but important flaws; second, early layers of the network often lose the fine texture and edge details that distinguish a defect from harmless background patterns.

A Smarter Training Strategy
The GRACE algorithm builds on a modern, fast object-detection model called YOLO11s and adds two carefully targeted improvements. The first, called Dynamic Sampling with Confidence-Gradient Balanced Sampling Mechanism (DS-CBSM++), changes how the model is trained rather than how it looks at each image. During training, GRACE continuously monitors how confident the model is about each defect and how large the learning signal, or gradient, is for that class. Rare or low-confidence defect types, and images the model finds difficult, are sampled more often; easy, overrepresented cases are sampled less. This adaptive reweighting helps the network pay extra attention to hard, underrepresented defects without bloating the model or slowing it down during real-world use.
Lightweight Detail Enhancement
The second improvement, the Lightweight Feature Enhancement Network (Lite-FEN), focuses on the image details where small defects live. It attaches a compact attention module to an early feature layer, where edges and textures are most visible. Through simple channel and spatial attention operations, Lite-FEN boosts signals that look like meaningful structures—such as crack-like lines or tiny pits—while damping irrelevant background texture. Crucially, this extra processing adds only a small number of parameters and keeps computation low, so the detector still runs fast enough for real-time inspection on production lines.

Better Detection Across Datasets
To test GRACE, the authors evaluated it on three public steel surface defect datasets. On the widely used NEU-DET benchmark, GRACE improved a key accuracy score (mean average precision) over the base YOLO11s model, while keeping nearly the same speed and model size—about 9.56 million parameters and close to 60 images per second at standard resolution. The gains were especially strong for small, low-contrast defect types such as crazing and pitted surfaces. Additional experiments on two other datasets, GC10-DET and X-SDD, showed that GRACE’s advantages were not tied to a single collection of images: it continued to recover more true defects and produced sharper localization of flaw boundaries, even when background textures and defect types changed.
What This Means for Industry
For a non-specialist, the key message is that GRACE helps automated inspection systems see tiny, hard-to-spot flaws more clearly, without demanding larger computers or slower production speeds. By steering training toward rare and difficult examples and gently sharpening the model’s focus on fine textures, GRACE cuts down on both missed defects and spurious alarms, particularly in complex, noisy images that resemble real factory conditions. While the method has so far been tested offline on public datasets, its design is ready for integration into real production lines, where it could make steel products safer, more reliable and less wasteful to produce.
Citation: Chen, L., Guo, C., Wu, X. et al. Confidence–gradient reweighting and lightweight feature enhancement algorithm for steel surface defect detection. Sci Rep 16, 5676 (2026). https://doi.org/10.1038/s41598-026-36543-w
Keywords: steel surface defects, automated visual inspection, deep learning detection, small object detection, industrial quality control