Clear Sky Science · en

TSFabrics: A Time-Series Fabric Dataset for Real-Time Defect Detection on Circular Knitting Machines

· Back to index

Watching Cloth as It Comes to Life

When we buy clothes or bed sheets, we rarely think about the machines that endlessly knit fabric in factories. Yet a single unnoticed flaw in that flowing cloth can turn into wasted material and higher costs. This article introduces TSfabrics, a new kind of image dataset that helps computers watch fabric in real time, frame by frame, so they can spot real flaws while ignoring harmless marks that naturally appear during production.

Figure 1
Figure 1.

From Still Photos to Moving Fabric

Most existing fabric inspection datasets are built from single, isolated photos. These snapshots may work well in a lab, but they fail to capture how cloth is actually produced on circular knitting machines, where fabric emerges in a continuous stream. In real factories, cameras stare at the same patch of moving fabric and capture a rapid sequence of images over time. The authors argue that training detection systems only on still images leaves a gap: models that look good on paper may fail when deployed on a real production line, where texture and lighting constantly shift.

Why “Cutlines” Are Not Mistakes

Circular knitting machines periodically mark the fabric with thin lines, known as cutlines, that guide later cutting and handling. In a still image, a cutline looks a lot like a defect because it breaks the regular texture of the cloth. Older datasets often treat any such irregularity as damage. As a result, models trained on them might raise false alarms whenever they see these intentional marks. TSfabrics tackles this by including both defect-free samples and images where cutlines are clearly present but labeled as normal. Pixel-level annotations explicitly distinguish cutlines from true flaws, teaching systems that not every odd-looking line deserves a stop-the-line warning.

Capturing Real Factory Conditions

TSfabrics consists of 93,196 grayscale images recorded as time-series sequences across 22 real production scenarios. The fabric comes from a double-jersey circular knitting machine producing three common knit structures. The camera captures at a steady 30 frames per second while the machine speed and fabric type vary, so some sequences show many overlapping views per rotation and others only a few. Lighting is allowed to change naturally, ranging from dark to bright conditions, just as it would in a busy mill. The dataset covers both defect-free runs and seven real defect types, including dropped stitches, holes, lint, oil stains, fabric distortions, and color bands, all carefully marked at the pixel level.

Figure 2
Figure 2.

How Time Series Help Spot Trouble

By keeping full image sequences instead of cherry-picked frames, TSfabrics lets detection models use not just what the fabric looks like in one moment, but how its texture evolves over time. The authors build a baseline system that combines a 3D neural network, which can see motion across consecutive frames, with a memory component that tracks patterns. Using this setup, they test how well detection holds up when lighting changes or when the machine runs slower or faster than in training. They find that models perform strongly when lighting and speed match training conditions, but accuracy drops sharply under new lighting, especially when scenes become darker. Models also cope better with higher-than-expected machine speeds than with slower ones, where more frames per rotation can confuse a system that has not seen such dense sampling before.

What This Means for Everyday Textiles

For non-specialists, the key message is that inspecting fabric in motion is very different from checking a stack of still photos. TSfabrics brings researchers closer to the real world by capturing continuous streams of fabric images under shifting speeds, lights, and materials, and by carefully labeling what is truly defective and what is simply part of the process, like cutlines. This richer view should help future automated inspectors focus on the flaws that matter, reduce waste, and support more reliable quality control in the textiles that end up in our closets and homes.

Citation: Ni, YQ., Huang, PK., Wang, WJ. et al. TSFabrics: A Time-Series Fabric Dataset for Real-Time Defect Detection on Circular Knitting Machines. Sci Data 13, 379 (2026). https://doi.org/10.1038/s41597-026-06748-9

Keywords: fabric defect detection, industrial vision, time series imaging, textile manufacturing, quality control