5.9 Safety of AI components
ISO/PAS 8800 and dataset quality
What you will learn
- Explain the flow set out in ISO/PAS 8800 for using AI components safely (requirements, data, verification, monitoring in operation)
- Explain the aspects of dataset quality (coverage, correctness, independence, representativeness, traceability) and calculate how much test data each condition needs
- Confirm by calculation how label errors and data gaps make apparent performance diverge from real danger
Build intuition
As we saw in Part 3, learned AI components make mistakes — with nothing broken — in situations absent from their training data, or because of small differences in appearance. These are exactly the functional insufficiencies of 5.1. ISO/PAS 8800 (2024) sets out an approach to using such AI components safely, supplementing functional safety (ISO 26262) and SOTIF (ISO 21448) for AI. In summary:
- Derive requirements for the AI component (under which conditions, and with what performance) from the system’s safety requirements
- Set requirements for the datasets used for training, evaluation and testing as well, check their quality and manage their versions
- Verify performance by condition, robustness, uncertainty and so on
- Keep monitoring in operation, for unfamiliar inputs and the like
- Continue retraining and re-verifying with data from after release
For a pedestrian-detection component, for example, the requirements might read like this (examples):
| Aspect | Example requirement | How to check |
|---|---|---|
| Performance | Detect at least 99% of pedestrians within 60 m inside the ODD | Detection rate by condition with confidence intervals (5.3) |
| Robustness | Performance does not drop sharply with rain, low sun or a dirty lens | Tests with added corruptions (3.8) |
| Uncertainty | Confidences are calibrated | Reliability diagrams and ECE (3.7) |
| Out of distribution | Notice and report unfamiliar inputs | Out-of-distribution test data (2.8) |
| Timing | Deliver results within the allotted time | Measuring processing time (4.2) |
Because an AI component’s behaviour is determined by data, dataset quality is central to safety:
| Aspect | Meaning | Example |
|---|---|---|
| Coverage | Covers the ODD’s conditions sufficiently | Are there too few images of foggy nights? |
| Correctness | Few errors in the labels (ground truth) | Missed pedestrians, misaligned boxes |
| Independence | Training, evaluation and test data are not mixed | Images from the same drive do not appear in both (2.8) |
| Representativeness | Reflects the proportions of real situations | No bias such as all-urban data with no rural roads |
| Traceability | Where the data came from and how it was processed is known | Version control, records of labelling procedures |
The figure counts training images by ODD condition (weather × lighting). Even when the total number is large, looking at combinations of conditions reveals cells that fall short.
Check with math
① How much test data is needed?
Showing “a detection rate of at least 99% under this condition” means showing that the probability of a miss is at most 1%, so the rule of three from 1.8 applies directly. With zero misses, the number of pedestrians needed is
(with one miss, 4.7 ÷ 0.01 = 470). This is needed for each cell of conditions. Showing 99.9% in each of the 12 cells in the figure needs 3,000 per cell — 36,000 pedestrians in all. And since test data must not be used for training, it is collected separately from the training data.
② Label errors hide the weak spots
The ground truth (labels) of evaluation data contains errors too. The trouble is that the pedestrians people tend to miss when labelling — small, occluded, dark — are the very ones AI tends to miss. Suppose there are really 10,000 pedestrians and the AI detects 9,700 (a true detection rate of 97%). If the labellers missed 200 difficult pedestrians and the AI also missed 150 of those 200, then of the 9,800 labelled pedestrians the AI missed only 150, so
— higher than the truth. Label errors hide precisely the weak spots. For safety-related test data, correctness is checked by having several people label the same data and examining disagreements, re-reviewing difficult situations with particular care, and so on.
③ Data gaps are hard to see in averages
Of the cells in the figure, 6 of 12 (50%) meet the minimum, but weighted by driving time the covered cells account for 89% and the gap cells only 11%. The overall miss rate is, as in 2.8, the average of the miss rates by condition \(m_c\) weighted by the share of driving time \(w_c\):
If the covered cells have a miss rate of 1% and the gap cells 10%, then m = 0.89 × 0.01 + 0.11 × 0.10 ≈ 0.020 — more than half of all misses come from gap cells that make up only 11% of the time (illustrative numbers). Data gaps can become exactly where danger concentrates. The choice is then between adding data and taking those conditions out of the ODD.
In practice
- Requirements flow down from the system: from a system requirement such as “stop before the pedestrian”, derive requirements on detection distance, probability and time. Even if the AI component meets “99%” on its own, whether that is enough for the system is checked separately. → 4.2
- Data is a design artefact too: manage dataset requirements, versions and change records just like software. After retraining, re-verify with regression tests. → 4.6
- Don’t wear out the test data: tuning repeatedly against the same test data fits the model to that test data (just like the overfitting of 2.6). Keep the test data used for safety decisions set aside and untouched. → 2.6
- Keep watching in operation: when an unfamiliar input is noticed (out-of-distribution detection, 3.7), treat it like leaving the ODD. Find new data gaps from field data. → 3.7, 5.11 Post-deployment monitoring
- Combine metrics and testing methods: danger-weighted metrics, consecutive misses and comparisons on the same data (3.10), together with metamorphic testing, checks for negative flips and slice testing (3.11), are used to build the evidence for AI components. → 3.10, 3.11
- State the limitations honestly: document the conditions the AI component struggles with and the limits of its performance, and compensate on the system side (ODD restrictions, monitoring, other sensors). This is important material for the safety argument. → 5.10 Safety cases
Summary
- Most errors of AI components are functional insufficiencies that occur with nothing broken. ISO/PAS 8800 sets out a flow of deriving requirements for AI components and datasets from system requirements, verifying them, and monitoring in operation
- Showing 99% per condition takes 3/(1 − 0.99) = 300 test cases per cell. Label errors hide the AI’s weak spots and inflate apparent performance
- Data gaps can look small as a share of time yet produce most of the misses. Manage data for coverage, correctness, independence, representativeness and traceability
Quick quiz
Q1. To show a detection rate of at least 99.5% under one condition with zero misses, how many pedestrians of test data are needed?
3 ÷ (1 − 0.995) = 3 ÷ 0.005 = 600.
Q2. In ②, suppose that of 10,000 real pedestrians the AI detects 9,600, and of the 300 the labellers missed, the AI also missed 200. What is the apparent detection rate?
Of the 9,700 labelled pedestrians, the AI missed 400 − 200 = 200, so (9,700 − 200) ÷ 9,700 ≈ 97.9% — higher than the true 96%.
Q3. In ③, if the covered cells have a miss rate of 2% and the gap cells 20%, what is the overall miss rate? (Weights 0.89 and 0.11.)
0.89 × 0.02 + 0.11 × 0.20 = 0.0178 + 0.022 ≈ 0.040, about 4%.
Q4. “We have collected a million training images, so we have enough data.” What is wrong with this view?
However many images there are, there may be gaps when looked at by combination of ODD conditions (coverage). Label errors (correctness), mixing of training and test data (independence) and differences from real-world proportions (representativeness) also need checking.
Further reading
- Next lesson: 5.10 Safety cases
- Related: 2.8 Data splits and distribution shift, 2.6 Overfitting and regularization, 3.7 Uncertainty and calibration, 3.8 Robustness and adversarial examples, 5.3 Functional insufficiencies and triggering conditions, 1.8 Statistics of rare events (the rule of three)
- Glossary: ISO/PAS 8800, Dataset quality, Label errors, Training / validation / test data, Data leakage, Out-of-distribution detection
- Video lecture: coming soon
- References (this lesson summarizes the standards in its own words; check the originals for exact definitions and requirements)
- ISO/PAS 8800:2024, “Road vehicles — Safety and artificial intelligence.”
- ISO 21448:2022, “Road vehicles — Safety of the intended functionality.”
- S. Burton et al., “Mind the gaps: Assuring the safety of autonomous systems from an engineering, ethical, and legal perspective,” Artificial Intelligence, 2020.
- C. G. Northcutt et al., “Pervasive Label Errors in Test Sets Destabilize Machine Learning Benchmarks,” NeurIPS Datasets and Benchmarks, 2021.