Anomaly detection
UAT 453 UAS for Infrastructure, Energy and Utility Inspection
Lesson
By the end of this module you will be able to
- Measure crack width from images and estimate uncertainty from pixel size and camera angle
- Explain AI-assisted defect finding in large image sets and interpret precision and recall for inspection
- Estimate the inspector workload of confirming AI results and the number of defects that may be missed
- Design an inspection workflow where people and AI work together
Why this matters
One wall inspection can produce thousands of images, too many for an inspector to examine closely. AI can pick out images likely to contain damage, but it both raises false alarms and misses real defects. Crack widths measured from images also carry uncertainty that users must be told about. This module makes the numbers delivered meaningful and honest.
Measuring crack width from images
Crack width is the number of pixels spanning the crack times the GSD, using the GSD in the tilt direction if the camera was tilted.
Crack edges in an image can be placed to about one pixel, so the relative uncertainty is about . Cracks only a few pixels wide are therefore measured with high uncertainty, consistent with the findings of Lee et al. (2026).
Example 1 Measuring cracks from images taken at 30°
import math
GSD, ANGLE = 0.25, 30 # perpendicular GSD (mm) and camera tilt (degrees)
g = GSD / math.cos(math.radians(ANGLE)) # effective GSD in the tilt direction
for px in (3, 5, 8): # crack width measured in the image (pixels)
w = px * g
print(f"{px} px -> {w:.2f} mm, +/-1 px = +/-{g:.2f} mm ({g / w:.0%})")
3 px -> 0.87 mm, +/-1 px = +/-0.29 mm (33%)
5 px -> 1.44 mm, +/-1 px = +/-0.29 mm (20%)
8 px -> 2.31 mm, +/-1 px = +/-0.29 mm (12%)
A crack measured at 3 pixels is about 0.87 mm wide, but ±0.29 mm uncertainty is about 33%, while an 8-pixel crack is off by only about 12%. Reports should therefore give ranges, such as “0.6–1.2 mm”, rather than single values, and if a width is near a severity threshold, re-image closer and more perpendicular, or have the inspector measure it on site with a crack gauge.
AI to triage images
Object detection or segmentation models trained on images of cracks, spalls and stains help point to suspicious spots in large image sets. Two measures describe them.
- Precision: of the spots the AI flags, what percentage are real defects. Low precision means inspectors waste time on false alarms
- Recall: of all real defects, what percentage the AI finds. Low recall means real defects are missed, which is more dangerous in structural work
Inspection therefore usually sets the AI threshold for high recall, accepting more false alarms, with people confirming.
Example 2 Inspector workload
Precision and recall come from testing the model on a labelled dataset (assumed).
IMAGES, FLAGS = 3000, 450 # number of images and AI damage flags
PRECISION, RECALL = 0.60, 0.90 # from testing on a labelled dataset
SECONDS_PER_FLAG = 20 # inspector time to confirm each flag
true_pos = FLAGS * PRECISION
false_pos = FLAGS - true_pos
real = true_pos / RECALL
print(f"true detections {true_pos:.0f}, false alarms {false_pos:.0f}")
print(f"real defects about {real:.0f}, missed about {real - true_pos:.0f}")
print(f"review time {FLAGS * SECONDS_PER_FLAG / 3600:.1f} h")
true detections 270, false alarms 180
real defects about 300, missed about 30
review time 2.5 h
From 3,000 images the AI flags 450 spots: 270 real and 180 false alarms. Confirming them takes about 2.5 hours, far less than viewing every image, but about 30 defects are still missed, so extra measures are needed, such as inspectors sampling some unflagged images and viewing every image of critical areas such as the soffit over bridge bearings.
A workflow for people and AI together
- AI triages images with the threshold set for high recall
- Inspectors confirm every flagged spot, classifying and measuring it
- Sample unflagged images to estimate how many were missed; if more than expected, lower the threshold or retrain the model
- Review every image of critical areas defined by the engineer
- Record the model version and threshold, so the next inspection’s results can be compared
AI here is a triage tool, not a judge; every delivered result must be confirmed by a person.
Module lab
Lab: measuring cracks and evaluating AI
- From the module 3 detail images, choose five cracks, count the pixels spanning each, and compute width and uncertainty with the code in Example 1
- Measure the same cracks on site with a crack gauge and compare with the image values
- Run the crack detection model your lecturer provides on a labelled test set, count TP, FP and FN, and compute precision and recall
- Estimate inspector workload with the code in Example 2
- Try changing the model’s confidence threshold and record how precision and recall change
Common mistakes
Watch out
- Reporting crack width as a single number with no uncertainty
- Measuring cracks from tilted images without correcting GSD for the angle
- Reporting only precision, when recall matters more for safety
- Delivering AI results to users without human confirmation
- Not recording the model version, so results cannot be compared between inspections
Summary
- Crack width has relative uncertainty of about
- Cracks only a few pixels wide should be reported as ranges or confirmed on site
- Inspection sets AI for high recall, with people confirming every flag and sampling unflagged images
- AI is a triage tool; delivered results must be confirmed by inspectors
Check your understanding
- A crack spans 6 pixels at a 0.2 mm perpendicular GSD. How wide is it, and about what percentage uncertainty?
- The AI flags 200 spots, 150 of them real. What is the precision?
- If there are 180 real defects and the AI finds 150, what is the recall?
- Why does structural inspection prioritise recall?
- Why sample images the AI did not flag?
Answers
- mm, uncertainty about
- Missing a real defect may endanger structure users, while a false alarm only costs review time
- To estimate how many defects the AI misses, and adjust the threshold or retrain if needed
Key formulas
| Width from an image | |
| Relative uncertainty | |
| Precision and recall |
Key references
- Lee, S. B., Lee, D. H., & Kim, J. (2026). An exploratory study on imaging resolution, operational parameters, and measurement uncertainty in UAV-based crack inspection. Sensors, 26(3), 1031. link
- Federal Highway Administration. (2022). National bridge inspection standards (Final rule). Federal Register, 87(88), 27396. 23 CFR 650 Subpart C. link
- Barnhart, R. K., Marshall, D. M., & Shappee, E. (Eds.). (2021). Introduction to unmanned aircraft systems (3rd ed.). CRC Press. link
- Wolf, P. R., DeWitt, B. A., & Wilkinson, B. E. (2014). Elements of photogrammetry with applications in GIS (4th ed.). McGraw-Hill Education. link
Further reading
Study the assigned knowledge units in advance, review media and take the module quiz
In class / field
Lab or field practice from worksheets with a safety checklist
Learning evidence: Checked worksheets and quiz results