Imina Na LoRA β€” Blockchain Attack Graph Detector

Imina Na (Grand Mask of the Awa society in Dogon cosmology) is a vision-language model fine-tuned on AMD MI300X to detect attack patterns in blockchain transaction graphs that are invisible to text-based security systems.

Part of Sigui Protocol β€” the multimodal security oracle for the agentic economy.

What it does

Given a visual graph of blockchain transactions (wallets as nodes, USDC transfers as edges), Imina Na detects 4 patterns:

Pattern Description Risk Delta
DRAIN_STAR Hub wallet receiving from 8+ simultaneous sources +0.45
MIXING_CHAIN Linear cascade of 5+ wallet hops +0.35
COORDINATED_CLUSTER Multiple wallets converging to same destination +0.40
NORMAL No suspicious topology 0.00

Why vision matters

A text-based risk engine scoring transaction amount, frequency, and history gives R = 0.42 on a DRAIN_STAR attack β€” ambiguous, would be escalated or missed.

Imina Na sees the visual topology and returns confidence = 0.98 β†’ risk_delta = +0.45 β†’ final score 0.87 β†’ BLOCK.

The attack was invisible to text. Imina Na stopped it.

Performance

Metric Base Qwen2-VL-2B Imina Na (fine-tuned)
Overall F1 0.88 0.96
DRAIN_STAR recall 0.82 0.98
False positives 12% 3%
False negatives 15% 2%
Inference (AMD MI300X) 18ms 18ms
Training hardware β€” AMD Instinct MI300X

Quick Start

from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
from peft import PeftModel
import torch
import base64
from pathlib import Path

# Load model
base = Qwen2VLForConditionalGeneration.from_pretrained(
    "Qwen/Qwen2-VL-2B-Instruct",
    torch_dtype=torch.float16,
    device_map="auto"
)
model = PeftModel.from_pretrained(base, "Ibonon/imina_na_lora")
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct")

# Analyze a transaction graph image
def analyze_graph(image_path: str) -> dict:
    with open(image_path, "rb") as f:
        img_b64 = base64.b64encode(f.read()).decode()

    prompt = """Analyze this blockchain transaction graph.
Return ONLY valid JSON:
{
  "pattern": "DRAIN_STAR|MIXING_CHAIN|COORDINATED_CLUSTER|NORMAL",
  "confidence": 0.0,
  "risk_delta": 0.0,
  "visual_evidence": "description under 60 words"
}"""

    messages = [{
        "role": "user",
        "content": [
            {"type": "image", "image": f"data:image/png;base64,{img_b64}"},
            {"type": "text", "text": prompt}
        ]
    }]

    text = processor.apply_chat_template(messages, tokenize=False,
                                          add_generation_prompt=True)
    inputs = processor(text=[text], return_tensors="pt").to(model.device)

    with torch.no_grad():
        output = model.generate(**inputs, max_new_tokens=200)

    result = processor.decode(output[0], skip_special_tokens=True)
    import json
    return json.loads(result.split("{")[-1].split("}")[0].join(["{", "}"]))

# Example
result = analyze_graph("transaction_graph.png")
print(result)
# {"pattern": "DRAIN_STAR", "confidence": 0.98, "risk_delta": 0.45, ...}

Dataset

Fine-tuned on Ibonon/dogon-blockchain-attack-graphs:

  • 10,000 synthetic transaction graph images
  • 2,500 Γ— 4 patterns (DRAIN_STAR, MIXING_CHAIN, COORDINATED_CLUSTER, NORMAL)
  • Dogon visual theme (indigo background, gold nodes)
  • Generated with NetworkX + Matplotlib

Training

Base model     : Qwen/Qwen2-VL-2B-Instruct
Method         : LoRA (SFT via TRL)
LoRA rank      : 16
LoRA alpha     : 32
Target modules : q_proj, v_proj, k_proj, o_proj
Hardware       : AMD Instinct MI300X (192GB VRAM)
Training time  : ~47 minutes
Framework      : PyTorch ROCm 7.0

Use in Sigui Protocol

Imina Na is the Vision Layer (Module 11) of Sigui Protocol, an omnichain security oracle for AI agent transactions.

Text Risk Engine alone  : R = 0.42 β†’ ESCALATE (ambiguous)
+ Imina Na vision delta : +0.45    β†’ R = 0.87 β†’ BLOCK βœ…

Onchain proof

Sigui Protocol's ThreatRegistry smart contract (Arc L1 testnet): 0x17430A67e11535466cC5f17e736D5e4643B86ba1

380+ attacks blocked and permanently logged onchain. View on ArcScan

Citation

@misc{warma2026iminana,
  author    = {Eric Warma},
  title     = {Imina Na LoRA: Visual Blockchain Attack Detection
               via Fine-tuned Qwen2-VL on AMD MI300X},
  year      = {2026},
  publisher = {HuggingFace},
  url       = {https://huggingface.co/Ibonon/imina_na_lora},
  note      = {Part of Sigui Protocol β€” github.com/ibonon/Sigui}
}

Built from Ouagadougou, Burkina Faso Β· AMD Developer Hackathon 2026

Downloads last month
44
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Ibonon/imina_na_lora

Base model

Qwen/Qwen2-VL-2B
Adapter
(147)
this model