Three materials, one apparently identical task, and three physically unrelated problems. On wood, the defect must be distinguished from a natural pattern that resembles it. On textile, it appears as a break in a regular weave, on a substrate that deforms between acquisitions. On glass, a defect must be made visible on a surface that light passes through.
That diversity explains why a defect detection solution proven on one material does not transfer to the next. What transfers is the method: how lighting is designed, how the ontology is built, how quality is measured. What does not transfer is the optical setup, the model and the corpus.
This article compares these three families through their specific constraints, complementing the complete guide to defect detection and the article on metal surfaces, whose problems are different again.
Why the material changes the defect detection problem
Three axes are enough to place any material in defect detection and to anticipate most of its difficulties. They combine, and it is their combination rather than any one of them that sets the difficulty.
The first is background pattern, and it is the one that most directly determines annotation difficulty. A plain surface makes any irregularity obvious; a heavily textured one forces normal irregularity to be distinguished from abnormal. The second is optical behaviour. A diffusing surface photographs simply, a reflective one requires control of lighting geometry, a transparent one poses a different kind of problem since the image also contains whatever lies behind. The third is natural variability. A homogeneous manufactured material allows normality to be defined by a template; a natural material does not, and the boundary between acceptable variation and defect becomes a convention.
Placed on those axes, the three materials of this article separate cleanly. Wood combines a textured background with maximal natural variability. Textile combines a regular background with deformability. Glass combines a uniform background with transparency. Each therefore pairs one major difficulty with a relative advantage, and identifying that pairing is the work of scoping.
Wood: the defect against the natural pattern
Wood is the defect detection case where the boundary between normal singularity and defect is blurriest, because that boundary is commercial rather than physical.
A knot is not always a defect
This is the point teams from other sectors misunderstand most. A knot arises where a branch meets the trunk. It is not a manufacturing anomaly but a characteristic of the material, whose acceptability depends entirely on the intended use. It still has to be qualified: a reference dataset explicitly distinguishes live knots from dead knots, the former being structurally integrated and colour-consistent, the latter darker, cracked and loosely attached. The distinction is visual, but it is above all structural: the second compromises strength and detaches, the first does not.
The same source notes that knot detection still relies largely on manual visual inspection, described as labour-intensive, subjective and inconsistent. That subjectivity is exactly what the annotation protocol must reduce, and it does not reduce without written criteria.
Three documented difficulties
An analysis of the limits of standard architectures applied to wood identifies three recurring obstacles: repeated down-sampling suppresses the weak edge responses of hairline cracks and micro-defects, convolution-based aggregation blurs low-contrast boundaries against intricate grain textures, and deep fusion entangles defect cues with repetitive natural patterns, leading to false positives.
These three translate directly into requirements on annotation and corpus. Loss of fine detail requires working at sufficient resolution and not underestimating the resulting cost. Blurred boundaries require a written delineation convention for diffuse alterations. And confusion with natural pattern requires the corpus to contain large numbers of examples of pronounced grain without defect, otherwise the model learns that any strong texture is suspect.
High defect density
One consequence of that variability is counterintuitive. Unlike manufactured industry where defects are rare, wood presents many. A large-scale dataset reports up to sixteen defects in a single image, and ten catalogued types including several kinds of knots, cracks, blue stains, resin pockets and marrow. The class imbalance problem, central elsewhere, therefore presents differently: the difficulty is not finding defects but annotating them all, and cost per image becomes high.
Grading rather than rejecting
A final particularity, and probably the most structuring of all: wood is graded, not scrapped. A piece showing singularities is downgraded to a less demanding use, not discarded. The expected system output is therefore not a binary decision but a commercial grade assignment, which presupposes that annotation captures the nature, size and position of each singularity rather than its mere presence.
Textile: the break in the weave
Textile presents almost the exact opposite profile to wood: a very regular background, which eases detection, and a deformable substrate, which complicates it.
The defect as texture disruption
The logic of the domain is well summarised in the texture analysis literature: surface abnormalities disturb the primary texture of the surface, which establishes a close relationship between texture analysis and defect detection. On fabric, the weave forms a periodic pattern, and a defect manifests as a local break in that periodicity: missing thread, double thread, hole, stain, tension deviation.
That property makes regularity-based methods particularly effective, including inexpensive classical approaches. It also explains why unsupervised anomaly detection works well on this material, normal appearance being highly predictable.
Substrate deformation
The main difficulty of this material is mechanical rather than optical. Fabric stretches, folds, ripples, and its geometry differs from one acquisition to the next. Any template-comparison method becomes inoperative, and annotation must account for the fact that the same defect can appear stretched, compressed or partly hidden by a fold. The protocol must specify how folded areas are handled: explicitly excluded or annotated as uninterpretable, never left to individual judgement.
Colour and printed patterns
A further difficulty arises on printed or complex-patterned fabrics: the background stops being a regular weave and becomes a design, which deprives periodicity-based methods of their main support. A patterned fabric is then handled more like wood than like a plain cloth, and the corpus must cover every pattern in the range. Projects that overlook this end up with a system effective on plains and unusable on printed collections, which is often the most profitable part of production.
In-line inspection and its limits
Textile is one of the few domains where automated in-process inspection has existed for several decades. A review of the field nonetheless notes two persistent limits: these systems detect defects but do not measure them quantitatively with precision, they are prone to inevitable machine vibrations, and feedback loops for fault prevention are not established.
Those limits remain instructive for a project starting today. Detecting is not enough if the fabric grading rule rests on measurements, as the penalty-point systems used in the trade do. Annotation must therefore capture the length or area of the defect, not only its position.
The inspection unit
One last convention has to be fixed. Fabric is a continuous product, which raises the same question as coiled strip: what constitutes an inspected unit? Since grading is generally done by roll or by piece, with penalties accumulated per unit length, annotation must retain position along the roll. That information cannot be reconstructed afterwards from images alone.
Glass: seeing what is transparent
Glass poses by far the most unusual defect detection problem of the three, because the object being inspected does not stop light.
The optical difficulty
The problem arises in terms intuition does not prepare you for. On an opaque surface, the received image comes from the surface. On a transparent surface, it comes from the surface, from within the material and from the background simultaneously. Three consequences follow: surface defect contrast is intrinsically low, the background becomes an acquisition parameter to control, and defect depth, surface or bulk, must be distinguished although it is not directly observable.
A study on automotive headlight lenses summarises the obstacles: transparent glass defect detection faces a wide variety of defect shapes and sizes as well as the challenge of identifying transparent surface defects, and the response adopted is multi-angle lighting.
Lighting as the primary answer
It is on this material that optical design produces the widest gap between a project that succeeds and one that fails. Three configurations do most of the work here. Dark-field lighting turns a scattering defect into a bright point on a black background, which solves much of the contrast problem. Transmitted lighting reveals inclusions and bubbles. A structured pattern projected through the part reveals optical distortion and flatness defects through the pattern’s deformation.
The practical consequence is that a glass defect detection project begins with the optical bench, and that images acquired under several configurations must be associated with the same object. The ontology must then specify, for each defect type, under which configuration it is authoritative.
The public data gap
Anyone starting a glass project should know this before budgeting. The same study flags a structural problem: the few existing glass defect datasets are small in scale, most are based on smartphone screen glass which is not transparent, and they suffer from class imbalance. In other words, there is no usable public starting point for genuinely transparent glass, and a project must build its corpus entirely from scratch.
Leather, stone and other natural materials
The three families covered here account for the most frequent cases, but they are not isolated. Leather, natural stone, paper, ceramic and composites fall under the same axes of analysis and simply sit at different positions along them.
Placing them is straightforward once the axes are understood. Leather resembles wood in its extreme natural variability and in the fact that its singularities, marks from the animal’s life, are acceptable or not depending on use. It differs in having no regular directional pattern, which makes the background less predictable still. Stone shares wood’s pronounced texture with even greater variability between blocks, and its commercial grading rests largely on appearance. Paper and non-wovens resemble textile in their regularity and continuous form, without the weave’s deformability.
For a defect detection project on a material not covered here, the useful approach is to place it along the three axes, background pattern, optical behaviour and natural variability, then borrow the conventions of the nearest material rather than starting from nothing.
Who decides what counts as a defect
On these materials more than on any other, the annotation protocol cannot be written by the vision team alone. The judgement being encoded belongs to graders who have spent years acquiring it, and it is largely tacit.
The practical route is to have several experienced graders annotate a small shared set first, then examine their disagreements rather than average them away. Those disagreements map precisely onto the cases where the commercial rule is unclear, and resolving them produces both a usable protocol and, frequently, a clarification the quality department finds valuable independently of the vision project.
The alternative, writing the protocol from a standard and handing it to annotators, produces a corpus that is internally consistent and disconnected from the grading actually practised. The system then performs well against its own ground truth and disagrees with the people it is meant to assist, which is the worst possible outcome for adoption.
What these materials share
Despite their differences, these three families share a trait that separates them sharply from conventional manufactured industry: the conformity decision is partly commercial.
This is an important shift, and it changes the nature of the ontology to be built. On machined metal, a dimension either conforms or does not. On wood, textile and glass, the same singularity is acceptable for one use and disqualifying for another, and the threshold is negotiated with the end customer. That reality has two annotation consequences. First, the ontology must be descriptive rather than decisional: it records what is present, with the grading rule applied afterwards. Second, the same annotation must be able to serve several rules, which argues for fine granularity and for retaining measurable attributes.
They also share a strong representativeness requirement. Species and provenance for wood, weave and fibre for textile, thickness and tint for glass: each of these parameters alters normal appearance, and a corpus covering only one value will produce a model unusable on the others.
Defect detection annotation, material by material
The differences between materials translate into concrete choices of annotation primitive and protocol.
On wood, the useful primitive is generally the bounding box or polygon, with attributes for type, size and position, since the grading rule draws on all three. The high density of singularities requires systematic sweeping and count-based control, closer to enumeration practice than to conventional detection.
On textile, the primitive must support measurement, hence polygon or mask rather than box, and position along the piece must be retained as metadata. A class for folded or uninterpretable areas is indispensable.
On glass, each defect must be tied to the lighting configuration under which it is visible, and the distinction between surface and bulk defect should appear as an attribute where the setup allows it. It is also the material where the image reject class is most used, since stray reflections are frequent.
Natural variability and the definition of normal
One question runs through all three materials and deserves treating on its own, because it is where projects most often stall: what counts as normal.
The contrast with manufactured parts is stark. On a manufactured part, normality is defined by a specification. On wood, textile and glass, normality is a distribution rather than a point, and its spread is wide. Two boards of the same species differ visibly; two rolls of the same reference differ in shade; two glass mouldings differ in internal stress pattern. A model trained on too narrow a slice of that distribution will flag ordinary variation as defect, which is the dominant false-alert mechanism on these materials.
The practical response has three parts. Sample the corpus deliberately across the full range of normal variation, which usually means collecting over a longer period than convenience suggests. Annotate a substantial quantity of defect-free material rather than only defective examples, since the model needs to learn the breadth of normality. And record the material parameters, species, batch, weave, tint, as metadata, so that later analysis can establish whether a performance problem is a defect problem or a normality problem. Without that metadata the two are indistinguishable.
Comparative cost across the three materials
The three families are not budgeted alike, and the gap comes from different factors in each case.
Wood is the most expensive per image by a clear margin, given the density of singularities to annotate and the ambiguity of their limits. The multiplier is the number of species to cover, each effectively constituting a sub-corpus. Textile is the cheapest per annotated unit, the regular weave making defects sharp, but the volume to traverse is high since the product is continuous and the defect rate low. Here the multiplier is the number of weaves and colourways.
Glass sits somewhere in between on annotation cost but demands the heaviest initial investment, since no usable public dataset exists and the optical bench governs everything else. On this material, optical design and initial corpus construction represent a share of the budget with no equivalent in the other two cases.
Quality control of defect detection by material
Control stratification in defect detection must follow the dominant variability factor, which differs by material.
For wood, the relevant stratification is by species and grain intensity, since the background pattern determines difficulty. For textile, it is by weave and colour, a dark tightly woven fabric having nothing in common with a light plain cloth. For glass, it is by lighting configuration and thickness.
In all three cases, inter-annotator agreement must be measured separately within each stratum. Satisfactory overall agreement on a corpus mixing several species or weaves says nothing about consistency within each, and it is that consistency which determines what the model can learn.
The most common mistakes
These failures recur often enough across material inspection projects that naming them is usually enough to avoid them.
- Transposing an optical setup validated on one material to another.
- Building a decisional ontology where the grading rule varies by customer.
- On wood, not distinguishing knot types although their structural consequence differs.
- On wood, underestimating the cost driven by high singularity density per image.
- On textile, providing no class for folded or uninterpretable areas.
- On textile, annotating presence without measurement although grading rests on penalties.
- On glass, neglecting control of the background, which is part of the image.
- On glass, relying on public datasets built on non-transparent glass.
- Not retaining position along a continuous product, information irrecoverable afterwards.
- Measuring inter-annotator agreement globally rather than per material stratum.
What to take away
The material determines the nature of the defect detection problem before any algorithmic consideration. Wood requires separating the defect from a natural pattern that resembles it, textile requires measuring on a substrate that deforms, glass requires making visible what is not spontaneously so. All three obstacles are addressed through optics and protocol, not through the choice of architecture.
Three decisions structure a successful project on these materials. Design the optical bench around the behaviour of the matter, accepting several configurations where necessary. Build a descriptive ontology fine enough to feed several grading rules, since conformity here is partly commercial. And cover from the initial corpus the diversity of species, weaves, tints or thicknesses that constitutes the material’s normal variability.
For approaches, general ontology and annotation tasks, the complete guide to defect detection sets the frame. For a material at the opposite end from those covered here, where defects are minute and geometry fully controlled, the article on PCB and electronic component inspection covers the constraints specific to micro-inspection.
To explore delivery arrangements, supported formats and applicable control mechanisms, see our dedicated page on annotation for industry. And if you are preparing an inspection corpus on wood, textile or glass and want the ontology and protocol scoped before production starts, let us discuss your project.