← Latest papers
💻 computer science

Low Cost Two-Stage Fabric Defect Detection at the Edge

This paper presents a low-cost, two-stage fabric defect detection system deployed on an NVIDIA Jetson Nano that uses a compact autoencoder to triage frames for a YOLOv5n detector, achieving high recall while revealing that its observed speedup stems primarily from parallelized JPEG decoding rather than the cascade architecture itself.

Original authors: Rasel Hossen, Diptajoy Mistry, Mosaddek Hossain Kamal

Published 2026-08-18
📖 6 min read🧠 Deep dive

Original authors: Rasel Hossen, Diptajoy Mistry, Mosaddek Hossain Kamal

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

In the bustling garment factories of Bangladesh, the second-largest exporter of ready-made clothing in the world, the quality of the final product depends entirely on the fabric. Before a single shirt is cut, rolls of cloth must be inspected for holes, oil stains, and tangled threads. For decades, this inspection has been a human task. Workers stand before moving rolls of fabric, their eyes scanning for imperfections until fatigue sets in, leading to inconsistent results and slow production lines. While automated machines exist, they are often too expensive and power-hungry for the small and medium-sized mills that drive the local economy. The challenge for these factories is not just finding defects, but doing so with a computer that costs about one hundred dollars and runs on very little electricity. This is where the work of researchers at the University of Dhaka comes in, attempting to build a system that can see what a tired human eye might miss, but without the cost of a supercomputer.

The researchers approached this problem with a strategy borrowed from decades of computer vision history: do not check everything with your most powerful tool. Instead, use a quick, cheap filter to screen out the obvious, normal items, and save the heavy lifting for the few things that look suspicious. They built a two-stage system to test this idea. The first stage is a compact, lightweight program designed to recognize what "normal" fabric looks like. If the fabric looks normal, the system discards the image and moves on. If the fabric looks strange, the system flags it and sends it to a second, more powerful program that identifies exactly what the defect is. This entire process was deployed on a small, affordable device called the NVIDIA Jetson Nano, which is designed to run complex tasks in places where large servers cannot go.

The team trained their first stage on thousands of images of perfect fabric, teaching it to reconstruct the image of the cloth in its mind. When the fabric is perfect, the reconstruction is easy and accurate. When there is a defect, the system struggles to recreate the image, and that struggle signals an anomaly. To make this screening more effective, they added a few clever tricks to the software, such as focusing more on the edges of the fabric where defects often hide and learning from a pre-trained expert system to better understand what a defect looks like. This first stage acts as a gatekeeper. In their tests, this gatekeeper flagged all twenty defective images in a specific set of two hundred and forty-nine pictures, but the researchers caution that this result is an in-sample calibration outcome rather than a proven independent estimate, with a wide confidence interval suggesting the true recall could be lower. However, it was not perfect at ignoring the good ones; it flagged nearly half of the clean fabric as suspicious, forcing the second stage to work harder than hoped.

The second stage uses a well-known object detection system to look at the flagged images and pinpoint the exact location of the hole, oil spot, or thread error. Because this stage is more computationally expensive, the researchers hoped that by filtering out the normal images first, the system would run much faster overall. They measured the speed of their two-stage system against a system that ran the heavy detector on every single image. The two-stage system was indeed faster, processing about thirteen and a half images per second compared to just under ten for the heavy-only system. This improvement looked like a success, but the researchers decided to dig deeper to understand exactly where that speed came from.

What they discovered was surprising and important for anyone trying to build similar systems. When they broke down the time spent on each task, they found that the speedup did not come primarily from skipping the heavy detector. Instead, it came from how the computer handled the images. The system was able to read the image file from the disk and process the next image at the same time, effectively hiding the time it took to load the data. The actual saving from skipping the heavy detector was quite small, accounting for less than ten percent of the total speed gain. The reason for this small saving was that the first stage was still sending so many false alarms that the second stage had to run on more than half of all the images anyway.

This finding shifts the focus of the problem. The researchers realized that on this specific type of small computer, the bottleneck is not the intelligence of the detector, but the speed at which the images can be fed into it. The system was spending more time loading images than it was spending analyzing them. Furthermore, because the first stage was sending so many false alarms, the system was not truly taking advantage of the rarity of defects. The researchers calculated that if they could tune the first stage to be more careful and send fewer false alarms, the system could save significantly more time, potentially reducing the work the second stage has to do by nearly half. However, making the first stage more careful risks missing real defects, a trade-off that requires careful balancing.

The study concludes that while this two-stage system works and fits on a low-cost device, the common belief that cascading systems automatically provide massive speedups needs to be viewed with caution. The speed gain they observed was mostly a result of efficient data handling, not the filtering itself. For factories looking to adopt this technology, the most effective next step is not necessarily building a smarter detector, but rather fine-tuning the sensitivity of the first stage to reduce false alarms and ensuring the data pipeline is as smooth as possible. The system serves best as an assistant to human workers, helping them triage which rolls of fabric need a closer look, rather than as a fully autonomous replacement. It proves that advanced artificial intelligence can run on humble hardware, but it also shows that the path to speed is often found in the plumbing of the system, not just in the brain.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →