# How it works (https://docs.cochl.ai/docs/quality-inspection/how-it-works)



## Learned, not rule-based [#learned-not-rule-based]

A fault is not necessarily louder than normal; its sound pattern is different. The two spectrograms below show a normal unit and a faulty unit of the same product, on the same scale: a similar level, but a different pattern.

<img src="/images/quality-inspection/spectrogram-normal.png" alt="Spectrogram of a normal unit of product A over 3.5 seconds" />

<img src="/images/quality-inspection/spectrogram-fault.png" alt="Spectrogram of a faulty unit of product A on the same scale: similar level, different pattern" />

* **No hand-picked features.** No frequency bands, energy or level limits to choose.
* **No rules to configure.** The model learns what normal sounds like and makes the decision.
* **Judged by pattern, not loudness.** Timbre and structure, the way a trained listener hears it.

## Model architecture [#model-architecture]

One acoustic foundation model reads every machine. Only the normal reference is built for each product.

<Steps>
  <Step>
    ### Signal [#signal]

    Vibration or sound captured for each inspection cycle.
  </Step>

  <Step>
    ### Acoustic foundation model [#acoustic-foundation-model]

    Cochl's in-house model, kept fixed. Turns each cycle into an acoustic representation.
  </Step>

  <Step>
    ### Normal reference [#normal-reference]

    Built per product from normal recordings only.
  </Step>

  <Step>
    ### Anomaly score [#anomaly-score]

    Statistical distance from the normal reference, scaled 0 to 100.
  </Step>

  <Step>
    ### Decision [#decision]

    The score is compared with the threshold at 50 and returned as Pass or Fail. In the console, a sensitivity setting from 1 to 10 (6 is the trained operating point) moves where that line falls, and shows the expected false-alarm rate for each setting.
  </Step>
</Steps>

* **One model, many machines.** Motors, slide rails, gears, pumps and fans are scored with one model, for a mean AUROC of 99.6 across 16 datasets (see [Performance](https://docs.cochl.ai/docs/quality-inspection/performance)).
* **No per-product design.** No feature engineering per product. Building the normal reference is the setup.
* **Runs on site.** Training and inference run on the industrial PC, with no cloud.

## Training pipeline [#training-pipeline]

Training and retraining use normal operation data only. Defect samples are optional.

| When            | Stage              | What happens                                                                                                                |
| --------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| At installation | Data collection    | 100 to 200 normal cycles (at least 100) are recorded during regular production.                                             |
| Within an hour  | Model training     | The baseline is trained on the industrial PC, typically in under an hour.                                                   |
| Same day        | Inspection         | Inspection runs through the same process, sends results to the PLC when one is connected, and keeps collecting normal data. |
| Scheduled       | Continuous updates | The model is updated on a schedule or on demand with newly collected normal data.                                           |

* **Normal recordings:** 100 to 200 per product, at least 100. One recording per physical unit where possible.
* **Defect recordings:** not required to start. When available, they help calibrate the threshold.
* **Training runs:** started manually from the console, or automatically every day at a set time.

## Keeping the baseline current [#keeping-the-baseline-current]

When the line changes, the normal reference follows it through the same normal-data procedure.

| Change                    | Examples                                                         | What happens                                                                                                                                                                                                        |
| ------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Gradual drift             | Temperature, wear-in, small process variation                    | Daily retraining on recent normal data absorbs slow change on its own.                                                                                                                                              |
| Step change               | Mold or equipment change, part replacement, sensor re-attachment | Normal data is collected again and the model retrained by the same procedure. The retrained model is kept separate from the existing one.                                                                           |
| New defect types          | —                                                                | No retraining needed. A sound that differs from normal is judged Fail, whatever the defect type.                                                                                                                    |
| New products and variants | —                                                                | A new product or variant of a product type already supported gets its own normal data and training, by the same procedure. A product type without a pretrained model needs analysis development, quoted separately. |

## Sensing [#sensing]

Cochl supplies the sensors. Where and how a sensor is mounted decides how well a defect can be detected. The models named below are examples; equivalent parts may be supplied.

<Tabs items="[&#x22;Vibration sensor&#x22;, &#x22;Microphone&#x22;]">
  <Tab value="Vibration sensor">
    Example model: **PCB 352C03**

    | Item        | Detail                            |
    | ----------- | --------------------------------- |
    | Type        | IEPE accelerometer, ceramic shear |
    | Sensitivity | 10 mV/g                           |
    | Range       | ±500 g                            |
    | Frequency   | 0.5 Hz to 10 kHz (±5%)            |

    Contact-mounted on the product or jig, so ambient noise has little effect.
  </Tab>

  <Tab value="Microphone">
    Example model: **PCB 378B02**

    | Item        | Detail                             |
    | ----------- | ---------------------------------- |
    | Type        | 1/2-inch free-field condenser, ICP |
    | Sensitivity | 50 mV/Pa                           |
    | Frequency   | 3.75 Hz to 20 kHz (±2 dB)          |
    | Connection  | BNC, straight into the DAQ         |

    Mounted separately at the station. Measures airborne sound without touching the unit.
  </Tab>
</Tabs>

### Vibration sensor mounting [#vibration-sensor-mounting]

* **Magnetic, detachable.** On exposed steel, or on a steel pad fixed to the product. Easy to move between candidate positions.
* **Jig, fixed.** The sensor stays on the inspection jig and each unit passes through it, so the position never varies.

Either way, the sensor must be attached at the same position under the same conditions for every inspection.

### Placement [#placement]

The sensor position is chosen during the feasibility check by comparing candidate positions. Detection depends strongly on where the sensor sits; see [Conditions that shape results](https://docs.cochl.ai/docs/quality-inspection/performance#conditions-that-shape-results).
