VoiceSHIELD-Small: Real-Time Malicious Speech Detection and Transcription
Organizations: Emvo
Abstract
Voice interfaces are quickly becoming a common way for people to interact with AI systems. This also brings new security risks, such as prompt injection, social engineering, and harmful voice commands. Traditional security methods rely on converting speech to text and then filtering that text, which introduces delays and can ignore important audio cues. This paper introduces VoiceSHIELD-Small, a lightweight model that works in real time. It can transcribe speech and detect whether it is safe or harmful, all in one step. Built on OpenAI's Whisper-small encoder, VoiceSHIELD adds a mean-pooling layer and a simple classification head. It takes just 90-120 milliseconds to classify audio on mid-tier GPUs, while transcription happens at the same time. Tested on a balanced set of 947 audio clips, the model achieved 99.16 percent accuracy and an F1 score of 0.9865. At the default setting, it missed 2.33 percent of harmful inputs. Cross-validation showed consistent performance (F1 standard deviation = 0.0026). The paper also covers the model's design, training data, performance trade-offs, and responsible use guidelines. VoiceSHIELD is released under the MIT license to encourage further research and adoption in voice AI security.
Figures & tables
| Component | Parameters | Trainable? |
|---|---|---|
| Whisper Encoder | 74M | Frozen |
| Whisper Encoder | 14M | Frozen |
| Mean Pool + MLP | 0.13M | Trainable |
| Total | 88.6M | |
| Split | Samples | Safe | Malicious |
|---|---|---|---|
| Train | 4,416 | 3,016 | 1,400 |
| Validation | 947 | 647 | 300 |
| Test | 947 | 647 | 300 |
| Total | 6,310 | 4,310 | 2,000 |
| Hyperparameter | Value |
|---|---|
| Optimizer | AdamW ( , ) |
| Learning rate | 3e-5 (cosine decay to 0) |
| Batch size (effective) | 32 (4 per GPU 8 grad accum) |
| Max steps | 3,000 |
| Warmup steps | 200 |
| Weight decay | 0.01 |
| Metric | Mean | Std | Min | Max |
|---|---|---|---|---|
| F1 | 0.9879 | 0.0026 | 0.9838 | 0.9912 |
| Precision | 0.9906 | 0.0034 | 0.9854 | 0.9940 |
| Recall | 0.9853 | 0.0062 | 0.9794 | 0.9941 |
| ROC-AUC | 0.9989 | 0.0009 | 0.9976 | 0.9998 |
| Predicted Safe | Predicted Malicious | |
|---|---|---|
| Actual Safe | 646 | 1 |
| Actual Malicious | 7 | 293 |
| Metric | Score | Interpretation |
|---|---|---|
| Accuracy | 99.16% | Overall correct classifications |
| F1 Score | 0.9865 | Harmonic mean of precision and recall |
| Precision | 0.9966 | When model says "malicious", it is correct 99.66% of the time |
| Recall (Sensitivity) | 0.9767 | Model catches 97.67% of actual malicious clips |
| ROC-AUC | 0.9948 | Excellent separability between safe and malicious clips |
| False Negative Rate | 2.33% | Proportion of malicious clips missed |
| Hardware | Classification Latency | Full Pipeline (including transcript) |
|---|---|---|
| NVIDIA RTX 4090 | 45–60 ms | 180–220 ms |
| NVIDIA RTX A4000 (mid-tier) | 90–120 ms | 280–350 ms |
| Apple M2 Pro (CPU) | 250–300 ms | 600–700 ms |
| F1 | Precision | Recall | FNR | FPR | |
|---|---|---|---|---|---|
| 0.10 | 0.9865 | 0.9886 | 0.9845 | 1.55% | 0.45% |
| 0.20 | 0.9882 | 0.9966 | 0.9800 | 2.00% | 0.15% |
| 0.35 | 0.9882 | 0.9966 | 0.9800 | 2.00% | 0.15% |
| 0.50 | 0.9865 | 0.9966 | 0.9767 | 2.33% | 0.15% |
| 0.70 | 0.9714 | 1.0000 | 0.9444 | 5.56% | 0.00% |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
LLM Security
Large language model (LLM) security studies attacks, privacy risks, and defenses across model training, inference, and deployment.
See all 322 papers