CoolFace
Modelpublic

MelihCan1115/cti-gemma-2-2b-seed123

sourceHugging Facemitupdated 4mo agoView on Hugging Face
0likes26downloads
Model Card

[EN]

Gemma-2-2b for Cyber Threat Intelligence (CTI) Classification

This model is a fine-tuned version of google/gemma-2-2b-it on the mrmoor/cyber-threat-intelligence dataset. It was trained using 4-bit QLoRA to classify cybersecurity text into 17 different STIX 2.1 and NER entity categories. This model was developed as part of the Büyük Dil Modelleri (BDM) course final project.

Model Performance

  • —Accuracy: 70.12% ± 0.44%
  • —Macro-F1: 47.98% ± 6.37%
  • —Zero-Shot Baseline (before fine-tuning): 35.5%

Label Classes (17 Categories)

STIX 2.1 Categories: attack-pattern, campaign, identity, location, malware, threat-actor, tools, vulnerability NER Entities: DOMAIN, FILEPATH, IPV4, O, SHA1, SHA2, SOFTWARE, TIME, URL

How to Use

Because this is a LoRA adapter, you must load it using the PeftModel architecture:

python
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from peft import PeftModel

1. Load the base model

basemodelid = "google/gemma-2-2b-it" basemodel = AutoModelForSequenceClassification.frompretrained( basemodelid, numlabels=17, devicemap="auto" ) tokenizer = AutoTokenizer.frompretrained(basemodel_id)

2. Load this LoRA adapter

adapterid = "MelihCan1115/cti-gemma-2-2bseed123" # Kendi kullanıcı adınızı yazın model = PeftModel.frompretrained(basemodel, adapter_id)

3. Predict

text = "A new ransomware variant encrypts victim files." inputs = tokenizer(text, return_tensors="pt").to("cuda") outputs = model(**inputs) predictions = torch.argmax(outputs.logits, dim=-1) print(predictions)


[TR]

Siber Tehdit İstihbaratı (CTI) Sınıflandırması için Gemma-2-2b

Bu model, mrmoor/cyber-threat-intelligence veri seti üzerinde google/gemma-2-2b-it modelinin ince ayarlanmış bir versiyonudur. Siber güvenlik metinlerini 17 farklı STIX 2.1 ve NER varlık kategorisine sınıflandırmak üzere 4-bit QLoRA kullanılarak eğitilmiştir. Bu model, Büyük Dil Modelleri (LLM) dersinin final projesi kapsamında geliştirilmiştir.

Model Performansı

  • —Doğruluk: %70,12 ± %0,44
  • —Makro-F1: %47,98 ± %6,37
  • —Zero-Shot Referans Değeri (fine-tuning öncesi): %35,5

Etiket Sınıfları (17 Kategori)

STIX 2.1 Kategorileri: attack-pattern, campaign, identity, location, malware, threat-actor, tools, vulnerability NER Varlıkları: DOMAIN, FILEPATH, IPV4, O, SHA1, SHA2, SOFTWARE, TIME, URL

Nasıl Kullanılır

Bu bir LoRA adaptörü olduğu için, onu PeftModel mimarisini kullanarak yüklemelisiniz:

python
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from peft import PeftModel

1. Temel modeli yükleyin

basemodelid = “google/gemma-2-2b-it” basemodel = AutoModelForSequenceClassification.frompretrained( basemodelid, numlabels=17, devicemap="auto" ) tokenizer = AutoTokenizer.frompretrained (basemodel_id)

2. Bu LoRA adaptörünü yükleyin

adapterid = “MelihCan1115/cti-gemma-2-2bseed123” # Kendi kullanıcı adınızı girin model = PeftModel.frompretrained(basemodel, adapter_id)

3. Tahmin yapın

text = "Yeni bir fidye yazılımı türü, mağdurun dosyalarını şifreliyor