Obscurafy is an iOS app that helps protect your privacy by automatically detecting and managing sensitive content in your photo library. Using on-device machine learning, it scans for documents, IDs, cards, and other sensitive information, then gives you tools to review, redact, or delete flagged photos.
Obscurafy runs entirely on your device to maintain privacy. It uses:
- YOLO ML model for object detection (documents, IDs, credit cards, etc.)
- Apple Vision OCR for text detection and extraction
- Google Gemini AI (optional) for intelligent content analysis
- Background processing for efficient library scanning
- Automatically scans your entire photo library in the background
- Configurable confidence threshold (40-100%)
- Progress tracking with real-time statistics
- Low battery impact using iOS Background Tasks API
- Swipe left (green) to keep photos
- Swipe right (red) to queue for deletion
- Risk level indicator based on ML confidence
- Batch deletion to prevent accidental losses
- One-tap text detection and blurring
- Combines YOLO object detection + Vision OCR
- Preserves original photo metadata
- Creates new redacted version automatically
- Gemini AI explains why photos were flagged
- Risk level assessment (High/Medium/Low)
- Privacy score calculation
- Content categorization
- β All processing happens on-device
- β No photos leave your device (except optional Gemini API)
- β Requires explicit user consent for AI features
- β Can disable AI analysis entirely
VaultEye/
βββ BackgroundScan/
β βββ BackgroundScanManager.swift # Orchestrates background scanning
β βββ BGTasks.swift # Background task registration
β βββ ImageClassifier.swift # ML model wrapper
β βββ ScanScreen.swift # Scan control UI
β βββ ResultStore.swift # Persistent scan results
β
βββ Services/
β βββ YOLOService.swift # YOLO object detection
β βββ RedactionService.swift # Text blurring engine
β βββ GeminiService.swift # AI analysis (optional)
β βββ OCRService.swift # Vision text extraction
β βββ PhotoLibraryManager.swift # Photo access wrapper
β βββ StatisticsManager.swift # Usage analytics
β
βββ Views/
β βββ SwipeCardView.swift # Main review interface
β βββ DetailView.swift # Full-screen photo view
β βββ StatisticsView.swift # Stats dashboard
β
βββ Models/
β βββ DetectionResult.swift # Scan result model
β βββ DetectedRegion.swift # ML detection box
β βββ SensitiveAnalysis.swift # AI analysis result
β
βββ Utilities/
βββ AppColor.swift # Design system
βββ ImageGeometry.swift # Coordinate conversion
- Language: Swift 5.9+
- UI Framework: SwiftUI
- ML Framework: CoreML, Vision
- Minimum iOS: iOS 16.0+
- Architecture: MVVM with Combine
- Xcode 15.0+
- iOS 16.0+ device or simulator
- Apple Developer account (for device testing)
-
Clone the repository
git clone https://github.com/AlexanderMcGreevy/Obscurafy.git cd Obscurafy -
Configure Gemini API (Optional)
If you want AI analysis features:
a. Create
Secrets.xcconfigin project root:touch Secrets.xcconfig
b. Add your API key:
GEMINI_API_KEY = YOUR_GEMINI_API_KEY_HEREc. Get a free API key at Google AI Studio
-
Open in Xcode
open VaultEye.xcodeproj
-
Build and Run
- Select your target device
- Press
Cmd + Rto build and run
-
Grant Photo Library Access
- App will request "Full Access" to scan all photos
- Required for background scanning
-
Enable Notifications (Optional)
- Get alerts when background scans complete
- Recommended for better UX
-
Configure AI Analysis (Optional)
- Tap "Enable AI Analysis" in scan settings
- Review privacy disclosure
- Only enables if Gemini API key is configured
- Navigate to "Background Scan" tab
- Adjust confidence threshold (recommended: 70%)
- Tap "Start Scan"
- App will scan photos in background
- Notification appears when complete
- Go to "Review Photos" tab
- View detected photos one at a time
- Swipe left to keep (green indicator)
- Swipe right to queue for deletion (red indicator)
- Tap "Delete" button to permanently remove queued photos
- Open any flagged photo
- Tap "Redact" button (top right)
- App automatically:
- Detects all text using OCR
- Blurs YOLO-detected objects
- Saves new redacted version
- Queues original for deletion
- Review and confirm deletion
High Risk (Red) - 80-100% confidence
- Very likely sensitive content
- Strong detection by ML model
- Recommended for immediate review
Medium Risk (Orange) - 50-79% confidence
- Possibly sensitive content
- Moderate detection confidence
- Worth reviewing
Low Risk (Yellow) - 0-49% confidence
- Low probability of sensitive content
- May be false positive
- Quick review recommended
Primary Colors:
- Blue:
#4EA8FF- Interactive elements, buttons, accents - Gray:
#94A3B8- Text, borders, secondary elements
Semantic Tokens:
AppColor.primary- Main interactive colorAppColor.primaryBg- Light background (10% opacity)AppColor.cardFill- Card backgrounds (adaptive for light/dark mode)AppColor.border- Borders (35% opacity)
Special Colors (preserved for UX clarity):
- Green: "Keep" action
- Red: "Delete" action
- Orange: Medium risk warning
- Yellow: Low risk warning
Automatically adapts to system appearance:
- Light backgrounds:
#F8FAFC - Dark backgrounds:
#1E293B - Text contrast meets WCAG AA standards
β What stays on your device:
- All photos and images
- ML detection results
- Scan history and statistics
- Redacted images
- OCR-extracted text sent to Gemini API
- ML detection labels (e.g., "id_card")
- No images are ever sent to external servers
| Permission | Purpose | Required? |
|---|---|---|
| Photo Library (Full Access) | Scan and analyze all photos | Yes |
| Background App Refresh | Run scans while app is closed | Recommended |
| Notifications | Alert when scans complete | Optional |
- AI analysis is opt-in only
- Clear consent dialog before enabling
- Can disable AI at any time
- All ML processing happens on-device
-
Test with sample images
- Add test photos with IDs, documents, credit cards
- Run a scan with 70% threshold
- Verify correct detection
-
Test redaction
- Open flagged photo
- Tap "Redact"
- Check blurred areas cover sensitive content
-
Test batch deletion
- Queue multiple photos
- Verify count updates
- Confirm deletion removes only queued photos
# Simulate background task in simulator
e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"com.obscurafy.scan"]Adjust in Background Scan tab:
- 40-60%: More sensitive, may have false positives
- 70% (recommended): Balanced accuracy
- 80-100%: Only high-confidence detections
Located at: VaultEye/ML/yolov8n.mlmodelc
Detects:
- Documents
- ID cards
- Passports
- Credit cards
- Driver licenses
- Business cards
Edit GeminiService.swift to adjust:
- Model version (default:
gemini-1.5-flash) - Temperature (default: 0.7)
- Max tokens (default: 500)
Cause: No photos exceeded confidence threshold
Solution:
- Lower confidence threshold to 50-60%
- Check photo library has scannable content
- Review scan statistics for total photos scanned
Cause: Background refresh disabled or low battery
Solution:
- Enable Background App Refresh in Settings
- Keep device plugged in
- Ensure device not in Low Power Mode
Cause: No text detected in image
Solution:
- Ensure image has visible text
- Check image quality and resolution
- Try adjusting OCR confidence in code
Cause: Invalid API key or rate limit
Solution:
- Verify API key in
Secrets.xcconfig - Check API quota at Google AI Studio
- Review Gemini API console logs
- Speed: ~5-10 photos/second (iPhone 12+)
- Battery Impact: Low (runs during idle time)
- Storage: Minimal (results cached in UserDefaults)
- YOLO Detection: ~100-200ms per image
- Vision OCR: ~200-500ms per image
- Gemini Analysis: ~1-3 seconds (network dependent)
- Typical: 50-100 MB
- Peak (during scan): 150-200 MB
- Redaction: 200-300 MB (temporary)
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Swift API Design Guidelines
- Use SwiftLint for consistency
- Add comments for complex logic
- Write unit tests for new features
This project is licensed under the MIT License - see LICENSE file for details.
- Apple Vision Framework - Text detection and OCR
- YOLO (You Only Look Once) - Object detection model
- Google Gemini AI - Intelligent content analysis
- SwiftUI - Modern UI framework
- Face detection and blurring
- Handwriting recognition
- Custom ML model training
- iCloud sync for scan results
- Share extension for quick redaction
- Automated backup before deletion
- Advanced filtering and search
- Export redaction reports
- Background tasks may not run frequently on older devices
- Large photo libraries (>10,000) may take hours to scan
- Gemini API has usage limits on free tier
Made with β€οΈ to protect your privacy
Obscurafy - Keep your sensitive photos secure