Appearance
Image Intelligence
GhostAI's image intelligence system detects sensitive content in uploaded images — from ID cards and credit cards to faces and bank checks — and automatically creates redacted versions to prevent PII exposure.
Content Detection
Sensitive Document Detection
GhostAI identifies the following document types in uploaded images:
| Content Type | Detection Method | Confidence | Action |
|---|---|---|---|
| ID Cards | Template matching (50 US states + federal) | 95% | Full blur + OCR redaction |
| Driver's Licenses | State-specific templates | 95% | Full blur + OCR redaction |
| Passports | International format matching | 90% | Full blur + OCR redaction |
| Credit Cards | Card number pattern detection | 92% | Full blur + OCR redaction |
| Bank Checks | Check layout recognition | 90% | Full blur + OCR redaction |
| Medical Records | Document format analysis | 88% | Full blur + OCR redaction |
| Badges/IDs | Corporate/government ID formats | 85% | Full blur + OCR redaction |
Biometric Detection
| Content Type | Method | Action |
|---|---|---|
| Faces | Facial detection (not recognition) | De-identification blur |
| Fingerprints | Pattern matching | Flagged for review |
Code & Data Detection
| Content Type | Method | Action |
|---|---|---|
| QR Codes | Decode and scan for PII | Flag embedded URLs/data |
| Barcodes | Decode and scan | Flag encoded PII |
| Screenshots | OCR + context analysis | PII text redaction |
Content Moderation
| Content Type | Method | Action |
|---|---|---|
| NSFW Content | Classification model | Flagged and blocked |
| Violence | Classification model | Flagged for review |
Steganography Detection
GhostAI detects hidden data embedded in images using statistical analysis:
| Method | What It Detects | Confidence |
|---|---|---|
| Chi-square test | Non-random LSB distribution indicating data embedding | High |
| LSB uniformity | Suspiciously uniform bit distribution in least significant bits | Medium |
| Combined analysis | Multi-signal correlation for higher accuracy | High |
Images flagged with steganographic content are marked in scan results for security review.
Polyglot File Detection (Planned)
Images that are simultaneously valid as other file types (e.g., a JPEG that is also a valid ZIP archive — known as a GIFAR attack) will be detected and flagged.
Adversarial Image Detection (Planned)
ML-based detection of images specifically crafted to fool OCR or content classification models, such as adversarial text that OCRs as prompt injection commands while appearing as noise to human viewers.
How Image Redaction Works
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ Image │───▶│ Content │───▶│ OCR │───▶│ Redacted │
│ Upload │ │ Classify │ │ Extract │ │ Image │
└──────────┘ └──────────┘ └──────────┘ └──────────┘
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Sensitive │ │ PII Word │ │ Region │
│ Content? │ │ Matching │ │ Blurring │
└──────────┘ └──────────┘ └──────────┘Redaction Process
- Classification: Image analyzed for sensitive document types
- OCR Extraction: Text extracted from the image via Tesseract
- PII Matching: Extracted words compared against detected PII entities
- Region Mapping: PII text locations mapped to image coordinates
- Redaction: Matching regions covered with colored redaction boxes
- Full Blur: If sensitive document type detected (ID, check, etc.), entire image blurred
Redaction Methods
| Scenario | Method |
|---|---|
| Text PII found | Targeted redaction boxes over PII text |
| Sensitive document type | Full Gaussian blur of entire image |
| Both | Full blur + targeted boxes for text |
| EXIF metadata | Stripped from all images |
EXIF Metadata Stripping
All uploaded images have metadata automatically inspected and optionally stripped:
| Metadata Field | Privacy Risk | Default Action |
|---|---|---|
| GPS coordinates | Location tracking | Strip |
| Camera model | Device fingerprinting | Strip |
| Timestamp | Activity tracking | Strip |
| Creator name | Identity exposure | Strip |
| Software | System fingerprinting | Preserve |
| Image dimensions | Low risk | Preserve |
OCR Capabilities
Supported Features
- Printed text: High accuracy for typed/printed content
- Handwritten text: Limited support for clear handwriting
- Multi-language: English, Spanish, French, German, and more
- Rotated text: Handles various orientations
- Low quality: Adaptive preprocessing for poor quality images
OCR Pipeline
- Image preprocessing (deskew, contrast enhancement)
- Text region detection
- Character recognition via Tesseract
- PII entity matching against detected text
- Bounding box extraction for redaction overlay
Viewing Redacted Images
In the Preview Modal
- Default view: Shows the redacted version with PII blurred/covered
- Loading indicator: Spinner while redacted image is generated
- Error handling: Graceful fallback if image can't be processed
- Toggle: Admins can switch to the original (unredacted) image
Redaction Badges
The preview modal shows visual indicators:
- PII Redacted badge: Green badge when PII has been redacted
- Sensitive Content badge: Red badge for IDs, checks, etc.
- PII Count: Number of PII entities detected
API Usage
Scan Image for PII
bash
curl -X POST http://localhost:8000/api/files/upload \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@bank_check.jpg" \
-F "scan=true"Response includes image detection results:
json
{
"file_id": "img_abc123",
"scan_results": {
"pii_count": 8,
"entities": [
{"type": "PERSON", "text": "John Smith"},
{"type": "US_BANK_NUMBER", "text": "123456789012"},
{"type": "ROUTING_NUMBER", "text": "021000021"}
],
"image_detections": [
{
"label": "bank_check",
"confidence": 0.92,
"category": "financial",
"is_sensitive": true
}
],
"has_sensitive_image_content": true
}
}Get Redacted Image
bash
# Returns the redacted version by default
curl http://localhost:8000/api/files/img_abc123 \
-H "Authorization: Bearer YOUR_TOKEN" \
-o redacted_check.jpgConfiguration
bash
# Image intelligence settings
IMAGE_DETECTION_ENABLED=true
OCR_ENABLED=true
OCR_LANGUAGES=eng,spa,fra
EXIF_STRIP_ENABLED=true
NSFW_DETECTION_ENABLED=true
FACE_DETECTION_ENABLED=trueBest Practices
- Enable all detectors: Each catches different sensitive content
- Review redacted images: Verify no PII is visible before sharing
- Strip EXIF by default: Prevent accidental location exposure
- Monitor bank check uploads: Common vector for financial PII
- Train users: Remind users not to photograph sensitive documents
Next Steps
- Document Preview — Visual preview system
- File Processing — Full file scanning
- PII Detection — Detection engine details