Content moderation systems must analyze both visual and textual signals to detect harmful or unsafe material. Traditional approaches often struggle with ambiguous multimodal content such as memes, where the harmful intent emerges only through the interaction between image and text.
This project introduces CAIF-CIM, a lightweight CLIP-based multimodal framework designed for efficient and reliable harmful meme detection. The architecture combines novel cross-modal fusion modules with uncertainty-aware inference to improve both detection performance and deployment reliability.
The framework incorporates:
- Multi-Scale Channel Attention (MSCA)
- Context-Aware Intent Fusion (CAIF)
- Dual Cross-Attention Refinement (DCA)
- Confidence-Informed Modulation (CIM)
- Entropy-aware Human-in-the-Loop (HITL)
- Explainable AI using LIME
The model jointly encodes images and text using pretrained CLIP ViT-B/32 encoders, providing aligned visual and textual representations for multimodal reasoning.
Multi-scale convolutional attention captures both local and global contextual information using parallel convolution kernels before applying channel-wise attention to refine feature representations.
A learned context gate dynamically controls how textual information influences visual representations, enabling richer cross-modal feature interaction while preserving important visual cues.
Two sequential cross-attention stages recover visual details suppressed during fusion and further refine multimodal representations using contextual information from both modalities.
An auxiliary coarse prediction is used to modulate fused features before final classification, allowing the network to focus on more informative representations for difficult examples.
Prediction uncertainty is estimated using entropy after temperature scaling. Low-confidence predictions are automatically referred to human moderators, improving moderation reliability.
LIME-based explanations provide visual and textual attribution maps, making moderation decisions more transparent and interpretable.
The primary benchmark used for training and evaluation, consisting of image-text meme pairs where harmful intent arises from multimodal interaction.
The proposed architecture was additionally evaluated on a multi-class hate speech classification task to demonstrate its generalization capability.
| Metric | Score |
|---|---|
| Accuracy | 71.28% |
| AUROC | 0.7813 |
| Precision | 0.5977 |
| Recall | 0.7045 |
| F1 Score | 0.6467 |
The proposed architecture achieves strong performance while adding only ~0.37M additional parameters over the CLIP backbone, maintaining nearly identical inference latency.
- Python
- PyTorch
- OpenCLIP
- Vision Transformers
- Multi-Head Attention
- LIME
- NumPy
- Pandas
- OpenCV
- Scikit-learn
- Social Media Content Moderation
- Child Safety Monitoring
- Multimodal Harmful Content Detection
- AI-Assisted Moderation Systems
- Explainable AI
- Trustworthy AI Deployment
- Larger and more diverse multimodal datasets
- Retrieval-augmented multimodal reasoning
- Active learning with human feedback
- Real-time deployment optimization
- Improved uncertainty estimation
- Extension to video-based harmful content detection