English Manual · 1.2.7
AMADEUS
User Manual
A guide to using AMADEUS.
1. Launch
Recommended environment
AMADEUS supports NVIDIA GPUs on Windows and Linux, Apple Silicon on macOS, and some AMD GPUs via ROCm.
For NVIDIA and AMD GPUs, 8 GB or more of VRAM is recommended, although the required memory depends on factors such as video resolution and the number of animals. AMADEUS has also been confirmed to run on a laptop equipped with an NVIDIA GPU that has 4 GB of VRAM.
Download and run the installer for your operating system. Git is not required.
If you encounter an error, please contact Yusuke Notomi at jpmyrmecol [at] gmail.com and include your operating system, installation method, and the error message. AMD GPU (ROCm) support has not yet been extensively validated on physical hardware, so reports of successful operation or any issues are also appreciated.
Install and launch
Windows
Double-click AMADEUS-Setup.bat.
After the initial setup, launch AMADEUS from the AMADEUS desktop shortcut, or type amadeus or amade in Command Prompt.
macOS (Apple Silicon)
Save AMADEUS-Setup.command to your Downloads folder, then run this command in Terminal:
chmod +x ~/Downloads/AMADEUS-Setup.command
Double-click AMADEUS-Setup.command and follow the on-screen instructions. To launch it again, double-click the same file or type amadeus in Terminal.
Linux (Ubuntu / WSL2)
You can allow AMADEUS-Setup.sh to run as a program in the file properties and choose to run it in a terminal. Names and actions vary by desktop environment.
You can also run it directly from a terminal. For example, if it is saved in your Downloads folder, run:
bash ~/Downloads/AMADEUS-Setup.sh
After the initial setup, type amadeus or amade in a terminal to launch AMADEUS.
Install using Git (Windows, macOS, Linux)
Windows
Open Command Prompt (cmd) and run:
git clone https://github.com/jpmyrmecol/AMADEUS.git && cd AMADEUS && AMADEUS.bat
After installation, open a new Command Prompt and type amadeus or amade to launch AMADEUS.
macOS (Apple Silicon)
Open a terminal and run:
git clone https://github.com/jpmyrmecol/AMADEUS.git && cd AMADEUS && bash AMADEUS.sh
After installation, type amadeus or amade in Terminal to launch AMADEUS. An Apple Silicon Mac is required.
Linux (Ubuntu / WSL2)
Open a terminal and run:
git clone https://github.com/jpmyrmecol/AMADEUS.git && cd AMADEUS && bash AMADEUS.sh
After installation, type amadeus or amade in a terminal to launch AMADEUS. A graphical desktop environment is required.
Install from a downloaded ZIP
Download the ZIP from “Code → Download ZIP” in the GitHub repository. Git does not need to be installed in advance.
- Extract the AMADEUS ZIP archive.
- Start the launcher for your operating system. The same launcher can be used after the initial setup.
- After the initial setup is complete, the home screen opens.
| OS | Launcher |
|---|---|
| Windows 10 / 11 | Double-click AMADEUS.bat |
| macOS (Apple Silicon) | Double-click AMADEUS.command |
| Ubuntu / WSL2 | Run bash AMADEUS.sh |
Uninstall for v1.0.4 and earlier (Windows, macOS, Linux)
Windows
Close AMADEUS before uninstalling.
Installer installation: Open %LOCALAPPDATA%\AMADEUS\app\tools and double-click uninstall.bat. After it finishes, delete %LOCALAPPDATA%\AMADEUS and the AMADEUS desktop shortcut.
Git or ZIP installation: Open the tools folder in the AMADEUS installation directory and double-click uninstall.bat. After it finishes, delete the AMADEUS installation folder if you no longer need it.
The legacy uninstaller removes the local runtime and the amadeus command. Back up sessions and results before deleting the installation folder.
v1.0.5 and later: You can uninstall AMADEUS from the Uninstall button on the Home screen.
macOS
Close AMADEUS, then delete the AMADEUS folder that you downloaded or extracted.
Open Terminal and remove the AMADEUS command launchers:
rm -f ~/.local/bin/amadeus ~/.local/bin/amade
If you cannot find the AMADEUS folder, run cat ~/.local/bin/amadeus before deleting the command launcher; the displayed cd path points to the AMADEUS folder.
Tracking sessions and results stored outside the AMADEUS folder are not removed.
v1.0.5 and later: You can uninstall AMADEUS from the Uninstall button on the Home screen.
Linux
Close AMADEUS, then delete the AMADEUS folder that you downloaded or extracted.
Open a terminal and remove the AMADEUS command launchers:
rm -f ~/.local/bin/amadeus ~/.local/bin/amade
If you cannot find the AMADEUS folder, run cat ~/.local/bin/amadeus before deleting the command launcher; the displayed cd path points to the AMADEUS folder.
Tracking sessions and results stored outside the AMADEUS folder are not removed.
v1.0.5 and later: You can uninstall AMADEUS from the Uninstall button on the Home screen.
2. Home screen
| Screen | Purpose |
|---|---|
| Easy Tracking | Run the standard tracking workflow with only a few inputs |
| Cropping & Trimming | Preprocess video regions, time ranges, brightness, and related settings |
| Segmentation | Separate animals from the background and define the analysis region |
| Advanced Tracking | Configure individual stages and parameters in detail |
| Multi Config Batch | Run multiple configuration files in sequence |
| Refinement | Review and correct positions, head directions, and individual IDs |
| Colab (beta) | Prepare the files needed to run training and tracking on a Google Colab GPU |
On the Home screen, you can drag and drop videos or configuration files to load them.
3. Basic workflow
- Open Easy Tracking, follow the on-screen guidance to select the input video, then select Launch Segmentation.
- In Segmentation, adjust the settings so that the animals are properly extracted from the background, then select Analyze.
- Adjust the red lines (lower and upper bounds) on the box plot (or the Absolute range) so that isolated individuals are shown in blue and contacting animals, fragments, and other outliers are shown in orange, then select Processing. When processing finishes, AMADEUS automatically returns to Easy Tracking.
- Enter the animal count, select the overlap severity and whether animals move backward, then select Processing.
- Review the result video and CSV. Use Refinement to correct remaining errors if needed.
To adjust detailed parameters, use Switch Advanced Mode.
If needed, prepare the video with Cropping & Trimming before starting.
4. Cropping & Trimming (optional)
Create a video by cropping the region and time interval to analyze and adjusting its appearance.
- Select the video with Input Video.
- Set the interval with Set In and Set Out.
- Use Full, or add regions with Add Crop.
- Drag or resize regions and select the regions to export.
- Set brightness, contrast, and color/grayscale for each region.
- Check the output folder, name, and FPS, then select Export.
5. Segmentation (foreground extraction)
Extract animals from the background and distinguish single-animal blobs from multi-animal blobs formed by animals in contact.
- Check the video and analysis frame range.
- Select a foreground extraction method. When using background difference, select Median, Maximum, or Minimum.
- Adjust Threshold and Min blob area so that the animals are extracted cleanly from the background.
- After adjusting the foreground extraction settings, select Analyze. AMADEUS samples frames and calculates the area distribution used for Outlier Extraction.
- After analysis, the Outlier Extraction controls appear. Adjust the red lines (lower and upper bounds) on the box plot (or Absolute bounds) so that complete, isolated animals appear cyan (blue), while merged animals, fragments, and other outliers appear orange.
- Select Processing to save the results.
Foreground extraction methods
| Mode | Suitable video |
|---|---|
| Background difference | Animals differ consistently from a static background |
| Dark region | Animals are darker than the background |
| Bright region | Animals are brighter than the background |
| Dark + background difference | Combine darkness with background difference |
| Bright + background difference | Combine brightness with background difference |
Results are saved under <Session>/segmentation/.
Additional settings are hidden by default. Check Show optional settings at the top of the sidebar to display the optional sections below.
ROI [Optional]
Use a region of interest (ROI) to include or exclude part of the image. Enable Use this ROI and adjust the ROI shape and position with Edit ROI. From frame and To frame set its active frame range.
Reverse ROI inverts the selected region.
Region Expansion [Optional, Beta]
This beta feature is still incomplete. Check the results carefully before use.
Use this when foreground regions that should form one blob are separated by small gaps or deep notches after thresholding.
Expand region (px) expands foreground regions outward by the specified number of pixels. Enable Keep merging expansion only to retain only the expansion needed to connect separate regions, while avoiding unnecessary enlargement of isolated blobs.
Exclude temporal merges [Optional, Beta]
This beta feature is off by default. Check the results carefully before use.
This option identifies merged animals across consecutive frames and excludes them from single-animal training samples. Select Enabled, then select Search before Analyze. Use the arrow buttons to inspect detected events.
After changing the video, frame range, or segmentation settings, run Search again when prompted. Compatible search results are saved and reused automatically. Review the exclusions before selecting Processing.
Result OBB Import [Optional, Beta]
This is a beta feature. Check the results carefully before use.
Import OBBs from a previous tracking result to improve Segmentation outlier classification. This can help retain unusually large single animals and handle incomplete foreground extraction.
Enable Use imported result OBB and select the result CSV with Reference. The CSV must contain a frame column and cx, cy, w, h, and heading columns for each ID. Frame numbers and image coordinates must match the current video. Results from another project can also be used when they match.
Min OBB coverage (default 0.7) specifies the minimum fraction of a blob covered by its matching OBB. Minimum area and Maximum area set the allowed foreground pixel area within each OBB. These settings help identify single animals and exclude outliers. Result OBBs can also extend exclusion regions where foreground extraction is incomplete.
Enable Show imported OBB to display the reference boxes in magenta. Hover over a blob to inspect its OBB matches and coverage before running Processing. Use Clear imported result to remove the reference.
The selected CSV is also passed to subsequent tracking stages. When generating single-animal training images with direction estimation, previously excluded individual blobs can be recovered if their original contours, size, and direction agree with the result OBB. This may help with stationary animals or animals that frequently contact others. Merged blobs and mismatched detections are not accepted as single-animal training samples.
Additional Outlier [Optional, Beta]
This beta feature is still incomplete. Check the results carefully before use.
Use this when some regions need to be classified as outliers using a segmentation condition different from the main foreground extraction.
Enable the set with Enabled, then specify the frame range, segmentation mode, threshold settings, and Min blob area. Multiple Additional Outlier Sets can be created when different conditions are needed.
Regions detected by this secondary rule are added as outliers and shown in orange. Normal single-animal regions already protected by the main segmentation and area bounds are not overwritten by Additional Outlier.
Single-animal Smoothing [Optional, Beta]
This beta feature is still incomplete. Check the results carefully before use.
Use this to smooth the contours of single-animal blobs after Outlier Extraction, for example when legs or other narrow protrusions make the extracted body outline irregular.
Enable Smooth single-animal blobs and adjust Smoothing level. Higher values remove thicker protrusions. Only blue single-animal blobs are smoothed; removed pixels become background, and the area bounds are applied again after smoothing.
6. Easy Tracking
Answer three configuration questions, then run automatic training data generation, detector training, detection, and tracking in one batch.
- Select Video File and Session.
- Use Launch Segmentation to configure foreground extraction.
- Enter the number of animals in How many animals are in the video? and press the Enter button to apply it.
- Select the degree of overlap and whether any animals move backward.
- Select Processing.
| Input | Choices | Meaning |
|---|---|---|
| How many animals are in the video? | Positive integer | Number of animals to track |
| How severe is the overlap? | Very heavy / Heavy / Light | Severity of visual overlap. Select Very heavy when almost complete occlusion is expected. This adds identity verification and correction using contrastive learning and increases processing time. Among the demo videos, embedding-based ID correction was used only for the fish video containing complete occlusion. |
| Do the animals ever move backward? | Yes / No | Yes adds a refinement step to exclude training samples with unreliable direction labels. |
Save Config and Load Config save and load YAML files. Switch Advanced Mode opens the current settings in Advanced Tracking.
Automated processing
| Stage | Operation |
|---|---|
| Initial Tracking | Associate single-animal blobs across frames and determine initial tracking parameters |
| Direction Estimation | Assign one of eight direction classes to each retained OBB using movement direction |
| Refine Blobs | Identify and exclude potentially incorrect direction class labels when backward movement is expected |
| Clustered / Mixed Paste | Synthesize interaction images by copy-pasting single-animal blobs |
| Crop Images / Create Dataset | Crop images and prepare training and validation datasets |
| Training | Train a YOLO OBB detector on the generated dataset |
| Detection / ID Tracking / ID Correction | Detect OBBs and direction classes, associate detections over time, and refine tracks using geometric and temporal information |
| Create Video | Create a video with the tracking results overlaid |
Without direction estimation [Beta]
This is a beta feature. Check the tracking results carefully before use.
Enable Without direction estimation in Easy or Advanced Tracking when head direction is not needed or front and rear cannot be distinguished reliably. It is off by default.
This mode estimates OBBs and tracks identities without assigning direction classes. OBB rotation is retained as geometric information, but no front or rear is assigned. Stationary animals and animals with short trajectories are not excluded solely because movement cannot establish head direction.
Outputs are stored separately under <Session>/without_direction_estimation/. Final CSV files contain frame, cx0, cy0, w0, h0, … and no heading columns. Use the training data and weights generated for this mode.
Variable population [Beta]
This is a beta feature. Check the tracking results carefully before use.
Use this mode when the number of animals changes during a video, such as when animals enter or leave the field of view. It is off by default. In Easy Tracking, enabling it disables animal-count entry. In Advanced Tracking, enable it under Main → Basic Settings.
Newly appearing animals receive new IDs, while IDs that remain missing are eventually retired. The same animal may receive a new ID after re-entry. False detections or association failures can also create extra IDs, so this mode is not intended to provide exact population estimates.
Variable-mode results are saved in the variable/ folder within the tracking output directory.
7. Advanced Tracking
Configure individual stages and parameters in detail.
- Specify the session, training video, analysis video, and animal count.
- Use Adjust Parameters to measure initial values suited to the video.
- Review the stages to run and their settings.
- Select Run.
| Section | Main settings |
|---|---|
| Basic | Videos, session, animal count, image size, frame range |
| Initial Tracking | Extraction of single-animal blobs and association across frames |
| Create single animal images | Tracklets, direction class assignment, and filtering of potentially incorrect labels |
| Create with crossing | Synthesis of interaction images |
| Create dataset | Training image count, cropping, validation data |
| Training | Epochs, batch size, device, learning rate |
| Analysis | Detection, staged association, and refinement, including optional identity correction using contrastive learning |
| Create Video | Output range, FPS, overlays |
Random noise on animals [Optional, Beta]
This beta feature is still incomplete. Check the results carefully before use.
Add small patches of background over animals in synthetic training images to simulate occlusion by dirt on the lens or arena cover. Patches are added after copy-paste augmentation. This option is available only in Advanced Tracking and is off by default.
Noise Size (% of body length) sets the patch size as a percentage of body length (default 10%). Max Noise per Animal sets the maximum number of patches per animal (default 10). The number is chosen randomly from zero to this maximum. Patch shapes are random. OBB labels and masks are unchanged.
Use the skip checkboxes to run only the stages you need.
Select the trained weights for analysis using last, best, or a saved epoch number.
8. Multi Config Batch
Run multiple tracking configurations in sequence.
- Save the settings as YAML from Easy or Advanced Tracking.
- Add configuration files with Add Configs or Add Folder.
- Arrange the execution order with Up / Down.
- Select Run Queue.
9. Refinement
Review results overlaid on the video and correct head directions and individual IDs.
- AMADEUS mode: select
config.yaml, weights, and results - Dataset mode: select a video and tracking file
Dataset mode can load CSV/H5 files from AMADEUS, SLEAP, DeepLabCut, idtracker.ai, and others. To edit head direction, select data containing front and rear keypoint coordinates.
| Action | Effect |
|---|---|
| Drag an arrow endpoint | Move the front or rear keypoint |
| Drag the whole arrow | Move the animal position |
| Right-click the arrow for each of two animals | Open the ID swap popup |
| Right-click one animal's arrow twice in quick succession | Open the direction reversal popup |
| Mouse wheel | Zoom in / out |
| Drag the background | Pan the view |
| Left / right keys | Move to the previous / next frame |
| Up / down keys | Change the selected animal |
| Space | Play / pause |
| Ctrl+S (Command+S also works on macOS) | Save |
Start the following operations with no arrows selected. If an arrow is already selected, pause briefly, then right-click it once to deselect it.
Correcting persistent ID swaps
If two animals exchange IDs after crossing or coming into contact, you can correct their IDs across subsequent frames in one operation.
- Pause at the first frame where the two IDs are incorrectly assigned.
- In the video view, right-click the arrow for each of the two animals once to select both.
- Click swap onward in the popup.
- Press Ctrl+S (Command+S also works on macOS) to save the corrections.
The swap includes the current frame and all subsequent frames through the end of the loaded tracking data. It continues through later crossings and contacts. If another ID switch occurs later, repeat the procedure from that frame.
Reversing head direction
Reverse an animal's head direction by exchanging its front and rear keypoints.
- Pause at the frame where the correction should begin.
- In the video view, right-click the target animal's arrow twice in quick succession.
- In the reverse direction popup, select this frame to reverse only the current frame, or this frame onward to reverse the current frame and all subsequent frames through the end of the loaded tracking data.
- Press Ctrl+S (Command+S also works on macOS) to save the corrections.
The swap front/rear checkbox reverses all displayed arrows in the preview and exported video. Checking it alone does not change the tracking data.
10. Colab (beta)
Run a saved AMADEUS configuration in Google Colab to use a GPU.
- In Colab (beta), select the saved
config.yamland a Google Drive destination, then select Prepare for Google Colab. - After preparation, select Open Google Colab.
- In Colab, select Run all and authorize Google Drive when requested.
A GPU runtime is required. Final CSV files, result videos, required trained weights, summaries, and logs are saved to Google Drive.
11. Parameter adjustment
Start with the default settings. If a problem occurs, check the following.
| Symptom | Check first |
|---|---|
| Out of memory | Reduce the training batch size in Advanced Tracking if automatic adjustment does not resolve the error |
12. Outputs
Front and rear keypoints are derived from OBB geometry; they are not directly detected anatomical landmarks.
| Location | Contents |
|---|---|
<Session>/config.yaml |
Run settings |
<Session>/segmentation/ |
Background images and Segmentation settings |
<Session>/model/ |
Downloaded pretrained weights |
<Session>/main/<model>/ |
Training data, trained weights, tracking results, result videos |
<Session>/results/ |
Final CSV |
<Session>/log.txt, time.csv |
Logs and processing times |
The results/ folder stores the final CSV after post-processing. The standard output is <model>_<dataset>_<run>_<video>.csv. When embedding-based ID correction is run, the output is <model>_<dataset>_<run>_<video>_id_resolved.csv.
In the standard mode with direction estimation, the final CSV has one row per frame, with frame followed by cx0, cy0, w0, h0, heading0, … for each animal. Individual IDs start at 0. Coordinates and OBB dimensions are in input-video pixels: the origin is at the top left, x increases to the right, and y increases downward. The heading columns store head direction in degrees, from 0° inclusive to 360° exclusive. Zero points up and angles increase clockwise. Missing values are empty fields (NaN), and estimates are not guaranteed for every animal in every frame.
Trained weights are stored under <Session>/main/<model>/training/<video name>/weights/.
13. Recommended recording conditions
AMADEUS learns directly from the input videos, so tracking performance depends on recording conditions. The following conditions are recommended.
- For head direction estimation, a clear body axis and visually distinguishable front and rear. Use Without direction estimation when front and rear cannot be distinguished.
- A fixed camera viewing the animals from above, with movement approximately confined to a two-dimensional plane.
- Stable illumination, an essentially static background, and sufficient contrast between the animals and the background.
- Sufficient spatial resolution, frame rate, and shutter speed for reliable visual tracking in each frame.
- Sufficient periods in which animals are separated from one another. Images of isolated individuals are used to generate training data.
- A constant number of animals throughout the video. Variable population mode is also available, but identity association tends to be less reliable.
Training and analysis videos may be recorded separately, provided that the recording conditions are the same.
14. License
AMADEUS is released under the GNU Affero General Public License v3.0 only (AGPL-3.0-only). Bundled third-party components remain subject to their respective licenses. See LICENSE and third-party license information for details.