Inspecting high-voltage power lines, bridges, oil pipelines, and wind turbines typically takes days of manual work by industrial climbers or requires equipment shutdown. A drone with AI analytics covers the same route in hours and detects defects that humans often miss during a quick visual check. We have been developing such systems for several years and have completed 15+ projects on automation of inspections for industrial clients. In this article, we break down how a real defect detection system works — from image capture to report.
Typical inspection tasks
| Object | Defects detected | Method |
|---|---|---|
| Power lines, towers | Corrosion, tower lean, broken wire | Segmentation + anomaly detection |
| Wind turbine blades | Cracks, delamination, ice buildup | High-res defect detection |
| Bridges, overpasses | Cracks, spalling, rebar corrosion | Crack detection + classification |
| Oil pipeline | Dents, corrosion spots, leaks | RGB + thermal camera |
| Building roof | Leaks, thermal anomalies | Thermal camera |
How does defect detection on images work?
The basic method is semantic segmentation of cracks on RGB images. We use the UNet++ architecture with an EfficientNet-B4 encoder — it provides pixel-level accuracy and is robust to noise. The model is trained on labeled data (crack masks) and outputs a binary map, from which the area and length of the defect are calculated. The detector code:
import torch
import numpy as np
from PIL import Image
from torchvision import transforms
import segmentation_models_pytorch as smp
class InfrastructureDefectDetector:
def __init__(self, model_path: str, task: str = 'crack'):
# For cracks — segmentation task (pixel-level accuracy)
# UNet++ with EfficientNet-B4 encoder = good trade-off
self.model = smp.UnetPlusPlus(
encoder_name='efficientnet-b4',
encoder_weights=None, # load our own weights
in_channels=3,
classes=1,
activation='sigmoid'
)
checkpoint = torch.load(model_path, map_location='cpu')
self.model.load_state_dict(checkpoint['model_state_dict'])
self.model.eval()
self.transform = transforms.Compose([
transforms.Resize((512, 512)),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406],
[0.229, 0.224, 0.225])
])
self.task = task
@torch.no_grad()
def detect(self, image: np.ndarray,
threshold: float = 0.5) -> dict:
img_pil = Image.fromarray(image)
tensor = self.transform(img_pil).unsqueeze(0)
pred = self.model(tensor)[0, 0].numpy() # (H, W)
mask = (pred > threshold).astype(np.uint8)
# Mask analysis
crack_pixels = int(mask.sum())
total_pixels = mask.size
crack_ratio = crack_pixels / total_pixels
# Crack contours
contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL,
cv2.CHAIN_APPROX_SIMPLE)
crack_regions = []
for cnt in contours:
area = cv2.contourArea(cnt)
if area < 50: # noise filter
continue
x, y, w, h = cv2.boundingRect(cnt)
length = cv2.arcLength(cnt, False)
crack_regions.append({
'bbox': [x, y, x+w, y+h],
'area_px': int(area),
'length_px': float(length),
'severity': self._classify_severity(area, length)
})
return {
'defect_ratio': crack_ratio,
'crack_regions': crack_regions,
'severity': 'HIGH' if crack_ratio > 0.02 else
'MEDIUM' if crack_ratio > 0.005 else 'LOW',
'raw_mask': mask
}
def _classify_severity(self, area: float,
length: float) -> str:
if length > 200 or area > 500:
return 'CRITICAL'
elif length > 80 or area > 100:
return 'HIGH'
return 'MEDIUM'
The severity threshold is configurable according to enterprise standards. Cracks longer than 200 pixels are marked as critical — the object requires unscheduled repair.
Training technical details
For each model we apply augmentations: random rotation, brightness jitter, mosaic. We use AdamW optimizer with a learning rate of 1e-4 and cosine annealing. Validation uses IoU and F1-score. After training, we export to ONNX for inference on Jetson.
Why is thermal imaging indispensable?
Corrosion and leaks are often invisible in RGB images but show temperature anomalies. A thermal camera detects overheating of power line contacts (short circuit) or cold zones on roofs (insulation leak). Our thermal frame analyzer looks for areas where temperature deviates from the mean by more than 3 sigma:
class ThermalInspector:
def __init__(self, baseline_temp: float = 20.0):
self.baseline = baseline_temp
def analyze(self, thermal_frame: np.ndarray) -> list[dict]:
"""
thermal_frame: temperature matrix in °C
Look for abnormally hot (short circuit, friction) and cold
(leaks, missing insulation) zones.
"""
anomalies = []
# Frame statistics
mean_t = float(np.mean(thermal_frame))
std_t = float(np.std(thermal_frame))
# Anomalies: > mean + 3*std (hot) or < mean - 2*std (cold)
hot_mask = (thermal_frame > mean_t + 3 * std_t).astype(np.uint8)
cold_mask = (thermal_frame < mean_t - 2 * std_t).astype(np.uint8)
for mask_type, mask in [('hot', hot_mask), ('cold', cold_mask)]:
contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL,
cv2.CHAIN_APPROX_SIMPLE)
for cnt in contours:
if cv2.contourArea(cnt) < 20:
continue
x, y, w, h = cv2.boundingRect(cnt)
roi_temps = thermal_frame[y:y+h, x:x+w]
anomalies.append({
'type': mask_type,
'bbox': [x, y, x+w, y+h],
'max_temp': float(roi_temps.max()),
'min_temp': float(roi_temps.min()),
'delta': float(abs(roi_temps.mean() - mean_t))
})
return anomalies
This approach detects defects at an early stage before they lead to failure. According to Thermography (Wikipedia), thermal inspection is widely used for predictive maintenance.
Photogrammetry and 3D model: when is it needed?
For detailed analysis of cracks and deformations, we build a 3D model from a series of overlapping images. Tools: Agisoft Metashape (commercial), OpenDroneMap (open-source), COLMAP. Recommended overlap — 80% front-side, GSD — 1–3 mm/pixel. With a drone equipped with a Sony RX1R II camera (42 MP), you can get a GSD of 1 mm/pixel from 8 m altitude. The 3D model allows measuring crack opening width with an accuracy of 0.5 mm.
AI inspection results
AI detection finds 3 times more defects than visual inspection, while the inspection speed is 5 times higher. For example, for one power grid company, the savings on unscheduled repairs amounted to over 2 million rubles per year after deploying the system on 40 km of power lines.
Case study: inspection of 40 km of power lines for our client
One of our clients, a power grid company, used to spend 5 working days inspecting 40 km of high-voltage power lines with three teams. We proposed a solution based on the DJI M300 RTK drone with a Zenmuse H20T camera (20 MP RGB + thermal). Autonomous flight along a GPS route at 30 m above the wire.
- Data collection time: 6–7 hours for 40 km (2 days including repositioning)
- AI analysis: YOLOv8l, fine-tuned on 3200 images of tower and wire defects
- First inspection results: 14 towers with corrosion >20%, 3 tension clamps with cracks, 8 anomalous thermal points
- Time savings: inspection completed in 2 days instead of 5, defect miss rate reduced by a factor of 3
The client received a full report with defect coordinates and photographs — this allowed prompt planning of repair work without equipment shutdown.
What is included in the project work?
- Site survey and requirements gathering. We determine defect types, inspection frequency, acceptable tolerances.
- Preparation of labeled data. If you don't have images, we conduct a pilot flight to collect a dataset.
- Model training and validation. We use transfer learning, experiment with architectures (UNet, YOLO, ViT). Experiment management via MLOps – MLflow and Weights & Biases.
- Integration with drone and reports. We deploy the model on an onboard computer (NVIDIA Jetson) or server.
- Testing and acceptance. We verify accuracy on a test set, conduct field tests.
- Documentation and training delivery. We provide model card, operation manual, pipeline code.
- 6-month warranty support. If inspection conditions change, we retrain the model.
Development time estimates
| Inspection type | Development timeline |
|---|---|
| Single defect type detector | 4–6 weeks |
| Comprehensive inspection system | 8–14 weeks |
| With photogrammetry and 3D reports | 12–20 weeks |
For an accurate estimate of your project, get a consultation — we will analyze the object and propose the best solution. Contact us for a demo of our ready-made cases. You can also order a pilot project — we will select equipment and tune models for your infrastructure.
Conclusion: AI drone inspection is a comprehensive system for data collection, analysis, and reporting that pays for itself through reduced downtime and increased safety.







