# 086. Inspection luminosity profiles

**Question:** Which fault classes have different observed image contrast and luminosity profiles?

## Result

The largest computed metric is 86 for K_Scatch; the smallest is 24.5 for Stains. Metric: median_contrast (Source luminosity range).

Contrast depends on image acquisition and is not a causal explanation of manufacturing faults.

![Inspection luminosity profiles](outputs/chart.png)

| fault | records | median_contrast | median_luminosity_index |
| --- | --- | --- | --- |
| Bumps | 402 | 35 | -0.1431 |
| Dirtiness | 55 | 28 | -0.0884 |
| K_Scatch | 391 | 86 | -0.1563 |
| Other_Faults | 673 | 28 | -0.1188 |
| Pastry | 158 | 44 | -0.179 |
| Stains | 72 | 24.5 | -0.00255 |
| Z_Scratch | 190 | 27 | -0.1646 |

The chart shows 7 of 7 result rows; the table previews the first 7 in the analysis-defined order. [Download the full result table](outputs/results.csv). Numerical values are computed from the source; missing results stay unavailable.

## Method

Derived image contrast and class-level median sensor summaries.

The study uses shared source preparation and reusable statistical routines. Its specific transformations are in [analysis.py](analysis.py), and common model/evaluation code is in [portfolio/methods.py](../../portfolio/methods.py). The [notebook](analysis.ipynb) executes the study and displays the saved results.

## Decision and limitations

Evaluate acquisition consistency and whether lighting conditions influence recognition.

Every source row is a recorded fault. The data cannot estimate a production defect rate or distinguish healthy plates. Batch and machine IDs are absent, so grouped exact-input holdouts do not prove factory transfer. 

Related studies may share observations or holdouts. These are focused analytical studies, not independent replications or deployed business systems. Any model refinements informed by these results need new untouched evaluation data. No commercial impact is inferred from an association or backtest.

## Reproduce

From the repository root, after installing `requirements.txt`:

```powershell
python projects/086-inspection-luminosity-profiles/analysis.py
```

Source data are downloaded automatically if absent. Original archives are retained unchanged and checked by SHA-256. The cleaned cache normalizes column names; field-specific changes are visible in [data preparation](../../portfolio/data.py). Runtime evidence is in [receipt.json](outputs/receipt.json).

## Source

[Steel Plates Faults](https://archive.ics.uci.edu/dataset/198/steel+plates+faults), Buscema, Terzi and Tastle (2010). [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Source data are transformed and aggregated in this study. [Source provenance](../../data/provenance/steel.json) and [prepared-data audit](../../data/provenance/steel_prepared.json) record the downloaded files, field coverage and hashes.
