Alarm management: fix the alarm system before adding AI
Alarm floods are solved with an alarm philosophy first, not a model. AI works better on an orderly alarm list.
Precision is the share of alarms that match a real event, and recall is the share of real events that trigger an alarm. Precision = TP/(TP+FP); recall = TP/(TP+FN). Raising the threshold usually raises precision and lowers recall. Choose the threshold where both values, and their combined F1 score, are acceptable for the cost of a missed event.
Each alarm, or each time window, is classed by comparing it with what really happened. A true positive (TP) is an alarm that matches a real event. A false positive (FP) is an alarm with no event behind it. A false negative (FN) is a real event that produced no alarm. A true negative (TN) is a quiet period with no event.
Precision = TP / (TP + FP) looks at the alarms: how far can they be trusted? Recall = TP / (TP + FN) looks at the events: how many were caught? Moving the threshold shifts the balance between them. The F1 score, F1 = 2PR / (P + R), combines the two into one number, but it does not say which error is more expensive.
Suppose a line has 10 real events in one month. At threshold A the model raises 12 alarms, 8 of them real: TP = 8, FP = 4, FN = 2.
At threshold B, which is higher, the model raises 7 alarms, 6 of them real: TP = 6, FP = 1, FN = 4.
Precision rises from 0.667 to 0.857, but recall falls from 0.80 to 0.60, and F1 slips from 0.727 to 0.706. Whether B is better depends on what a missed event costs.
The first mistake is the unit of counting. A single event that keeps a signal above threshold for 30 minutes should count as one event, not as 30 alarms. Sample-level and event-level precision can differ a lot, so state which one you report.
The second mistake is relying on accuracy. When events are rare, a model that never alarms can still score high accuracy. The third is choosing the threshold on the test period. Tune it on a separate validation period and use the test period once, at the end. A matching rule is also needed: how many minutes before or after an event still count as a hit?
It depends on which error costs more. If a missed event could cause a safety or quality loss, recall usually matters more. If every alarm triggers a manual inspection and operators are already overloaded, precision matters more. Settle the trade-off with a cost estimate from the plant, not a default.
No. F1 weights precision and recall equally and ignores true negatives. Report precision and recall separately, ideally across a range of thresholds, so the choice stays visible. A single F1 number hides which error the threshold is trading away.
Example numbers are hypothetical, not measured field results.