# Learn-normal inspection architecture

### What this page covers

IntelFactor uses a *learn-normal → detect-deviation* approach for product inspection.

It is designed for edge-first continuity and evidence-backed outcomes.

Related reading:

* [Core principles](/doc/home/start-here/core-principles.md)
* [System overview](/doc/home/start-here/system-overview.md)
* [Edge pipeline overview](/doc/home/edge-pipeline/edge-pipeline-overview.md)
* [Evidence & retention policy](/doc/home/edge-pipeline/evidence-and-retention-policy.md)

***

### 1. Two inspection paradigms

Both paradigms can use learn-normal methods.

They differ in what they treat as the “unit of truth”.

| Dimension          | Process monitoring (line-level)        | Product inspection (unit-level)      |
| ------------------ | -------------------------------------- | ------------------------------------ |
| Primary signal     | Rhythm, cycle timing, station behavior | Visual conformity of each unit       |
| ROI modeling       | Whole-scene or station-wide            | Per-component ROI modeling           |
| Operator workflow  | Video review and triage                | Structured fast review loop          |
| What you optimize  | Process reliability                    | Quality + yield                      |
| Offline continuity | Often unspecified                      | Required for continuity              |
| Promotion path     | Optional                               | Anomaly → defect class (when stable) |

{% hint style="info" %}
IntelFactor is intentionally **product-level**.\n\nIt treats each inspected unit as ground truth for traceability and yield.
{% endhint %}

***

### 2. IntelFactor architecture: learn normal at the product layer

IntelFactor learns what “normal” looks like per station and SKU.

It detects deviations and stores evidence locally, even during outages.

#### 2.1 Core edge pipeline

```mermaid
flowchart LR
  CAM[Industrial camera / RTSP] --> EDGE[Edge station]
  EDGE --> ROI[ROI + preprocessing]
  ROI --> EMB[Backbone CNN\nEmbeddings]
  EMB --> ANOM[Patch anomaly model\nDistribution / kNN]
  EMB --> DET[Supervised detector\nWhen mature]
  ANOM --> GATE[Deterministic PASS/FAIL gate]
  DET --> GATE
  GATE --> OUT[Integration outputs\nMES / PLC / API]
  GATE --> BUF[Local evidence buffer\nNVMe]
  BUF -->|Async sync| CLOUD[(Optional cloud)]
```

{% hint style="info" %}
**Design principles**

* Edge-first critical path (no cloud dependency)
* Deterministic gating (thresholds + geometric constraints)
* Evidence-first outcomes (buffer locally, sync later)
* Bounded responsibility (IntelFactor reports outcomes; control stays external)
  {% endhint %}

***

### 3. The compounding learning loop

IntelFactor improves through structured review and promotion.

The goal is fewer false positives and more actionable defect classes over time.

```mermaid
flowchart TD
  NORM[Capture normal images\nPer station / SKU] --> BASE[Build baseline\nEmbedding distribution]
  BASE --> RUN[Run edge inspection]
  RUN --> QUEUE[Queue top anomalies]
  QUEUE --> OP[Operator review\nConfirm / false positive / override]
  OP --> UPDATE[Update baseline + thresholds]
  OP --> PROMOTE[Promote stable pattern\n→ defect class]
  PROMOTE --> DATASET[Snapshot dataset\nTraining format]
  DATASET --> RETRAIN[Retrain supervised model]
  RETRAIN --> EVAL[Evaluate + approve]
  EVAL --> DEPLOY[Deploy to edge]
  UPDATE --> RUN
  DEPLOY --> RUN
```

***

### 4. What improves over time (and why)

#### 4.1 Product-level precision

Unit-level inspection enables:

* Component-level ROI segmentation
* Multi-camera fusion (front + side)
* Defect density metrics per batch
* First-pass yield tracking

***

#### 4.2 Deterministic decision layer

Model scores are not the final decision.

IntelFactor uses deterministic gates so outcomes stay predictable:

* Confidence thresholds per inspection rule
* Minimum anomaly area filters
* Temporal persistence requirements (optional)
* Outcome metadata tied to evidence

{% hint style="success" %}
Determinism makes deployments easier to validate.\n\nIt also makes operations safer during change.
{% endhint %}

***

#### 4.3 Drift + stability scoring

Factories drift. Lighting changes. Materials change.

IntelFactor tracks stability signals so drift becomes visible:

* Embedding centroid drift
* Anomaly inflation rate
* Review queue volume spikes
* Lighting variance shifts

When stability drops, IntelFactor can guide recalibration:

* Capture a refreshed “normal” baseline
* Compare deltas against the prior baseline
* Require approval before production threshold changes

***

#### 4.4 Hybrid promotion strategy (anomaly → defect class)

Anomalies are discovery.

Defect classes are how you scale.

IntelFactor supports promotion when a pattern is stable:

* Cluster repeat anomalies
* Name the defect type
* Train a supervised detector when labels are mature

Typical outcomes:

* Fewer false positives over time
* Better structured analytics
* A growing defect taxonomy

***

### 5. Integration outputs (production-friendly)

IntelFactor produces PASS/FAIL outcomes at the edge.

It can publish outcomes for integration, such as:

* API events to MES / QMS
* Discrete I/O or fieldbus signals to a PLC (site-owned logic)
* Evidence references for traceability

{% hint style="warning" %}
IntelFactor does not replace PLC logic or safety systems.\n\nSites remain responsible for actuation logic and safety validation.
{% endhint %}

***

### 6. Risks & mitigations

| Risk              | Mitigation                                |
| ----------------- | ----------------------------------------- |
| False positives   | Operator feedback loop + threshold tuning |
| Lighting drift    | Stability scoring + guided recalibration  |
| Product variants  | Per-SKU baselines and ROI configs         |
| Internet outage   | Local buffering + offline continuity      |
| Model regression  | Evaluation gates before deploy            |
| Operator friction | Fast review UX with minimal clicks        |

***

### 7. Guardrails

{% hint style="danger" %}

* No “text trains vision” claims
* No cloud dependency in the inspection critical path
* No auto-deploy of new models without evaluation
* No outcomes without evidence (heatmaps + artifacts)
  {% endhint %}

***

### 8. Example rollout plan (30 / 60 / 90 days)

{% stepper %}
{% step %}

### First 30 days

* Deploy an anomaly baseline on the edge
* Stand up deterministic gating
* Validate evidence capture + retention
* Start the operator review loop
  {% endstep %}

{% step %}

### Next 60 days

* Add stability scoring
* Enable anomaly clustering
* Add defect promotion workflow
* Add model evaluation gates
  {% endstep %}

{% step %}

### Next 90 days

* Add multi-camera fusion where needed
* Expand per-SKU baseline support
* Add yield analytics
* Harden offline resilience and rollback behavior
  {% endstep %}
  {% endstepper %}

***

### 9. Summary

IntelFactor applies learn-normal methods to **unit-level inspection**.

It pairs those methods with deterministic gates and evidence.

It is designed for real constraints: latency, outages, and drift.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://intelfactor.gitbook.io/doc/home/start-here/learn-normal-inspection-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
