Team Ai
Modelpublic

Davidavid4/bilstm-terrorism-forecasting-gtd

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes17downloads
Model Card

BiLSTM for Terrorism Event Forecasting

Bidirectional LSTM model for weekly terrorism event forecasting using 46 years of Global Terrorism Database (GTD) data.

Paper: Predicting the Unpredictable: Bidirectional LSTM Networks for Terrorism Event Forecasting

Model Performance

ModelRMSE ↓MAER²Improvement
BiLSTM (this model)6.383.820.556Baseline
LSTM+Attention9.195.370.264-30.6%
Linear Regression9.895.850.176-35.5%
SARIMA11.526.78-0.090-44.6%

Key Achievement: 37% improvement over best classical baseline (Linear Regression)

Model Architecture

  • —Type: Bidirectional LSTM (2 layers)
  • —Input Shape: (30 weeks, 13 features)
  • —Output: Single value (next week's attack count)
  • —Parameters: ~36,673
  • —Framework: TensorFlow 2.13.0

Architecture Details:

Input(30, 13) ↓ Bidirectional LSTM(64) + Dropout(0.2) ↓ Bidirectional LSTM(32) + Dropout(0.2) ↓ Dense(32, ReLU) + Dropout(0.2) ↓ Dense(1, Linear)

Training Data

  • —Dataset: Global Terrorism Database (START consortium)
  • —Time Period: 1970-2016 (46 years)
  • —Resolution: Weekly aggregation (2,400 weeks)
  • —Train/Val/Test: 70%/15%/15% (chronological split)

Features (13 total):

  1. 1.Lag Features (1): 52-week lag
  2. 2.Rolling Statistics (4): 4-week & 12-week mean/std
  3. 3.Temporal Encoding (4): Year, week, month, quarter
  4. 4.Casualty Features (3): Killed, wounded, total
  5. 5.Geographic (1): Region encoding

Usage

python
import tensorflow as tf
from huggingface_hub import hf_hub_download

# Download model
model_path = hf_hub_download(
    repo_id="Davidavid4/bilstm-terrorism-forecasting-gtd",
    filename="bidirectional_lstm_best.h5"
)

# Load model
model = tf.keras.models.load_model(model_path)

# Prepare input: shape (batch_size, 30, 13)
# - 30 weeks of historical data
# - 13 features per week

# Make predictions
predictions = model.predict(X_test)