File size: 3,407 Bytes
cfc7a54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env bash
# v32 training — T42 concept map: dry_skin [4,2,0] → [4,0] (remove continuity)
#
# Goal: Fix spurious noise_level crosstalk in dry_skin degradation (v31: Spearman -0.758).
#   noise_level [3] is NOT in the dry_skin target but drops strongly in v31.
#   Hypothesis: continuity [2] shares backbone features with noise texture → when
#   concept[2] is pulled down by dry_skin, concept[3] follows via shared feature paths.
#   Removing continuity forces disambiguation via contrast[4] + orientation[0] only.
#
# Key changes vs v31 (T42 concept map):
#   1. dry_skin: [4, 2, 0] → [4, 0]  (remove continuity)
#      Continuity [2] shares patch-scale features with noise texture → causes
#      spurious noise_level[3] activation (v31: Spearman -0.758 on non-target).
#      Fix: use contrast[4] + orientation[0] only (regional features, not shared).
#   2. noise:    [3]       → [1, 3]  (add clarity as co-target)
#      TinyViT patch embed (16×16) averages out pixel Gaussian noise → concept[3]
#      gets almost no gradient (v31: noise→noise_level Spearman only -0.081).
#      Adding clarity[1] anchors noise degradation to ridge-valley blur at patch
#      scale → strong ViT signal → reinforces concept[3] training direction.
#   Note: T41 proposed both changes but v29 failed due to --concept-spread-weight,
#   NOT the concept map. v32 uses T42 map with no --concept-spread-weight.
#
# Inherited from v31 (unchanged):
#   --teacher dinov2_raw, --no-mat-stats, --spread-weight 4.0
#   --concept-deg-gamma 2.0, --k-cross 0, --deg-every-n-steps 2
#
# Expected:
#   Track 2: KS ≤ 0.15, Pearson ≥ 0.80 (concept map change should not affect)
#   Track 4: dry_skin → noise_level crosstalk ↓ from -0.758
#            noise → noise_level Spearman ↓ from -0.081 (stronger signal)
#            dry_skin → contrast_uni, orient_coh remain strong

set -euo pipefail

REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
export PATH="/home/aiserver/miniconda3/bin:$PATH"

VERSION="v32"
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/nist302a/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" \
#   --teacher dinov2_raw \
#   --dinov2-model dinov2_vits14 \
#   --no-mat-stats \
#   --proto-max-batches 0 \
#   --epochs 60 \
#   --batch-size 96 \
#   --image-size 224 \
#   --lr 1e-4 \
#   --spread-mode uniform \
#   --spread-weight 4.0 \
#   --concept-deg-gamma 2.0 \
#   --sd302-concept-weight 0.0 \
#   --deg-every-n-steps 2 \
#   --k-cross 0 \
#   --max-train-samples -1 \
#   --num-workers 8 \
#   --gpus 0 \
#   --save-dir "${SAVE_DIR}" \
#   --wandb \
#   --wandb-offline \
#   --wandb-project "sifq" \
#   --wandb-run-name "${VERSION}" \
#   2>&1 | tee "${LOG_FILE}"

echo "[auto-eval] Training done. Starting eval ${VERSION}..."
bash "${EVAL_SCRIPT}" >> "${LOG_FILE}" 2>&1