Target recognition#
Two common ways of getting from sidescan data to machine-learning target recognition, step by step. Each step links to an example that does it; sidescanpy covers the sonar side (reading, correcting, cutting images, mapping image boxes back to the data), and established tools do the learning and the annotation.
From raw data to a two-stage recognizer#
Most sidescan target recognition runs in two stages: a detector finds anything on the seabed in whole swath images and may raise false alarms, then a classifier looks at a small chip around each detection and decides what it is, or rejects it.
Step |
What happens |
Example |
|---|---|---|
1. Convert and correct |
raw JSF, SDF or XTF to the data model, then TVG, ground range and positions, one call per correction |
|
2. Cut images to annotate |
dual-swath tiles with square pixels in metres, plus an index of where each tile sits in the data |
|
3. Annotate |
draw boxes in FiftyOne, CVAT or Label Studio and export COCO; read the boxes back as targets with ping, side and position |
|
4. Train a detector |
one class, “object”, on whole images |
|
5. Train a classifier |
chips around each labelled object, plus clutter and background images |
|
6. Find candidates |
run both stages on new tiles and turn the detections into targets with positions |
|
7. Review |
confirm, reject and correct the candidates; the corrections are the next round’s training data |
|
8. Test on more data |
score on lines or surveys that were never used for training, in image space or in metres |
The step-by-step pages walk through steps 4 to 8 in turn. The detector and classifier examples train on a public labelled image set (Santos et al. 2024, mine-like objects seen by a Marine Sonic sonar), because no openly licensed raw sidescan recording with labelled targets was available. With your own data, steps 2 and 3 produce the same kind of images and labels.
From a target catalog to image chips#
When a survey already has picked targets, from acquisition software (EdgeTech Discover and Klein catalogs are read directly) or from an analyst, the chips come straight from the catalog.
Step |
What happens |
Example or function |
|---|---|---|
1. Read the catalog |
into |
|
2. Place targets on pings |
by recorded file and ping, by position, or by ping number |
|
3. Render chips |
at any correction level, pixel size and window style, with COCO and YOLO labels |
|
4. Add backgrounds and split |
images with no target, and a train/validation split that keeps overlapping windows together |
Building blocks#
Function |
Does |
|---|---|
|
a corrected channel as PNG swath tiles plus |
|
boxes from a COCO file (annotations or detector results), per image |
|
boxes on a tile to targets: file, ping, side, sample, position, size in metres, score |
|
chips and background images with COCO and YOLO labels, at any correction level, resolution and style |
|
candidates against a catalog within a distance: hits, false alarms, misses, precision, recall |
Things that go wrong#
Splitting at random. Neighbouring swath images overlap and a target is often seen on several passes, so a random split puts near-copies in training and test and flatters the scores. Split by line, survey or date.
Backgrounds that differ from the targets’ surroundings. If background images come from different ranges or look different after the display stretch, a classifier learns that instead of the objects. Look at them side by side before training.
Another sonar. A model trained on one sonar, frequency or recorder setting rarely transfers to another without new labels. Correcting the data first (TVG, ground range, the same pixel size) narrows the gap but does not close it.