Pipe Defect Detection
Highlights


Results
Details
Problem
Internal inspection of rocket engine pipes requires reliable detection of surface defects under challenging conditions, including cylindrical geometry, specular reflections, uneven illumination, and subtle texture variations. The goal is to detect defect regions with high precision while minimizing false positives in defect-free pipes.
Approach
Data
High-resolution grayscale images were captured from the inner surface of cylindrical rocket pipes using a rotating inspection setup.
Annotations were provided at the defect-region level, with many samples containing extremely small defect areas relative to the full image.
To address class imbalance:
- Defect and non-defect samples were balanced at the image level
- Pixel-level evaluation was restricted to defect-containing images
Model
We adopt Segment Anything Model (SAM) as the base segmentation backbone and fine-tune it using Low-Rank Adaptation (LoRA).
- The SAM image encoder is kept frozen
- LoRA layers are injected into attention projections to adapt the model to pipe-surface textures
- Only LoRA parameters and the mask decoder are trained, significantly reducing trainable parameters
This design preserves SAM’s strong generalization while enabling domain-specific adaptation to subtle defect patterns.
Training
- Input images are provided along with bounding-box prompts derived from defect annotations
- Loss: binary cross-entropy combined with Dice loss
- LoRA fine-tuning ensures stable training even with limited defect samples
- Data augmentation includes intensity jitter, spatial flips, and mild geometric perturbations
Evaluation
Evaluation is performed at two levels:
- Image-level defect detection (defect present vs. absent)
- Pixel-level segmentation quality on defect-containing images only
Connected components from predicted masks are used to derive final defect regions and bounding boxes.
Results
Image-Level Detection
- GT images: 100
- True Positives: 47
- False Positives: 0
- False Negatives: 3
- True Negatives: 50
| Metric | Value |
|---|---|
| Precision | 1.000 |
| Recall | 0.940 |
Pixel-Level Metrics (Defect Images Only)
| Metric | Value |
|---|---|
| Pixel Precision (mean) | 0.9534 |
| Pixel Recall (mean) | 0.9727 |
Notes
- LoRA fine-tuning allows SAM to adapt to highly reflective, repetitive pipe textures without overfitting.
- Zero false positives at the image level is critical for industrial inspection workflows.
- Most missed detections correspond to extremely small or low-contrast defects near specular boundaries.
- A lightweight GUI was developed to visualize predictions, inspect defect regions, and validate results interactively.