Downloads · 30 days
6
33% of all-time downloads
yasunotkt/damage-cause-encoder-v05
damage-cause-encoder-v05 is a text classification model from yasunotkt. Use it when you need a label for a piece of text. It is set up for peft. The card lists the license as apache-2.0.
Downloads · 30 days
6
33% of all-time downloads
All-time downloads
18
Public
Repo size
28.5 MB
Likes
0
Public
Click a slice to open those files.
.safetensors28.5 MB · 99%
From the Hugging Face model README
橋梁損傷原因分類のための日本語BERTベースのQLoRAモデル
このモデルは、橋梁の損傷記述から原因を10カテゴリに分類する深層学習モデルです。RC床版、コンクリート桁橋、床版橋の診断ロジックPDFから抽出した因果トリプル(Si → Ci)を活用し、4-bit量子化LoRA(QLoRA)で効率的にファインチューニングされています。
| 項目 | 詳細 |
|---|---|
| ベースモデル | cl-tohoku/bert-large-japanese-v2 |
| アーキテクチャ | BertForSequenceClassification + QLoRA adapters |
| 量子化 | 4-bit NF4 (QLoRA) + FP16 classifier |
| LoRA設定 | r=16, α=32, dropout=0.1 |
| 訓練可能パラメータ | 7.1M (2.07%) |
| タスク | 10クラステキスト分類 |
| 言語 | 日本語 |
| ライセンス | Apache 2.0 |
| データセット | Accuracy | F1 (weighted) | サンプル数 |
|---|---|---|---|
| Test Set (Golden) | 87.07% | 87.0% | 116 |
| Diverse Samples | 47.0% | - | 100 |
| Validation (Training) | 93.91% | 93.73% | 115 |
比較(v0.5実験結果):
→ QLoRAが最善: 同等のテスト精度で、未見パターンへの汎化が13%向上、GPU使用量72%削減
| ID | カテゴリ | 説明 | 対象橋梁タイプ |
|---|---|---|---|
| 0 | 塩害 | 塩化物イオンによる鉄筋腐食 | RC床版、コンクリート桁橋、床版橋 |
| 1 | 凍害 | 凍結融解の繰り返しによる劣化 | RC床版、床版橋 |
| 2 | 土砂化 | コンクリートの土砂化現象 | RC床版、床版橋 |
| 3 | 疲労 | 繰り返し荷重による疲労亀裂 | RC床版 |
| 4 | 鉄筋腐食 | 鉄筋の腐食による損傷 | RC床版 |
| 5 | ASR | アルカリシリカ反応 | 床版橋 |
| 6 | ボイド管浮き陥没 | ボイド管の浮き上がりや陥没 | 床版橋 |
| 7 | 滞水 | 水の滞留による劣化 | 床版橋 |
| 8 | 連結桁 | 連結桁特有の損傷 | コンクリート桁橋、床版橋 |
| 9 | その他 | 上記以外の損傷原因 | コンクリート桁橋 |
pip install transformers peft torch bitsandbytes sentence-transformers faiss-cpu
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from peft import PeftModel, PeftConfig
# モデルとトークナイザーのロード
model_id = "yasunotkt/damage-cause-encoder-v05"
config = PeftConfig.from_pretrained(model_id)
base_model = AutoModelForSequenceClassification.from_pretrained(
config.base_model_name_or_path,
num_labels=10,
device_map="auto"
)
model = PeftModel.from_pretrained(base_model, model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
# 推論
def predict_damage_cause(damage_description, context=""):
"""
損傷記述から原因を予測
Args:
damage_description: 損傷の記述(Si)
context: 関連する因果知識(Ci)。オプション。
Returns:
予測ラベルID、ラベル名、確率
"""
labels = ["塩害", "凍害", "土砂化", "疲労", "鉄筋腐食", "ASR",
"ボイド管浮き陥没", "滞水", "連結桁", "その他"]
# 入力テキストの作成
text = damage_description
if context:
text = f"{damage_description} {tokenizer.sep_token} {context}"
# トークナイズと推論
inputs = tokenizer(text, return_tensors="pt", max_length=512,
truncation=True, padding=True).to(model.device)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=1)
pred_id = torch.argmax(probs, dim=1).item()
confidence = probs[0][pred_id].item()
return pred_id, labels[pred_id], confidence
# 使用例
damage_text = "床版下面に遊離石灰が白く析出し、鉄筋位置に沿って縦方向のひびわれが確認される"
pred_id, cause, conf = predict_damage_cause(damage_text)
print(f"予測原因: {cause} (ID: {pred_id})")
print(f"確信度: {conf:.2%}")
完全な推論パイプライン(FAISS triple index + LLM filter + QLoRA)については、プロジェクトリポジトリをご覧ください: https://github.com/tk-yasuno/damage_cause_encoder
base_model: cl-tohoku/bert-large-japanese-v2
quantization: 4-bit NF4 + double quantization
lora_r: 16
lora_alpha: 32
lora_dropout: 0.1
target_modules: [query, key, value, dense]
learning_rate: 2e-4
batch_size: 4
gradient_accumulation_steps: 8
epochs: 20
max_length: 512
optimizer: AdamW
loss_function: Weighted CrossEntropy (inverse frequency)
1. PDFからOCR抽出(PaddleOCR + pypdfium2)
↓
2. 因果トリプル抽出(Qwen2.5 7B)
↓
3. FAISS dense retrieval(hotchpotch/static-embedding-japanese)
↓
4. LLM relevance filter(Qwen2.5 7B)
↓
5. QLoRA分類器(本モデル)
↓
6. 損傷原因(10クラス)
このモデルを研究で使用する場合は、以下を引用してください:
@software{damage_cause_encoder_v05,
title = {Damage Cause Encoder: Deep Learning for Bridge Damage Classification with QLoRA},
author = {Damage Cause Encoder Project Team},
year = {2026},
version = {0.5},
url = {https://github.com/tk-yasuno/damage_cause_encoder},
note = {QLoRA achieves 87.07\% test accuracy with 72\% GPU memory reduction}
}
開発者: Damage Cause Encoder Project Team
最終更新: 2026-07-25
バージョン: v0.5
連絡先: GitHub Issues
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]