AI pipeline for annotating marine species (Project Moorev - Marine)

Overview
Creative Commons License: CC-BY Questions:
  • How can we use artificial intelligence to annotate images of marine species?

  • How can we check and correct these annotations?

Objectives:
  • Use SAM3 to automatically detect marine species from a simple keyword

  • Correct generated annotations with Edit COCO Annotation

Requirements:
Time estimation: 30 minutes
Translations: Français
Supporting Materials:
Published: Jul 24, 2026
Last modification: Jul 24, 2026
License: Tutorial content is licensed under Creative Commons Attribution 4.0 International License. The GTN framework is licensed under MIT
version Revision: 1

In this tutorial, we will explore a complete pipeline for annotating images and videos of marine species. As an example, we will use a video from the Moorev project, cut into a short clip and available on Zenodo.

This pipeline has two main steps:

  1. Automatic annotation using a text prompt with SAM3 Semantic Segmentation ( Galaxy version 1.0.1+galaxy6)
  2. Correction and validation of the annotations with Edit COCO Annotation ( Galaxy version 1.0.0+galaxy0)

MOOREV: Microclimates and observation tools for the responses of marine life on the seafloor

Observing interactions between marine species facing microclimatic gradients on the shore

The MOOREV project is led by Nadine Le Bris (Sorbonne University, Concarneau Marine Station), with support from the National Museum of Natural History, the CNRS, and the Fondation de France. It started in 2022. Its goal is to better understand, and help others understand, the effects of climate disturbance on coastal biodiversity.

The project uses underwater imaging methods to observe benthic species at the individual level, across different shore habitats. Groups of school students repeat data collection at their study sites, which are labelled by the Educational Marine Areas program of the French Biodiversity Office, across tide cycles, seasons, and years.

The project brings together researchers and environmental education professionals. It is co-built with school classes and their teachers, using the shore as a natural laboratory. In the long term, it aims to support protection and conservation measures, taking into account the links between climate change and marine socio-ecosystems.

Agenda: In this tutorial, we will cover:
  1. Loading the data
  2. Automatic annotation with SAM3
  3. Correcting and validating the annotations
    1. Correcting with Edit COCO Annotation
  4. Conclusion

Loading the data

The video used in this tutorial is a short clip taken directly from the Moorev project, available on Zenodo. This clip was chosen because it shows most of the features of the tools presented here.

Hands On: Load the video into Galaxy
  1. Create a new history for this tutorial (for example: “Annotation Moorev”)

    To create a new history simply click the new-history icon at the top of the history panel:

    UI for creating new history

    1. Click on galaxy-pencil (Edit) next to the history name (which by default is “Unnamed history”)
    2. Type the new name
    3. Click on Save
    4. To cancel renaming, click the galaxy-undo “Cancel” button

    If you do not have the galaxy-pencil (Edit) next to the history name (which can be the case if you are using an older version of Galaxy) do the following:

    1. Click on Unnamed history (or the current name of the history) (Click to rename history) at the top of your history panel
    2. Type the new name
    3. Press Enter

  2. Import the file from Zenodo:

    https://zenodo.org/records/20639741/files/Lieujaune-PorzBreign-GOPR5167_Edited.mp4?download=1
    
    • Copy the link location
    • Click galaxy-upload Upload at the top of the activity panel

    • Select galaxy-wf-edit Paste/Fetch Data
    • Paste the link(s) into the text field

    • Press Start

    • Close the window

    Galaxy upload link

  3. Check that the file is shown in green in the history before you continue

  4. Check the datatype

    Galaxy assigns the datatype automatically. Since most tools use it to filter their inputs, it is important to make sure it is correct. In our case, check that the type is mp4. If it is not, the import may have had an error, and you can change the type manually.

    Check the datatype.

    • Click on the galaxy-pencil pencil icon for the dataset to edit its attributes
    • In the central panel, click galaxy-chart-select-data Datatypes tab on the top
    • In the galaxy-chart-select-data Assign Datatype, select mp4 from “New Type” dropdown
      • Tip: you can start typing the datatype into the field to filter the dropdown menu
    • Click the Save button

Automatic annotation with SAM3

SAM3 is a text-guided segmentation model. It automatically detects and segments objects that match your prompt, with no need for previous annotations.

If you want to learn more about SAM3 and its parameters, check out the dedicated tutorial: SAM3 Tutorial

Hands On: Setting up SAM3
  1. SAM3 Semantic Segmentation ( Galaxy version 1.0.1+galaxy6) with these parameters:

    • param-file “Model data”: Segment Anything Model 3 (SAM 3) (default)
    • param-select “Input type”: One video
      • param-file “Input video file”: 1: Lieujaune-PorzBreign-GOPR5167_Edited.mp4
      • param-select “Video quality”: Original quality (lossless) (default)
      • param-select “Additional output formats”: Empty (default)
      • param-select “Export individual frames”: Both annoted and raw frames
    • param-text “Text prompt”: fish
    • version “Confidence threshold”: 0.5
    • version “Video frame stride”: 5
    • param-toggle “Show bounding boxes on annotated output”: Yes
    • param-toggle “Inference image size”: 644 (default, balanced) (default)
    • param-toggle “Normalize outputs?”: No (default)
    • param-toggle “Normalize outputs?”: No (default)
  2. Click Run Tool

    Comment: Processing time

    Processing can take several minutes, depending on the length of the video and the server resources. Wait until the outputs turn green in the history.

  3. Once it is finished, you will have these items in your history:
    • 5: Annotation COCO: annotations.json — the segmentation masks in COCO format
    • 4: Annotated Frames: the collection of extracted images (annotated)
    • 3: Raw Frames: the collection of extracted images (not annotated)
    • 2: COCO Extracted Frames: the annotated video, for visual checking
  4. Check the results visually by clicking galaxy-eye on Annotated Outputs

    SAM3 segmentation result on the video.

    Comment: Limits of SAM3

    As you can see, not all annotations are perfect. False positives are the most common problem. This is why the next step, correction and validation, is essential.

Correcting and validating the annotations

We will now see how to correct the annotations with Edit COCO Annotation, and then check the result with COCO Annotation Visualizer.

Correcting with Edit COCO Annotation

The Edit COCO Annotation tool lets you modify COCO annotations without opening the images. It has three modes:

  • Keep: keep only the listed IDs (remove all the others) — useful when only a few IDs need to be kept; it can also rename them
  • Remove: remove only the listed IDs
  • Rename: rename the listed IDs without removing any others
Hands On: Keep, remove, or rename annotations
  1. Edit COCO Annotation ( Galaxy version 1.0.0+galaxy0) with these parameters:

    • param-file “COCO annotation file”: 5: Annotation COCO
      • param-repeat “1: Track to keep”
        • param-text “Track IDs”: 0,4-6
        • param-text “Rename”: Gobiusculus flavescens
        • param-text “Frame min”: Empty (default)
        • param-text “Frame max”: Empty (default)
      • param-repeat “2: Track to keep”
        • param-text “Track IDs”: 2
        • param-text “Rename”: Crenilabre
        • param-text “Frame min”: Empty (default)
        • param-text “Frame max”: Empty (default)
      • param-text “Frame max”: Empty (default)
    Comment: The same result in two steps

    You can also get the same result in two steps: use Remove to remove IDs 1 and 3, then use Rename to rename the remaining groups.

    Note: SAM3 can sometimes give the same Track ID to two different objects at different moments in the video. This is why the Frame min and Frame max parameters were added.

  2. Once it is finished, you will have this item in your history:

    • 54: Edited COCO annotations: the JSON file in COCO format, modified with the parameters set above

Visualizing the annotations with COCO Annotation Visualizer

This tool lets you easily visualize a JSON file in COCO format, shown on top of a video or images. Here we use it to check our annotations after correction.

Hands On: Visualize the COCO annotations
  1. COCO Annotation Visualizer ( Galaxy version 1.0.0) with these parameters:

    - <i class="far fa-file" aria-hidden="true"></i><span class="visually-hidden">param-file</span> *"Input video file"*: `1: Lieujaune-PorzBreign-GOPR5167_Edited.mp4`
    - <i class="fas fa-code-commit" aria-hidden="true"></i><span class="visually-hidden">version</span> *"Frame stride"*: `5` - <i class="fas fa-code-commit" aria-hidden="true"></i><span class="visually-hidden">version</span> *"Frame stride"*: `5` - <i class="far fa-file" aria-hidden="true"></i><span class="visually-hidden">param-file</span> *"COCO annotation file"*: `54: Edited COCO annotations` - <i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="visually-hidden">param-text</span> *"Filter categories"*: `Empty` (default) - In *"Display options"*:
    - <i class="fas fa-toggle-on" aria-hidden="true"></i><span class="visually-hidden">param-toggle</span> *"Show bounding boxes"*: `No`
    - <i class="fas fa-toggle-on" aria-hidden="true"></i><span class="visually-hidden">param-toggle</span> *"Show segmentation masks"*: `Yes` (default)
    - <i class="fas fa-toggle-on" aria-hidden="true"></i><span class="visually-hidden">param-toggle</span> *"Show category labels"*: `Yes` (default)
    - <i class="fas fa-toggle-on" aria-hidden="true"></i><span class="visually-hidden">param-toggle</span> *"Show annotation count"*: `No` (default)
    - <i class="fas fa-code-commit" aria-hidden="true"></i><span class="visually-hidden">version</span> *"Mask opacity"*: `0.4` (default)
    - <i class="fas fa-code-commit" aria-hidden="true"></i><span class="visually-hidden">version</span> *"Bounding box thickness"*: `2` (default)
    - <i class="fas fa-code-commit" aria-hidden="true"></i><span class="visually-hidden">version</span> *"Label font scale"*: `0.6` (default)
    - <i class="fas fa-filter" aria-hidden="true"></i><span class="visually-hidden">param-select</span> *"Color mode"*: `Per instance (different color for each annotation)`
    - <i class="fas fa-filter" aria-hidden="true"></i><span class="visually-hidden">param-select</span> *"Output image format"*: `PNG (lossless)` (default)
    - <i class="fas fa-code-commit" aria-hidden="true"></i><span class="visually-hidden">version</span> *"Video frame rate (FPS)"*: `5.0` - <i class="fas fa-code-commit" aria-hidden="true"></i><span class="visually-hidden">version</span> *"Video frame rate (FPS)"*: `5.0` - <i class="fas fa-toggle-on" aria-hidden="true"></i><span class="visually-hidden">param-toggle</span> *"Annotated frames only"*: `Yes` (default)
    
  2. Once it is finished, you will have these items in your history:

    • 56: Annoted video: the annotated video
    • 55: Annotated images: each annotated frame
    Annotated video with the COCO segmentation masks. Open image in new tab

    Figure 1: 56: Annoted video

Conclusion

You now know how to use this complete pipeline to annotate videos of marine species:

  • SAM3 automatically generates annotations from a simple text prompt
  • Edit COCO lets you quickly clean up annotations by keeping, removing, or renaming track IDs
  • COCO Annotation Visualizer lets you visually check the results at each step

This pipeline can be reused for other species or other marine imaging projects — you just need to adapt the prompt and the SAM3 confidence settings.