EchoScout-FourTask / code /README.md
zhizeng115's picture
Complete four-task dataset and portable code release
7e7a152 verified
|
Raw History Blame Contribute Delete
8.45 kB

EchoScout four-task search code

Portable source release for the EchoScout four-task benchmark. This archive contains implementation, configuration, dependency specifications, and synthetic code checks only. The data archives in the parent repository provide the matching dataset. Model weights, deployment credentials, logs, and repository history are not bundled.

Contents

  • omini/: binaural feature extraction, temporal audio encoder (41 tokens), normalization helpers, and canonical waveform preprocessing.
  • training/stereo_backbones_v1/: Qwen3.5-9B and InternVL3.5-8B extension, audio alignment, standalone SFT, and audiovisual inverse dynamics (AV-IDM).
  • training/hvs_visual_to_audio_v1/: HVS-3B extension from visual SFT+IDM initialization, including the validation retention gate.
  • training/vision_sft_idm_v1/: HVS visual initialization training.
  • training/echoscout_no_sft_v1/: matched ablation removing only standalone SFT.
  • Other training subdirectories: shared data construction and objective utilities.
  • evaluation/fourtask_common_v3/: semantic prompts, legal action parser, local model registry, and input protocol.
  • tools/: panorama projection, deterministic scoring, and file utilities.

Directory version suffixes are import-compatible implementation namespaces; they do not contain historical run artifacts.

Environment

Use Linux, Python 3.11 or later, and a CUDA GPU supporting BF16. Install a CUDA-compatible PyTorch build and then the dependencies:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
export PYTHONPATH="$PWD:$PWD/tools"
python tests/check_code.py
python tests/check_numeric.py

Pinned versions reflect the source training runtime. Only CPU code checks, not full GPU training or checkpoint inference, were run on this portable export. Full-parameter training uses host-side FP32 optimizer state; the configuration retains the original memory and storage requirements. No automatic GPU allocation, remote access, downloading, or job scheduler is included. Run commands from the extracted package root.

External inputs

Supply local model directories in configs/models.json. They must contain the corresponding native pretrained model and processor files. Loading uses local_files_only=True; no credentials or automatic model downloads are used. The HVS entry expects the HVS visual backbone, not an arbitrary Qwen checkpoint.

Supply the pretrained binaural encoder as checkpoints/audio_encoder/encoder_best.pt. Its architecture metadata is in configs/audio_encoder.json (355 semantic classes, two temporal layers). This is an initialization dependency and is intentionally not bundled. The checkpoint is loaded strictly; a differently trained or randomly initialized encoder is not an equivalent replacement.

Extract the matching data archives from the parent dataset repository with python ../scripts/extract_data.py --destination .. DATA_FORMAT.md describes expected locations and fields. Dataset size constants are protocol specifications, not experimental outcomes.

For the HVS branch, supply a verified visual SFT+IDM initialization checkpoint, or produce one using the included initialization code:

python training/vision_sft_idm_v1/train_sft.py --model hvs_original --gpu 0
python training/vision_sft_idm_v1/train_idm.py --model hvs_original --gpu 0
python configure.py --bind-visual

--bind-visual verifies the initializer against its complete.json and binds its SHA256 in the HVS configuration. It does not select a checkpoint from test results. Without this step the placeholder hash deliberately prevents using an unverified initializer. The no-SFT HVS ablation retains this visual ancestor.

Data preparation

With source assets and annotations present:

python prepare_data.py merge
python prepare_data.py policy
python prepare_data.py auxiliary

These create policy rows, visibility-gated expert trajectories, paired temporal counterfactuals, and integrity manifests under workspace/. The builders reject train/validation/test scene or clip overlap. They do not establish disjointness of all underlying assets or pretrained-model exposure.

Training

Edit portable paths in the relevant config.json files before starting a run. After configuration changes, refresh the matched-ablation integrity hashes:

python configure.py
python training/echoscout_no_sft_v1/train.py --model qwen35_9b --verify-only

The default full method uses connector-only alignment followed by full-parameter SFT and AV-IDM, without LoRA. AV-IDM retains the joint search policy loss. Training budgets, learning rates, validation rules, task sampling, and loss weights are specified in the source/configuration.

python training/stereo_backbones_v1/train.py --model qwen35_9b --gpu 0 --smoke-only
python training/stereo_backbones_v1/train.py --model qwen35_9b --gpu 0
python training/stereo_backbones_v1/train.py --model internvl35_8b --gpu 0
python training/hvs_visual_to_audio_v1/train.py --model hvs_original --gpu 0

The smoke option performs real per-task backward checks after inputs are installed. It is not a substitute for the full training budget. Partial runs are deliberately not silently restarted with a fresh optimizer.

Matched no-standalone-SFT ablation:

python training/echoscout_no_sft_v1/train.py --model qwen35_9b --gpu 0
python training/echoscout_no_sft_v1/train.py --model internvl35_8b --gpu 0
python training/echoscout_no_sft_v1/train.py --model hvs_original --gpu 0

This wrapper verifies local source hashes, removes only the standalone SFT stage, and retains alignment, initialization, and AV-IDM policy supervision. Hashes are for this portable source package, not the original deployment.

Evaluation

Training completion and a nonempty final checkpoint are required. For example:

python training/stereo_backbones_v1/evaluate.py --model stereo_qwen35_9b_idm --suite static --gpu 0
python training/stereo_backbones_v1/evaluate.py --model stereo_qwen35_9b_idm --suite sound --gpu 0
python training/hvs_visual_to_audio_v1/evaluate.py --model visual_to_audio_hvs_original_idm --suite sound --gpu 0
python training/echoscout_no_sft_v1/evaluate.py --model echoscout_no_sft_internvl35_8b --suite sound --gpu 0

Run both suites for each model. static covers HOS; sound covers category, duration, and temporal-order search. Inference outputs would be written under runs/ when executed; this directory is not included in the archive. The runner verifies exact episode IDs and independently replays actions and recomputes scores on completion. Intermediate counts are not final results.

Qwen/InternVL input-removal evaluation uses:

python training/stereo_backbones_v1/ablation.py --model stereo_qwen35_9b_idm --ablation no_audio --suite sound --gpu 0

no_image is also supported. Every invocation performs its own inference; no static results are bundled or reused.

Protocol and limitations

The search policy sees the current local view plus at most two historical views/actions, a text instruction, and (for sound tasks) the complete fixed 10-second stereo recording. Camera rotation does not rotate the microphone recording. There are at most ten decisions including submission; invalid outputs consume a decision without changing pose. Generation is greedy with 512 new tokens. Native backbone image/token serialization can differ even when source observations and semantic prompts are identical.

Canonical per-channel RMS normalization preserves channel ordering and phase structure but removes absolute inter-channel level differences. Auxiliary counterfactual recordings are dry mixtures duplicated across channels; they teach temporal semantics and do not simulate binaural spatial acoustics. Visibility and sound scoring use annotation-derived geometric proxies. Checkpoint selection uses validation, never test performance.

Export changes

Deployment paths were replaced with package-relative configuration. The registry was reduced to the supported backbones, unrelated schedulers and recovery exceptions were omitted, shared utilities were extracted, and matched-ablation hashes were regenerated. Numerical preprocessing, model modules, objectives, action parsing, and scoring were retained. Public third-party attribution remains in THIRD_PARTY_NOTICES.md and licenses/.