FlanChanXwO commited on
Commit
1b180c3
·
verified ·
1 Parent(s): 3f7ccc7

Upload docs/EVALUATION.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. docs/EVALUATION.md +78 -49
docs/EVALUATION.md CHANGED
@@ -1,25 +1,21 @@
1
- # 评估方法 (EVALUATION.md)
2
 
3
- > **English summary**: The 87.6% login rate comes from real forum logins, not offline guessing.
4
- > Each attempt: fetch login page → fetch captcha → model inference → submit → the forum's
5
- > response is the ground truth ("login success" = correct, "code incorrect" = wrong). 100
6
- > attempts, 97 valid (3 rate-limited), 85 successes = 87.6%. Validation-set accuracy (held out,
7
- > 79 images) was 88.6%, cross-confirming the result.
8
 
9
  本文档说明 **87.6% 登录命中率** 是如何测量的,保证结果可复现、可信。
10
 
11
- ## 核心原则
12
 
13
- 南+ 验证码的 ground truth 没有公开数据集,因此我们使用**真实论坛登录**作为唯一的、100% 可靠的判定标准:
14
 
15
  > **论坛返回"登录成功" = 模型识别正确**
16
  > **论坛返回"认证码不正确或已过期" = 模型识别错误**
17
 
18
  每次判定都是干净的二元结果,不依赖任何主观估计。
19
 
20
- ## 测试流程 (逐次尝试)
21
-
22
- 对每一次尝试,严格按登录流程执行:
23
 
24
  1. **抓取登录页** → 解析表单与验证码 URL(带会话 cookie)
25
  2. **抓取验证码图片**(带时间戳防缓存,150x60 PNG)
@@ -28,71 +24,104 @@
28
  5. **读论坛响应** → 成功 / "认证码不正确"
29
  6. **清空本地会话** → 下一次以全新游客身份开始
30
 
31
- 关键保证:
32
- - 每张验证码绑定独立会话,识别结果与提交严格一一对应,**不存在会话错位**
33
- - 失败响应用 `SP_DEBUG_LOGIN` 落盘逐条核对,确认是真实"认证码不正确",而非网络错误/风控页
34
- - 网络层干扰(连接超时、挑战页)不计入统计
35
 
36
- ## 测试环境
37
 
38
  | 项 | 值 |
39
  |---|---|
40
  | 站点 | south-plus.net |
41
  | 网络 | 家庭 IP + Cloudflare IP 钉定(绕过 DNS 污染) |
42
  | 请求间隔 | 7 秒(尊重论坛限流) |
43
- | 账号 | 真实有效账号,密码经登录成功确认 |
44
  | 模型 | captcha_1000_raw.onnx (88.6% val) |
45
 
46
- ## 结果
47
 
48
- ### 100 次登录 (最终正式测试)
49
 
50
  | 结果 | 次数 |
51
  |---|---|
52
  | 登录成功 | **85** |
53
  | 认证码不正确 | 12 |
54
- | 被论坛风控拦截 (不计入) | 3 |
55
- | **合计有效** | **97** |
56
 
57
  **单次命中率 = 85/97 = 87.6%**
58
 
59
- ### 早期小样本 (供参考)
60
 
61
- | 测试 | 结果 | 命中率 |
62
- |---|---|---|
63
- | 15 次 | 13/15 | 86.7% |
64
 
65
- ### 重试收益
66
 
67
- 论坛登录流程支持多次重试(每次抓新验证码):
 
 
68
 
69
- ```
70
- P(6次内至少成功1次) = 1 - (1 - 0.876)^6 = 99.9997%
71
- ```
72
 
73
- 即:**平均 10000 次登录中,约 3 次会在 6 次重试内全部失败。**
74
 
75
- ## 置信度
76
 
77
- - 100 次大样本 + 每次二元硬判定 → 统计置信度高
78
- - 与 15 次小样本 (86.7%) 高度一致 → 结果稳定
79
- - 留出验证集 (79 张, 8%) 精度 88.6% 与登录命中率 (87.6%) 接近 → 交叉印证
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
- ## 复现
82
 
83
- 评估使用的工具链(harness)在 `scripts/` 下,核心逻辑:
84
 
85
- ```
86
- tmp_captest/main.go 登录测试 harness(抓取→识别→提交→判定→清会话)
87
- scripts/onnx_ocr_raw.py 模型推理(RGB 160x64 /255 → argmax)
88
- ```
89
 
90
- 真实测试命令:
91
- ```bash
92
- go run ./tmp_captest -mode login -n 100 -gap 7 \
93
- -user <USER> -pass <PASS> -variant onnx \
94
- -ocr scripts/onnx_ocr_raw.py -ip 104.21.43.10 \
95
- -out /tmp/sp_test
96
- ```
97
 
98
- > 注意:南+ 对登录有风控,测试请控制节奏并尊重论坛规则。
 
1
+ # 评估方法 / Evaluation
2
 
3
+ ---
4
+
5
+ ## 中文
 
 
6
 
7
  本文档说明 **87.6% 登录命中率** 是如何测量的,保证结果可复现、可信。
8
 
9
+ ### 核心原则
10
 
11
+ 南+ 验证码没有公开的 ground truth 数据集,因此使用**真实论坛登录**作为唯一、100% 可靠的判定标准:
12
 
13
  > **论坛返回"登录成功" = 模型识别正确**
14
  > **论坛返回"认证码不正确或已过期" = 模型识别错误**
15
 
16
  每次判定都是干净的二元结果,不依赖任何主观估计。
17
 
18
+ ### 测试流程(逐次尝试)
 
 
19
 
20
  1. **抓取登录页** → 解析表单与验证码 URL(带会话 cookie)
21
  2. **抓取验证码图片**(带时间戳防缓存,150x60 PNG)
 
24
  5. **读论坛响应** → 成功 / "认证码不正确"
25
  6. **清空本地会话** → 下一次以全新游客身份开始
26
 
27
+ 保证:
28
+ - 每张验证码绑定独立会话,识别与提交严格一一对应,无会话错位
29
+ - 失败响应用 `SP_DEBUG_LOGIN` 落盘逐条核对,确认为真实"认证码不正确",而非网络/风控
30
+ - 网络层干扰不计入统计
31
 
32
+ ### 测试环境
33
 
34
  | 项 | 值 |
35
  |---|---|
36
  | 站点 | south-plus.net |
37
  | 网络 | 家庭 IP + Cloudflare IP 钉定(绕过 DNS 污染) |
38
  | 请求间隔 | 7 秒(尊重论坛限流) |
39
+ | 账号 | 真实有效账号 |
40
  | 模型 | captcha_1000_raw.onnx (88.6% val) |
41
 
42
+ ### 结果
43
 
44
+ **100 次登录(最终正式测试)**
45
 
46
  | 结果 | 次数 |
47
  |---|---|
48
  | 登录成功 | **85** |
49
  | 认证码不正确 | 12 |
50
+ | 被论坛风控拦截(不计入) | 3 |
51
+ | 合计有效 | **97** |
52
 
53
  **单次命中率 = 85/97 = 87.6%**
54
 
55
+ 早期小样本:15 次测试 13/15 = 86.7%(供参考)。
56
 
57
+ **重试收益**:`P(6次内至少成功1次) = 1 - (1 - 0.876)^6 ≈ 99.9997%`,即平均 1 万次登录中约 3 次会在 6 次重试内全部失败。
 
 
58
 
59
+ ### 置信度
60
 
61
+ - 100 次大样本 + 每次二元硬判定 → 统计置信度高
62
+ - 与 15 次小样本(86.7%)高度一致 → 结果稳定
63
+ - 留出验证集(79 张)88.6% 与登录命中 87.6% 接近 → 交叉印证
64
 
65
+ ---
 
 
66
 
67
+ ## English
68
 
69
+ This document explains how the **87.6% login success rate** was measured, so the result is reproducible and trustworthy.
70
 
71
+ ### Core principle
72
+
73
+ There is no public ground-truth dataset for this captcha, so we use **real forum logins** as the sole, 100%-reliable judge:
74
+
75
+ > **"Login success" from the forum = the model was correct**
76
+ > **"Code incorrect or expired" = the model was wrong**
77
+
78
+ Every attempt is a clean binary verdict — no subjective estimation.
79
+
80
+ ### Test flow (per attempt)
81
+
82
+ 1. Fetch the login page → parse the form and captcha URL (with session cookie)
83
+ 2. Fetch the captcha image (timestamp-cache-busted, 150x60 PNG)
84
+ 3. Model inference → 4 digits
85
+ 4. Submit login (session cookie + hidden form fields + the code)
86
+ 5. Read the forum response → success / "code incorrect"
87
+ 6. Clear the local session → next attempt starts as a fresh guest
88
+
89
+ Guarantees:
90
+ - Each captcha is bound to its own session; recognition and submission are 1:1, no session mismatch
91
+ - Failed responses are dumped via `SP_DEBUG_LOGIN` and checked one by one to confirm genuine "code incorrect", not network/rate-limit pages
92
+ - Network-level interference is excluded from statistics
93
+
94
+ ### Test environment
95
+
96
+ | Item | Value |
97
+ |---|---|
98
+ | Site | south-plus.net |
99
+ | Network | home IP + Cloudflare IP pinning (bypasses DNS poisoning) |
100
+ | Request interval | 7 seconds (respecting forum rate limits) |
101
+ | Account | a real, valid account |
102
+ | Model | captcha_1000_raw.onnx (88.6% val) |
103
+
104
+ ### Results
105
+
106
+ **100 logins (final formal test)**
107
+
108
+ | Result | Count |
109
+ |---|---|
110
+ | Login success | **85** |
111
+ | Code incorrect | 12 |
112
+ | Rate-limited (excluded) | 3 |
113
+ | Valid total | **97** |
114
+
115
+ **Per-attempt success = 85/97 = 87.6%**
116
 
117
+ Early small sample: 13/15 = 86.7% (for reference).
118
 
119
+ **With retries**: `P(success within 6 tries) = 1 - (1 - 0.876)^6 ≈ 99.9997%` — about 3 in 10,000 logins fail after 6 retries.
120
 
121
+ ### Confidence
 
 
 
122
 
123
+ - 100-attempt sample with hard binary verdicts → high statistical confidence
124
+ - Consistent with the 15-attempt sample (86.7%) → stable result
125
+ - Held-out validation set (79 images) at 88.6% cross-confirms the login figure (87.6%)
 
 
 
 
126
 
127
+ ---