systemslibrarian commited on
Commit
32035fb
·
verified ·
1 Parent(s): 9a8d290

Model save

Browse files
Files changed (1) hide show
  1. README.md +51 -65
README.md CHANGED
@@ -1,87 +1,73 @@
1
  ---
2
- license: mit
3
  library_name: transformers
 
 
4
  tags:
5
- - text-classification
6
- - cryptography
7
- - cryptanalysis
8
- - classical-ciphers
9
- - cybersecurity-education
10
- datasets:
11
- - systemslibrarian/classical-cipher-corpus
12
  metrics:
13
- - accuracy
14
- - f1
 
 
15
  ---
16
 
17
- # Cipher Detective Classifier
 
18
 
19
- A Transformer-based educational classifier for identifying broad classical-cipher families from ciphertext-like text.
20
 
21
- **Part of the Cipher Detective AI project:**
22
- - 🕵️ Space: [systemslibrarian/cipher-detective-ai](https://huggingface.co/spaces/systemslibrarian/cipher-detective-ai)
23
- - 📦 Dataset: [systemslibrarian/classical-cipher-corpus](https://huggingface.co/datasets/systemslibrarian/classical-cipher-corpus)
24
- - 🤖 Model: [systemslibrarian/cipher-detective-classifier](https://huggingface.co/systemslibrarian/cipher-detective-classifier) _(this repo)_
 
 
 
25
 
26
- ## Intended use
27
 
28
- This model supports the **Cipher Detective AI** Hugging Face Space. It is intended for:
29
 
30
- - cryptography education
31
- - classical cipher demonstrations
32
- - comparison against transparent heuristic baselines
33
- - teaching why weak ciphers leak patterns
34
 
35
- ## Labels
36
 
37
- - `plaintext`
38
- - `caesar_rot`
39
- - `atbash`
40
- - `vigenere`
41
- - `rail_fence`
42
- - `columnar`
43
- - `affine`
44
- - `substitution`
45
 
46
- ## Not intended for
47
 
48
- - breaking modern encryption
49
- - unauthorized access
50
- - surveillance
51
- - password recovery
52
- - bypassing security controls
53
- - claims about real-world cryptanalytic capability
54
 
55
- ## Training
56
 
57
- ```bash
58
- python scripts/convert_museum_corpus.py \
59
- --museum /path/to/cipher-museum/public/corpus/all.jsonl \
60
- --out data/cipher_examples.jsonl --split all
61
- python scripts/train_transformer.py \
62
- --data data/cipher_examples.jsonl \
63
- --model distilbert-base-uncased \
64
- --out cipher_model \
65
- --epochs 3 --batch-size 64
66
- ```
 
 
 
67
 
68
- Training data: **100,026 examples** from [systemslibrarian/classical-cipher-corpus](https://huggingface.co/datasets/systemslibrarian/classical-cipher-corpus) — sourced from the [Cipher Museum](https://ciphermuseum.com) public corpus (CC0).
69
 
70
- ## Evaluation (3 epochs, 20% held-out test set)
 
 
 
 
 
 
71
 
72
- | Metric | Value |
73
- |---|---|
74
- | Accuracy | **48.3%** |
75
- | Macro Precision | **56.9%** |
76
- | Macro Recall | **52.0%** |
77
- | Macro F1 | **51.8%** |
78
 
79
- 81-class classification (random baseline ≈ 1.2%). Performance varies significantly by cipher family — substitution families with distinctive patterns (Caesar, Atbash, Morse) score highest; machine ciphers with similar statistical profiles (Enigma, Lorenz, SIGABA) are harder to distinguish from surface text alone.
80
 
81
- ## Limitations
82
-
83
- The model learns surface statistical patterns from the ciphertext text field. It can confuse cipher families with similar statistics, especially machine ciphers, polyalphabetic variants, and short samples. It should be presented as a teaching classifier, not as a cryptanalytic authority.
84
-
85
- ## Responsible-use statement
86
-
87
- Use this model to teach how classical ciphers leak patterns and why modern cryptography requires careful protocol design, key management, implementation correctness, and threat modeling.
 
1
  ---
 
2
  library_name: transformers
3
+ license: apache-2.0
4
+ base_model: distilbert-base-uncased
5
  tags:
6
+ - generated_from_trainer
 
 
 
 
 
 
7
  metrics:
8
+ - accuracy
9
+ model-index:
10
+ - name: cipher-detective-classifier
11
+ results: []
12
  ---
13
 
14
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
15
+ should probably proofread and complete it, then remove this comment. -->
16
 
17
+ # cipher-detective-classifier
18
 
19
+ This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) on the None dataset.
20
+ It achieves the following results on the evaluation set:
21
+ - Loss: 1.2801
22
+ - Accuracy: 0.6127
23
+ - Macro Precision: 0.6196
24
+ - Macro Recall: 0.6392
25
+ - Macro F1: 0.6217
26
 
27
+ ## Model description
28
 
29
+ More information needed
30
 
31
+ ## Intended uses & limitations
 
 
 
32
 
33
+ More information needed
34
 
35
+ ## Training and evaluation data
 
 
 
 
 
 
 
36
 
37
+ More information needed
38
 
39
+ ## Training procedure
 
 
 
 
 
40
 
41
+ ### Training hyperparameters
42
 
43
+ The following hyperparameters were used during training:
44
+ - learning_rate: 2e-05
45
+ - train_batch_size: 32
46
+ - eval_batch_size: 32
47
+ - seed: 42
48
+ - gradient_accumulation_steps: 2
49
+ - total_train_batch_size: 64
50
+ - optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
51
+ - lr_scheduler_type: cosine
52
+ - lr_scheduler_warmup_steps: 0.06
53
+ - num_epochs: 5.0
54
+ - mixed_precision_training: Native AMP
55
+ - label_smoothing_factor: 0.05
56
 
57
+ ### Training results
58
 
59
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy | Macro Precision | Macro Recall | Macro F1 |
60
+ |:-------------:|:-----:|:----:|:---------------:|:--------:|:---------------:|:------------:|:--------:|
61
+ | 3.6387 | 1.0 | 912 | 1.7823 | 0.4904 | 0.5276 | 0.5280 | 0.5108 |
62
+ | 3.0345 | 2.0 | 1824 | 1.4479 | 0.5485 | 0.5757 | 0.5806 | 0.5552 |
63
+ | 2.7365 | 3.0 | 2736 | 1.3711 | 0.5835 | 0.6195 | 0.6139 | 0.5988 |
64
+ | 2.5225 | 4.0 | 3648 | 1.2933 | 0.6067 | 0.6196 | 0.6332 | 0.6186 |
65
+ | 2.6116 | 5.0 | 4560 | 1.2801 | 0.6127 | 0.6196 | 0.6392 | 0.6217 |
66
 
 
 
 
 
 
 
67
 
68
+ ### Framework versions
69
 
70
+ - Transformers 5.13.1
71
+ - Pytorch 2.11.0+cu128
72
+ - Datasets 4.0.0
73
+ - Tokenizers 0.22.2