YuYu1015-IntensityGMM-TW-45k-v1

🌐 Language / 語言 — English · 繁體中文

A machine-learning ground-motion model (GMM) for Taiwan. From an earthquake's magnitude, depth, and epicenter it predicts PGA and PGV at any target location, from which the CWA seismic intensity is obtained. Shipped as a single self-contained ONNX file — runs anywhere onnxruntime runs.

Overview

  • Task: predict PGA (gal) & PGV (cm/s) → CWA intensity level at a target site.
  • Inputs: earthquake magnitude (ML), depth, epicenter lat/lon, target lat/lon.
  • Output: PGA, PGV; intensity level via a table lookup (below).
  • Physics-anchored: extrapolates safely for great earthquakes (M > 7).

Key Specifications

  • Input: features, float32[N, 10] (feature order below)
  • Output: PGA (gal) and PGV (cm/s), each float32[N, 1]
  • Intensity scale: CWA 10-level(0,1,2,3,4,5弱,5強,6弱,6強,7)
  • Format: ONNX · ~14 MB · CPU inference ~0.1 ms/site
  • Runtime: onnxruntime (Python / C++ / C# / Java / JS-WASM / Rust …)

Input features (order matters)

# feature how to compute
0 M magnitude (ML)
1 depth focal depth (km)
2 dist epicentral distance (km) = haversine(epicenter, target)
3 lnR ln( max( sqrt(dist² + depth²), 3 ) )
4,5 ev_lat, ev_lon epicenter lat/lon
6,7 t_lat, t_lon target lat/lon
8,9 sinAz, cosAz sin/cos of azimuth (epicenter → target)

Usage

import math, numpy as np, onnxruntime as ort
from huggingface_hub import hf_hub_download

path = hf_hub_download("YuYu1015/YuYu1015-IntensityGMM-TW-45k-v1", "twn-intensity-gmm.onnx")
sess = ort.InferenceSession(path)

PGA_B = [0.8, 2.5, 8, 25, 80, 140, 250, 440, 800]   # gal
PGV_B = [0.2, 0.7, 1.9, 5.7, 15, 30, 50, 80, 140]   # cm/s
LEVELS = ["0", "1", "2", "3", "4", "5弱", "5強", "6弱", "6強", "7"]

def _features(M, depth, ev_lat, ev_lon, t_lat, t_lon):
    Re = 6371.0
    p1, p2, dl = math.radians(ev_lat), math.radians(t_lat), math.radians(t_lon - ev_lon)
    a = math.sin((p2 - p1) / 2) ** 2 + math.cos(p1) * math.cos(p2) * math.sin(dl / 2) ** 2
    dist = 2 * Re * math.asin(math.sqrt(a))
    lnR = math.log(max(math.hypot(dist, depth), 3.0))
    az = math.atan2(math.sin(dl) * math.cos(p2),
                    math.cos(p1) * math.sin(p2) - math.sin(p1) * math.cos(p2) * math.cos(dl))
    return [M, depth, dist, lnR, ev_lat, ev_lon, t_lat, t_lon, math.sin(az), math.cos(az)]

def _classify(v, bounds):
    return sum(1 for x in bounds if v >= x)

def predict(M, depth, ev_lat, ev_lon, target_lat, target_lon):
    x = np.array([_features(M, depth, ev_lat, ev_lon, target_lat, target_lon)], dtype=np.float32)
    pga, pgv = sess.run(None, {"features": x})
    pga, pgv = float(pga[0][0]), float(pgv[0][0])
    level = max(_classify(pga, PGA_B), _classify(pgv, PGV_B))
    return {"pga": round(pga, 2), "pgv": round(pgv, 3), "level": level, "name": LEVELS[level]}

# 2024/04/03 Hualien M7.2 (epicenter 23.77, 121.67, depth 30 km)
print(predict(7.2, 30, 23.77, 121.67, 25.03, 121.56))   # Taipei
# {'pga': 72.4, 'pgv': 5.994, 'level': 4, 'name': '4'}
print(predict(7.2, 30, 23.77, 121.67, 23.87, 121.51))   # Shoufeng
# {'pga': 243.89, 'pgv': 31.902, 'level': 6, 'name': '5強'}

Intensity thresholds (CWA)

level = max( classify(PGA, PGA_bounds), classify(PGV, PGV_bounds) )

Level 0 1 2 3 4 5弱 5強 6弱 6強 7
PGA (gal) <0.8 0.8 2.5 8 25 80 140 250 440 ≥800
PGV (cm/s) <0.2 0.2 0.7 1.9 5.7 15 30 50 80 ≥140

Performance

Evaluated on unseen 2024–2025 earthquakes (trained only on 2020–2023; the test set includes the 2024/04/03 Hualien M7.2 sequence):

Metric PGA PGV
Systematic bias ×0.99 (near-unbiased) ×0.99
Typical error (MAE) ×1.46 ×1.46
95th percentile ×2.7 ×2.7

Intensity level: exact ≈ 74 %, within ±1 level ≈ 98 %, false high-intensity alarms ≈ 0 %. Tuned to slightly over-predict rather than under-predict in the low/mid range.

Limitations

  • Point-source model; near-field (< 20 km)** and **great earthquakes (M > 7.1, beyond the training range) carry larger uncertainty. Distance is the dominant error driver.
  • Uses catalog magnitude/location — it does not read real-time waveforms, so it cannot capture event-specific rupture directivity.
  • Magnitude is ML; distance handling assumes epicentral distance + depth.
  • Not a certified alerting product; validate before operational use.

Data & Provenance

Trained on Central Weather Administration (CWA, Taiwan) strong-motion observations (2020–2025). Intensity thresholds follow the CWA 2020 10-level scale.

Licensing

Apache License 2.0 — permits commercial use, modification, and distribution provided copyright notices remain intact.

Author

ExpTech · YuYu1015


中文說明

🌐 Language / 語言 — English · 繁體中文

台灣地動模型(GMM)。由地震的規模、深度、震央位置,預估任一地點的 PGA、PGV,進而換算 CWA 震度。以單一 ONNX 檔發布,凡能跑 onnxruntime 的平台皆可推論。

概觀

  • 用途:預估某地點的 PGA(gal)與 PGV(cm/s)→ CWA 震度階。
  • 輸入:地震規模(ML)、深度、震央經緯度、目標經緯度。
  • 輸出PGAPGV;震度階由分級表查得(見下)。
  • 物理錨定:巨震(M > 7)仍能安全外插。

主要規格

  • 輸入featuresfloat32[N, 10](特徵順序見下表)
  • 輸出PGA(gal)、PGV(cm/s),各 float32[N, 1]
  • 震度分級:CWA 十級制
  • 格式:ONNX · 約 14 MB · CPU 推論約 0.1 ms/點
  • 執行環境onnxruntime(Python / C++ / C# / Java / JS-WASM / Rust …)

輸入特徵(順序不可變)

# 特徵 計算方式
0 M 規模(ML)
1 depth 震源深度(km)
2 dist 震央距(km)= haversine(震央, 目標)
3 lnR ln( max( sqrt(dist² + depth²), 3 ) )
4,5 ev_lat, ev_lon 震央緯經度
6,7 t_lat, t_lon 目標緯經度
8,9 sinAz, cosAz 震央→目標方位角的 sin/cos

使用範例

程式碼與上方英文「Usage」區塊相同(Python,語言無關):算出 10 維特徵 → 跑 ONNX → 取 PGA/PGV 兩張表分級的較大者。範例輸出:

台北 → {'pga': 72.4,  'pgv': 5.994,  'level': 4, 'name': '4'}
壽豐 → {'pga': 243.89, 'pgv': 31.902, 'level': 6, 'name': '5強'}

震度分級門檻(CWA)

level = max( 分級(PGA, PGA門檻), 分級(PGV, PGV門檻) )

震度 0 1 2 3 4 5弱 5強 6弱 6強 7
PGA (gal) <0.8 0.8 2.5 8 25 80 140 250 440 ≥800
PGV (cm/s) <0.2 0.2 0.7 1.9 5.7 15 30 50 80 ≥140

效能

2024–2025 未見地震評估(僅用 2020–2023 訓練;測試集含 2024/04/03 花蓮 M7.2 整串):

指標 PGA PGV
系統偏差 ×0.99(近乎無偏) ×0.99
典型誤差(MAE) ×1.46 ×1.46
第 95 百分位 ×2.7 ×2.7

震度階:精確 ≈ 74 %、±1 級 ≈ 98 %、高震度誤報 ≈ 0 %。 低/中震度區間刻意偏高估、避免低估

限制

  • 點震源模型;近場(< 20 km)**與**巨震(M > 7.1,超出訓練範圍)不確定性較大,距離是誤差主因。
  • 使用目錄規模/位置,不讀即時波形,無法捕捉個別事件的破裂指向性。
  • 規模為 ML;距離採震央距 + 深度。
  • 非認證預警產品;正式使用前請自行驗證。

資料來源

以中央氣象署(CWA)強震觀測資料(2020–2025)訓練;震度門檻依 CWA 2020 十級制。

授權

Apache License 2.0 —— 允許商用、修改與再散布,惟需保留著作權聲明。

作者

ExpTech · YuYu1015

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support