Skip to content
/ Defndr Public

Machine learning components for the Defndr SMS spam filter app.

License

Notifications You must be signed in to change notification settings

j8ethr0/Defndr

Repository files navigation

Swift iOS Architecture Privacy Security Status

Defndr

Private, local SMS spam filtering — built by Dro1d Labs.

Defndr processes messages entirely on-device, providing high-accuracy SMS spam detection without sending any data off the device.


📱 App Store

Defndr is live on the iOS App Store.


📖 Repository Purpose

This repository provides reference implementations for educational purposes, demonstrating:

  • ✅ Deterministic SMS preprocessing
  • ✅ Hybrid spam scoring combining heuristics and ML
  • ✅ On-device monitoring of model performance
  • ✅ High-performance architecture for iOS 18+

Note: This repository does not include the proprietary filtering model, training pipeline, or production datasets.


🏗️ Architecture Overview

mermaid graph LR A[Raw SMS] --> B[MessagePreprocessingPipeline] B --> C[Feature Extraction] C --> D[HeuristicSignalScoring] C --> E[ML Model Vote] D --> F{Hybrid Decision} E --> F F --> G[Block/Allow] F --> H[MLModelHealthMonitor]


📦 Modules

Sources/MessagePreprocessingPipeline.swift

Tokenization, normalization, and deterministic preprocessing of SMS text. Handles:

  • Unicode normalization (NFKC)
  • Privacy-preserving fingerprinting (SHA256)
  • Language detection
  • Lightweight feature extraction

Sources/HeuristicSignalScoring.swift

Combines heuristics and ML scoring for spam classification. Features:

  • Configurable signal weights
  • Per-sender threshold overrides
  • Thread-safe configuration updates
  • JSON-driven config management

Sources/MLModelHealthMonitor.swift

Monitors model performance and drift entirely on-device:

  • Latency tracking (P95, mean)
  • Confidence distribution monitoring
  • Anomaly detection (low confidence, high latency)
  • Privacy-first telemetry (no external reporting)

🔒 Privacy & Security

  • 100% On-Device Processing — No data leaves the device
  • No Analytics — No tracking, no telemetry servers
  • Deterministic Hashing — Privacy-preserving message fingerprints
  • Open Architecture — Transparent design for security review

🚀 Usage Example

swift import Foundation

// Initialize pipeline let pipeline = MessagePreprocessingPipeline(mode: .standard) let scorer = HeuristicSignalScoring() let monitor = MLModelHealthMonitor()

// Process an incoming SMS let processed = await pipeline.process("URGENT! Click here to claim your prize: http://scam.com")

// Evaluate with heuristics let result = scorer.evaluate( shallowFeatures: processed.shallowFeatures, mlVote: 0.89, // ML model confidence sender: nil )

// Log model health await monitor.recordPrediction(latencyMs: 12.3, confidence: 0.89)

print("Spam score: (result.normalizedScore)") print("Decision: (result.normalizedScore >= 0.65 ? "BLOCK" : "ALLOW")")


📊 Performance

  • Latency: < 15ms per message (iPhone 14 Pro)
  • Memory: < 10MB footprint
  • Accuracy: 99.2% spam detection rate (internal benchmarks)
  • False Positives: < 0.1%

🤝 Comparison

See DEFNDRvsOTHERS.md for a detailed comparison with Truecaller, Hiya, RoboKiller, and other SMS filtering solutions.


⚖️ License & Restrictions

  • All code, models, and data are Dro1d Labs intellectual property
  • Educational and reference purposes only
  • No copying, redistribution, or commercial use without explicit written permission from Dro1d Labs

For licensing inquiries: legal@dro1d.org


📮 Contact


🛡️ Built with privacy in mind. Powered by on-device intelligence.

© 2026 Dro1d Labs. All rights reserved.

About

Machine learning components for the Defndr SMS spam filter app.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages