🚀 大語言模型Whisper Large V3 Turbo:針對空管領域微調
本模型是OpenAI的 Whisper Large V3 Turbo 的微調版本,專門針對空中交通管制(ATC)通信轉錄進行了優化。模型在 ATCOSIM 數據集 上進行了微調,該數據集包含來自實際運行環境的真實 ATC 通信。
📦 模型信息
屬性 |
詳情 |
模型類型 |
whisper-large-v3-turbo-atcosim-finetune |
訓練數據 |
jlvdoorn/atco2-asr-atcosim |
評估指標 |
Word Error Rate (WER) |
庫名稱 |
transformers |
🚀 快速開始
本模型專為以下用途而設計:
- 轉錄 ATC 無線電通信
- 支持航空安全研究
- 分析 ATC 通信的擁塞模式
- 為空域管理提供數據驅動的決策支持
✨ 主要特性
與基礎 Whisper 模型相比,該模型在航空通信轉錄準確性方面有顯著提升,尤其在以下方面表現出色:
- ATC 術語識別
- 呼號轉錄準確性
- 處理無線電傳輸噪聲
- 識別標準化術語
🔧 技術細節
訓練方法
模型採用部分凍結的方法進行微調,以平衡效率和適應性:
- 凍結前 24 個編碼器層
- 凍結所有卷積層和位置嵌入
- 微調後續編碼器層和解碼器
訓練超參數
- 學習率:1e-5
- 訓練步數:5000
- 熱身步數:500
- 啟用梯度檢查點
- FP16 精度
- 每設備批量大小:16
- 評估指標:字錯誤率(WER)
📈 性能表現
訓練指標
在 5000 步(10 個 epoch)的訓練過程中,模型的訓練進度如下:
步數 |
訓練損失 |
驗證損失 |
字錯誤率(WER) |
1000 |
0.090100 |
0.081074 |
5.81697 |
2000 |
0.021100 |
0.080030 |
4.00939 |
3000 |
0.010000 |
0.080892 |
5.67438 |
4000 |
0.002500 |
0.080460 |
3.88357 |
5000 |
0.001400 |
0.080753 |
3.73678 |
最終模型的字錯誤率(WER)為 3.73678%,在訓練過程中表現出顯著的改進,證明了其在 ATC 通信方面的強大性能。
💻 使用示例
基礎用法
import torch
from transformers import pipeline
device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
transcriber = pipeline(
"automatic-speech-recognition",
model="tclin/whisper-large-v3-turbo-atcosim-finetune",
chunk_length_s=30,
max_new_tokens=128,
torch_dtype=torch_dtype,
device=device
)
result = transcriber("path_to_atc_audio.wav")
print(f"轉錄結果: {result['text']}")
高級用法
import torch
import torchaudio
from transformers import WhisperProcessor, WhisperForConditionalGeneration
audio_path = "path_to_atc_audio.wav"
waveform, sample_rate = torchaudio.load(audio_path)
if sample_rate != 16000:
resampler = torchaudio.transforms.Resample(orig_freq=sample_rate, new_freq=16000)
waveform = resampler(waveform)
if waveform.shape[0] > 1:
waveform = waveform.mean(dim=0, keepdim=True)
waveform_np = waveform.squeeze().cpu().numpy()
device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
model = WhisperForConditionalGeneration.from_pretrained("tclin/whisper-large-v3-turbo-atcosim-finetune")
model = model.to(device=device, dtype=torch_dtype)
processor = WhisperProcessor.from_pretrained("tclin/whisper-large-v3-turbo-atcosim-finetune")
input_features = processor(waveform_np, sampling_rate=16000, return_tensors="pt").input_features
input_features = input_features.to(device=device, dtype=torch_dtype)
generated_ids = model.generate(input_features, max_new_tokens=128)
transcription = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(f"轉錄結果: {transcription}")
from transformers import pipeline
pipe = pipeline(
"automatic-speech-recognition",
model=model,
tokenizer=processor.tokenizer,
feature_extractor=processor.feature_extractor,
max_new_tokens=128,
chunk_length_s=30,
torch_dtype=torch_dtype,
device=device
)
result = pipe(waveform_np)
print(f"轉錄結果: {result['text']}")
⚠️ 重要提示
- 處理音頻前,務必將音頻重採樣至 16kHz。
- 使用 GPU 時,使用
model.to(device=device, dtype=torch_dtype)
顯式設置設備和數據類型。
- 處理較長音頻文件時,使用
chunk_length_s
參數。
- 模型在具有標準術語的清晰 ATC 通信上表現最佳。
🌐 更廣泛的應用
該模型是 ATC 通信語音到分析管道的一個組成部分,該管道包括:
- 音頻到文本轉錄(本模型)
- 使用上下文知識進行特定領域的文本重新格式化
- 基於轉錄通信的擁塞分析
📄 許可證
本模型採用 MIT 許可證。
📚 引用
如果您在研究中使用了此模型,請引用:
@misc{ta-chun_lin_2025,
author = { Ta-Chun Lin },
title = { whisper-large-v3-turbo-atcosim-finetune (Revision 4b2d400) },
year = 2025,
url = { https://huggingface.co/tclin/whisper-large-v3-turbo-atcosim-finetune },
doi = { 10.57967/hf/5272 },
publisher = { Hugging Face }
}
🙏 致謝
- 感謝 OpenAI 提供基礎 Whisper 模型。
- 感謝 ATCOSIM 數據集提供高質量的 ATC 通信數據。
- 感謝開源社區提供的工具和框架,使本次微調成為可能。