CoolFace
Modelpublic

attack-vector/SecureModernBERT-NER

sourceHugging Facemitupdated 9mo agoView on Hugging Face
2likes764downloads
Model Card

Model Overview

SecureModernBERT-NER represents a new generation of cybersecurity-focused language models — combining the state-of-the-art architecture of ModernBERT with one of the largest and most diverse CTI-labelled NER corpora ever built.

Unlike conventional NER systems, SecureModernBERT-NER recognises 22 finely-grained, security-specific entity types, covering the full spectrum of cyber-threat intelligence — from THREAT-ACTOR and MALWARE to CVE, IPV4, DOMAIN, and REGISTRY-KEYS.

Trained on more than half a million manually curated spans sourced from real-world threat reports, vulnerability advisories, and incident analyses, it achieves an exceptional balance of accuracy, generalisation, and contextual depth.

This model is designed to parse complex security narratives with human-level precision, extracting both contextual metadata (e.g., ORG, PRODUCT, PLATFORM) and highly technical indicators (e.g., HASHES, URLS, NETWORK ADDRESSES) — all within a single unified framework.

SecureModernBERT-NER sets a new standard for automated CTI entity recognition, enabling the next wave of threat-intelligence automation, enrichment, and analytics.

Quick Start

python
from transformers import pipeline

model_id = "attack-vector/SecureModernBERT-NER"

pipe = pipeline(
    task="token-classification",
    model=model_id,
    tokenizer=model_id,
    aggregation_strategy="first",
)

text = "TrickBot connects to hxxp://185.222.202.55 to exfiltrate data from Windows hosts."
predictions = pipe(text)
for pred in predictions:
    print(pred)

Sample output:

{'entity_group': 'MALWARE', 'score': np.float32(0.9615546), 'word': 'TrickBot', 'start': 0, 'end': 8}
{'entity_group': 'URL', 'score': np.float32(0.9905957), 'word': ' hxxp://185.222.202.55', 'start': 20, 'end': 42}
{'entity_group': 'PLATFORM', 'score': np.float32(0.92317337), 'word': ' Windows', 'start': 66, 'end': 74}

Intended Use & Limitations

  • Use cases: automated tagging of CTI reports, IOC extraction pipelines, knowledge-base enrichment, security-focused RAG systems.
  • Languages: English (model was trained and evaluated on English sources only).
  • Input format: free-form prose or long-form CTI articles; maximum sequence length 128 tokens during training.
  • Limitations: noisy or ambiguous extractions may occur, especially with rare entity types (IPV6, EMAIL) and obfuscated strings. The model does not normalise entities (e.g., deobfuscating hxxp) nor validate indicator authenticity. Always pair with downstream validation and human review.

Training Data

  • Size: 502,726 labelled text spans before filtering; 22 distinct entity classes in BIO format.
  • Label distribution (spans): ORG (approx. 198k), PRODUCT (approx. 79k), MALWARE (approx. 67k), PLATFORM (approx. 57k), THREAT-ACTOR (approx. 49k), SERVICE (approx. 46k), CVE (approx. 41k), LOC (approx. 38k), SECTOR (approx. 34k), TOOL (approx. 29k), plus indicator types such as URL, IPV4, SHA256, MD5, and REGISTRY-KEYS.
  • Pre-processing: JSONL articles were tokenised and converted to BIO tags; spans in conflict were resolved manually and via automated heuristics before upload.

Label Mapping

LabelDescriptionExample mention
URLWeb address or obfuscated link used in campaigns.hxxp://185.222.202.55
ORGOrganisations such as companies, CERTs, or research groups.Microsoft Threat Intelligence
SERVICEOnline or cloud services referenced in attacks.Google Ads
SECTORIndustry sectors or verticals targeted.critical infrastructure
FILEPATHFile system paths observed in malware samples.C:\Windows\System32\svchost.exe
DOMAINFully qualified domains or subdomains.malicious-domain[.]com
PLATFORMOperating systems or computing platforms.Windows Server
THREAT-ACTORNamed adversary groups or aliases.LockBit
PRODUCTCommercial or open-source software products.VMware ESXi
MALWAREMalware families, strains, or toolkits.TrickBot
LOCCountries, cities, or regions.United States
CVECVE identifiers for vulnerabilities.CVE-2023-23397
TOOLLegitimate or dual-use tools leveraged in incidents.Cobalt Strike
IPV4IPv4 addresses.185.222.202.55
MITRE-TACTICMITRE ATT&CK tactic categories.Credential Access
MD5MD5 cryptographic hashes.d41d8cd98f00b204e9800998ecf8427e
CAMPAIGNNamed operations or campaigns.Operation Cronos
SHA1SHA-1 hashes.da39a3ee5e6b4b0d3255bfef95601890afd80709
SHA256SHA-256 hashes.9e107d9d372bb6826bd81d3542a419d6...
EMAILEmail addresses.alerts@example.com
IPV6IPv6 addresses.2001:0db8:85a3:0000:0000:8a2e:0370:7334
REGISTRY-KEYSWindows registry keys or paths.HKLM\Software\Microsoft\Windows\CurrentVersion\Run

Training Procedure

  • Base model: `answerdotai/ModernBERT-large`.
  • Hardware: single Nvidia L40S instance (8 vCPU / 62 GB RAM / 48 GB VRAM).
  • Optimisation setup: mixed precision fp16, optimiser adamw_torch, cosine learning-rate scheduler, gradient accumulation 1.
  • Key hyperparameters: learning rate 5e-5, batch size 128, epochs 5, maximum sequence length 128.
ParameterValue
Mixed precisionfp16
Batch size128
Learning rate5e-5
Optimiseradamw_torch
Schedulercosine
Epochs5
Gradient accumulation1
Max sequence length128

Evaluation

AutoTrain reports the following micro-averaged metrics on its validation split (seqeval entity scoring):

MetricScore
Precision0.8468
Recall0.8484
F10.8476
Accuracy0.9589

An independent re-evaluation against a consolidated CTI set (same taxonomy as this model) produced the label-level accuracy breakdown below. These scores are macro-averaged across labels and therefore are not numerically comparable to the micro metrics above, but they provide insight into class balance and span quality.

LabelUsedAccuracy
CAMPAIGN1,8170.7980
CVE28,2930.9995
DOMAIN12,1820.8878
EMAIL7310.8495
FILEPATH13,8890.7957
IPV41,1640.9631
IPV65630.7425
LOC7,9150.9557
MALWARE10,4050.9087
MD53890.9100
MITRE-TACTIC2,1810.7093
ORG36,3240.9301
PLATFORM8,0360.8977
PRODUCT18,7200.8432
REGISTRY-KEYS1,5890.8490
SECTOR6,4530.8309
SERVICE8,5330.8179
SHA12220.9189
SHA2562,1460.9874
THREAT-ACTOR9,5320.9418
TOOL4,8740.7895
URL7,4700.9801
  • Macro accuracy: 0.8776

Because micro vs macro averaging and dataset composition differ, expect numerical gaps between the two evaluations even though both describe the same checkpoint.

These metrics were computed with the seqeval micro-average at the entity level.

External Benchmarks

The following tables report detailed results on a shared CTI validation set. Do not compare the per-label values across models directly: each checkpoint uses a different taxonomy or remapping strategy, so accuracy percentages can be misleading when labels are aligned or collapsed differently. Use the per-model tables to understand performance within a single schema, and interpret macro-accuracy scores with caution.

CyberPeace-Institute/SecureBERT-NER

LabelUsedAccuracy
ACT3,9450.1706
APT9,5180.5331
DOM10,6940.0196
EMAIL7310.0000
FILE31,8640.0747
IP1,2510.0088
LOC7,8950.8711
MAL10,3410.6076
MD53540.8672
O16,2750.4700
OS7,9740.6598
SECTEAM36,0830.3509
SHA11910.0209
SHA21,6470.9709
TOOL4,8160.4043
URL6,9970.0795
VULID27,5860.3849
  • Macro accuracy: 0.3820

PranavaKailash/CyNER-2.0-DeBERTa-v3-base

LabelUsedAccuracy
Indicator35,9360.7878
Location7,8950.0113
Malware12,1250.7800
O2,8960.7652
Organization42,5370.6556
System35,0630.7259
TOOL4,8200.0000
Threat Group9,5220.0000
Vulnerability27,6730.1876
  • Macro accuracy: 0.4348

cisco-ai/SecureBERT2.0-NER

LabelUsedAccuracy
Indicator35,7890.8854
Malware16,9260.6204
O10,7860.6813
Organization51,9930.5579
System34,9550.6600
Vulnerability27,5250.2552
  • Macro accuracy: 0.6100

Responsible Use

  • Confirm entity detections before acting on indicators (e.g., automated blocking).
  • Combine with enrichment and scoring systems to filter false positives.
  • Monitor for drift if applying to new domains (e.g., non-English sources, informal channels).
  • Respect licensing and confidentiality of any proprietary CTI sources used for inference.

Support & Connect

If you use SecureModernBERT-NER in a project, feel free to share it in the Discussions/Issues — I love seeing real-world use cases.

Citation

If you find this model useful, please cite the repository and the base model:

@software{securemodernbert_ner_2025,
  author = {Juan Manuel Cristóbal Moreno},
  title = {SecureModernBERT-NER: Cyber Threat Intelligence Named Entity Recogniser},
  year = {2025},
  publisher = {Hugging Face},
  url = {https://huggingface.co/attack-vector/SecureModernBERT-NER}
}

Contact

Questions or feedback? Open an issue on the Hugging Face model repository or reach out at `@juanmcristobal`.