#!/usr/bin/env bash # v23 training — Fix Track 4 concept grounding failures from v22. # # v22 eval results (KS=0.1527, Pearson=0.4433) — Track 2 PASS. # v22 Track 4 failures: # # blur → continuity XX+0.261 (should be negative) # jpeg → continuity XX+0.184 (should be negative) # occlusion → minutiae_reliability XX+0.067 (should be negative) # dry_skin → contrast_uniformity XX+0.504 (should be negative) # # Root cause: --concept-deg-gamma 0.5 is too weak. # Gaussian blur naturally SMOOTHS ridges → model's continuity feature increases # with blur. L_deg with gamma=0.5 cannot overcome this natural correlation. # contrast_uniformity is only targeted by dry_skin once → single weak signal. # minutiae_reliability for occlusion similarly has a weak signal. # # v23 fix: --concept-deg-gamma 2.0 (vs v22's 0.5 — 4× stronger concept supervision) # All other settings are identical to v22. # # Note: orientation_coherence saturation (mean=0.952, always near 1.0) is NOT # fixed in v23. It requires adding concept[0] to dry_skin and wet_press targets # in DEGRADATION_CONCEPT_MAP (T39 fix, applied to src/losses/degradation_ranking.py). # v24 will include this fix. set -euo pipefail REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" export PATH="/home/aiserver/miniconda3/bin:$PATH" VERSION="v23" SAVE_DIR="${REPO_ROOT}/sifq/checkpoints/${VERSION}" LOG_FILE="${REPO_ROOT}/sifq/logs/train_${VERSION}.log" EVAL_SCRIPT="${REPO_ROOT}/sifq/scripts/run_eval_${VERSION}.sh" mkdir -p "${REPO_ROOT}/sifq/logs" python "${REPO_ROOT}/sifq/scripts/train_sifq.py" \ --root-302a "${REPO_ROOT}/dataset/302a/images/challengers" \ --root-302b "${REPO_ROOT}/dataset/302b/images/baseline" \ --root-302d "${REPO_ROOT}/dataset/nist_302d/images/auxiliary" \ --root-fvc2002 "${REPO_ROOT}/dataset/FVC_Dataset/FVC2002" \ --root-fvc2004 "${REPO_ROOT}/dataset/FVC_Dataset/FVC2004" \ --root-polyu "${REPO_ROOT}/dataset/PolyU" \ --exclude-sensor "R_1000_slap,R_500_slap,S_500_slap" \ --mdgt-checkpoint "${REPO_ROOT}/pad/TRAM-downstream/checkpoint/checkpoints_dinov2_tram/best_eer.pt" \ --epochs 60 \ --batch-size 96 \ --image-size 224 \ --lr 1e-4 \ --spread-mode uniform \ --spread-weight 3.0 \ --concept-deg-gamma 2.0 \ --sd302-concept-weight 0.0 \ --deg-every-n-steps 2 \ --no-mat-stats \ --proto-max-batches 0 \ --k-cross 0 \ --max-train-samples -1 \ --num-workers 8 \ --gpus 0 \ --save-dir "${SAVE_DIR}" echo "[auto-eval] Training done. Starting eval ${VERSION}..." bash "${EVAL_SCRIPT}" >> "${LOG_FILE}" 2>&1