#!/usr/bin/env bash # v24 training — Fix orientation_coherence saturation (T39) on top of v23 fixes. # # v23 fix (already in code): --concept-deg-gamma 2.0 # v24 additional fix: T39 — orientation_coherence [0] added to dry_skin + wet_press # # Problem from v22 eval: # orientation_coherence: mean=0.952, std=0.135, p5=0.936, p95=0.989 — SATURATED # contrast_uniformity: mean=0.038, std=0.005 — DEAD (near-constant) # # orientation_coherence has NO L_deg target in any degradation → no downward signal # → backbone's orientation features map to ~1.0 for every real fingerprint. # # T39 fix in src/losses/degradation_ranking.py: # dry_skin: [4, 2] → [4, 2, 0] (fragmentation → incoherent local orientations) # wet_press: [1, 5] → [1, 5, 0] (ridge merging → false orientation patterns) # # v24 settings = v23 settings + T39 concept map update set -euo pipefail REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" export PATH="/home/aiserver/miniconda3/bin:$PATH" VERSION="v24" 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