itsjustahobby commited on
Commit
fbfd257
·
verified ·
1 Parent(s): 1ccb22f
README.md ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: bert-large-uncased
4
+ tags:
5
+ - generated_from_trainer
6
+ - phishing
7
+ - BERT
8
+ metrics:
9
+ - accuracy
10
+ - precision
11
+ - recall
12
+ model-index:
13
+ - name: bert-finetuned-phishing
14
+ results: []
15
+ widget:
16
+ - text: https://www.verif22.com
17
+ example_title: Phishing URL
18
+ - text: Dear colleague, An important update about your email has exceeded your
19
+ storage limit. You will not be able to send or receive all of your messages.
20
+ We will close all older versions of our Mailbox as of Friday, June 12, 2023.
21
+ To activate and complete the required information click here (https://ec-ec.squarespace.com).
22
+ Account must be reactivated today to regenerate new space. Management Team
23
+ example_title: Phishing Email
24
+ - text: You have access to FREE Video Streaming in your plan. REGISTER with your email, password and
25
+ then select the monthly subscription option. https://bit.ly/3vNrU5r
26
+ example_title: Phishing SMS
27
+ - text: if(data.selectedIndex > 0){$('#hidCflag').val(data.selectedData.value);};;
28
+ var sprypassword1 = new Spry.Widget.ValidationPassword("sprypassword1");
29
+ var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "email");
30
+ example_title: Phishing Script
31
+ - text: Hi, this model is really accurate :)
32
+ example_title: Benign message
33
+ datasets:
34
+ - ealvaradob/phishing-dataset
35
+ language:
36
+ - en
37
+ pipeline_tag: text-classification
38
+ ---
39
+
40
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
41
+ should probably proofread and complete it, then remove this comment. -->
42
+
43
+ # BERT FINETUNED ON PHISHING DETECTION
44
+
45
+ This model is a fine-tuned version of [bert-large-uncased](https://huggingface.co/bert-large-uncased) on an [phishing dataset](https://huggingface.co/datasets/ealvaradob/phishing-dataset),
46
+ capable of detecting phishing in its four most common forms: URLs, Emails, SMS messages and even websites.
47
+
48
+ It achieves the following results on the evaluation set:
49
+
50
+ - Loss: 0.1953
51
+ - Accuracy: 0.9717
52
+ - Precision: 0.9658
53
+ - Recall: 0.9670
54
+ - False Positive Rate: 0.0249
55
+
56
+ ## Model description
57
+
58
+ BERT is a transformers model pretrained on a large corpus of English data in a self-supervised fashion.
59
+ This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why
60
+ it can use lots of publicly available data) with an automatic process to generate inputs and labels from
61
+ those texts.
62
+
63
+ This model has the following configuration:
64
+
65
+ - 24-layer
66
+ - 1024 hidden dimension
67
+ - 16 attention heads
68
+ - 336M parameters
69
+
70
+ ## Motivation and Purpose
71
+
72
+ Phishing is one of the most frequent and most expensive cyber-attacks according to several security reports.
73
+ This model aims to efficiently and accurately prevent phishing attacks against individuals and organizations.
74
+ To achieve it, BERT was trained on a diverse and robust dataset containing: URLs, SMS Messages, Emails and
75
+ Websites, which allows the model to extend its detection capability beyond the usual and to be used in various
76
+ contexts.
77
+
78
+ ### Training hyperparameters
79
+
80
+ The following hyperparameters were used during training:
81
+ - learning_rate: 2e-05
82
+ - train_batch_size: 16
83
+ - eval_batch_size: 16
84
+ - seed: 42
85
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
86
+ - lr_scheduler_type: linear
87
+ - num_epochs: 4
88
+
89
+ ### Training results
90
+
91
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy | Precision | Recall | False Positive Rate |
92
+ |:-------------:|:-----:|:-----:|:---------------:|:--------:|:---------:|:------:|:-------------------:|
93
+ | 0.1487 | 1.0 | 3866 | 0.1454 | 0.9596 | 0.9709 | 0.9320 | 0.0203 |
94
+ | 0.0805 | 2.0 | 7732 | 0.1389 | 0.9691 | 0.9663 | 0.9601 | 0.0243 |
95
+ | 0.0389 | 3.0 | 11598 | 0.1779 | 0.9683 | 0.9778 | 0.9461 | 0.0156 |
96
+ | 0.0091 | 4.0 | 15464 | 0.1953 | 0.9717 | 0.9658 | 0.9670 | 0.0249 |
97
+
98
+
99
+ ### Framework versions
100
+
101
+ - Transformers 4.34.1
102
+ - Pytorch 2.1.1+cu121
103
+ - Datasets 2.14.6
104
+ - Tokenizers 0.14.1
config.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "bert-large-uncased",
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 1024,
12
+ "id2label": {
13
+ "0": "benign",
14
+ "1": "phishing"
15
+ },
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 4096,
18
+ "label2id": {
19
+ "benign": 0,
20
+ "phishing": 1
21
+ },
22
+ "layer_norm_eps": 1e-12,
23
+ "max_position_embeddings": 512,
24
+ "model_type": "bert",
25
+ "num_attention_heads": 16,
26
+ "num_hidden_layers": 24,
27
+ "pad_token_id": 0,
28
+ "position_embedding_type": "absolute",
29
+ "problem_type": "single_label_classification",
30
+ "torch_dtype": "float32",
31
+ "transformers_version": "4.34.1",
32
+ "type_vocab_size": 2,
33
+ "use_cache": true,
34
+ "vocab_size": 30522
35
+ }
gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7fc8fd8ff9eb431b5876bff2e94d0ba31987fc2301942b65d1306eba9d18646
3
+ size 1340710638
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": true,
47
+ "mask_token": "[MASK]",
48
+ "model_max_length": 512,
49
+ "pad_token": "[PAD]",
50
+ "sep_token": "[SEP]",
51
+ "strip_accents": null,
52
+ "tokenize_chinese_chars": true,
53
+ "tokenizer_class": "BertTokenizer",
54
+ "unk_token": "[UNK]"
55
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d104fd966c5439370d740371ebeae1a9b747a93c604762957f98ecfeec61108
3
+ size 4536
vocab.txt ADDED
The diff for this file is too large to render. See raw diff