This repository contains the winning solution for a Computer Vision competition focused on the automated detection and geometric analysis of power lines and cables. The project addresses the challenging task of segmenting thin structures and estimating their mathematical line equations using the TTPLA (Transmission Tower and Power Line Architecture) dataset.
Metric achieved: LDS (Line Detection Score) = 2.9753 Performance: Outperformed the ResNet-50 baseline by significant margins in both mAP and topological consistency.
The goal of this project was twofold:Pixel-level Segmentation: Identify and segment individual pixels belonging to cables in complex outdoor aerial imagery.Geometric Estimation: Compute the mathematical equation of the line coinciding with the cable's skeleton (Polar Coordinates:
Thin Structures: Cables often occupy only a few pixels in width, leading to discontinuities in standard segmentation models.
Topological Preservation: Ensuring the connectivity of the predicted masks.
Geometric Precision: Accurate angle estimation is crucial for infrastructure monitoring.
Our approach utilizes the state-of-the-art Mask2Former architecture with strategic optimizations: Model Architecture Framework: Mask2Former (Masked-attention Mask Transformer).
Backbones: Evaluated ResNet-50, ResNet-101, and Swin-S (Transformer). The Swin-S backbone provided superior global context for long, thin structures.
Input Augmentation: Extended input from 3-channel RGB to 5-channel (RGB + X-coord + Y-coord) to provide spatial awareness.
Loss custom
After generating segmentation masks, we implemented a robust extraction pipeline:Skeletonization: Reducing masks to single-pixel centerlines.RANSAC: Iterative line fitting to handle noisy predictions and outliers.SVD Refinement: Refining the
Utilized Optuna with TPE (Tree-structured Parzen Estimator) to fine-tune RANSAC thresholds, Canny sensitivity, and confidence scores to maximize the project-specific LDS metric.