Every bottling line eventually produces a bottle it shouldn’t: a hairline fracture, a chip along the rim, a smear of contamination on the glass. Catching such defects automatically is a deceptively hard problem, not because the flaws themselves are complex, but because they are rare. A line can run for hours before producing a single bad unit, so there is rarely enough labeled defect data to train an ordinary classifier the way one might train a model to tell cats from dogs. The more practical framing, used in a recent study by the engineering team, is one-class learning: show a model thousands of images of what “good” looks like, and ask it to flag anything that deviates from that picture, without ever showing it an actual defect during training.
The study set out to compare two very different ways of drawing that boundary: a classical ensemble method called Isolation Forest, and a quantum circuit known as a Variational Quantum Classifier (VQC). Both were tested on the bottle category of MVTec AD, a widely used industrial benchmark whose images are either defect-free or flawed in one of three ways — broken_large (major structural fractures), broken_small (minor chips and cracks), or contamination (surface stains and deposits).
A shared starting point
To keep the comparison fair, both branches share an identical front end. Each 900×900 pixel image passes through a convolutional network pretrained on ImageNet with its final classification layer removed, producing not a label but a 2048-number fingerprint of the image’s visual texture and structure. Those numbers are standardized using statistics from the training set of good bottles only, so no information about the defects leaks into preprocessing, then compressed to just 10 dimensions with principal component analysis. Despite that aggressive compression, the ten retained components capture roughly half of the total variance in the embeddings — enough, it turns out, to separate the two classes; the first three components alone account for more than a quarter of it. Because both branches inherit these same ten numbers, any difference in performance downstream comes from how each classifier reasons over them, not from how the features were extracted.
Branch one: an old, reliable idea
The classical branch relies on Isolation Forest, which identifies outliers through a simple insight: anomalies are easier to isolate than normal points. The algorithm builds an ensemble of trees that split the data along random feature thresholds, and a point that differs from the bulk of the data tends to need far fewer splits before it sits alone in its own partition. This implementation used 400 such trees, fit exclusively on the compressed embeddings of defect-free bottles, and reached 91.6 percent accuracy on the test set, with a strong 98.3 percent precision on the anomaly class — it rarely cried wolf. Its weakness showed up in recall: it missed six defective bottles, mostly small chips and low-contrast contamination sitting close enough to normal texture variation to slip past the boundary.
Branch two: encoding a bottle into ten qubits
The quantum branch takes the same ten PCA values and uses each as a rotation angle, applying a Ry gate to initialize one qubit per feature. This “angle embedding” turns a classical vector into a quantum state living in a 1,024-dimensional Hilbert space, since ten qubits span two-to-the-tenth possible basis states. From there, the circuit applies three Strongly Entangling Layers: each one rotates every qubit through a further sequence of parameterized gates, then links neighboring qubits in a ring using CNOT gates, so the state of each qubit becomes correlated with its neighbor’s.
The full circuit has 90 trainable parameters, tuned with the Adam optimizer over 80 epochs, again using only defect-free images. Training pushes good bottles toward a state where all ten qubits are measured as zero; a bottle’s anomaly score is then one minus that measured probability, with the cutoff set at the 90th percentile of scores observed during training, 0.9972. The appeal of this design, in theory, is that entanglement lets the circuit represent joint, nonlinear relationships between the ten features that a tree-based model doesn’t naturally capture — though whether that theoretical appeal shows up in practice is the actual question the experiment set out to answer.
What the numbers say
The quantum circuit edged out the classical baseline, reaching 92.8 percent accuracy against 91.6, with recall improving to 93.7 percent from 90.5 — three additional defects caught, by the team’s count. It gave up a little precision in exchange, 96.7 percent versus the Isolation Forest’s 98.3, tripped up by two good bottles that scored between 0.998 and 0.999, just over the line. The quantum scores overall were sharply polarized: the great majority of defective bottles scored almost exactly 1.000, while good bottles spread more broadly across lower values, which suggests the cutoff is a reasonably stable one rather than a lucky draw. Both models, notably, stumbled on the same kind of case — subtle, low-contrast defects that resemble normal surface texture — which hints that the bottleneck may sit upstream, in the shared feature extraction, rather than in either classifier.
It’s worth being precise about what this result does and doesn’t show. The VQC here ran as a simulation on classical hardware, not on an actual quantum processor, and training it took on the order of ten to a hundred times longer than fitting the Isolation Forest, since every gradient step requires simulating a ten-qubit state vector. A recall gain at that computational cost is an interesting empirical result on one specific dataset, not evidence of a general “quantum advantage.” Both classifiers also share the same structural limits: neither can point to where on the bottle a flaw sits, since both output a single score rather than a localized map, and both thresholds are only as trustworthy as how well the training set of good bottles represents real-world variation.
The more useful reading is as a well-controlled feasibility check: a modestly sized quantum circuit can match, and here slightly exceed, a strong and far cheaper classical baseline on a real industrial vision task. The natural next steps — running the same circuit on actual quantum hardware such as IBM’s or IonQ’s processors, blending its score with a classical reconstruction-error signal, and adding tools like Grad-CAM to localize defects rather than merely flag them — should show whether this early edge survives outside of simulation, and whether it is worth the bill.







