AffectFusion DIU CSE · Phase-I Thesis
Phase-I Undergraduate Thesis · Dept. of CSE, Daffodil International University

AffectFusion: Explainable Emotion Recognition from Text & Emoji Semantics

Social media language rarely lives in literal words alone. Across English, native Bengali script, and Romanized Banglish, a single Unicode glyph routinely intensifies, softens, or completely inverts the emotion of a sentence. This showcase documents everything completed in Phase-I—multi-platform harvesting of 60,000 raw comments across YouTube, Reddit, Mastodon, and Lemmy, blind dual-annotator consensus gold verification across 5,000 paired rows (10,000 independent human judgments, κ = 0.7717, α = 0.7717), our openly published benchmark dataset, and controlled baseline evaluations—alongside remaining Next Phase work scheduled through February 2027.

✓ Benchmark Dataset PublishedOpen Access 30,000-row corpus & 5K gold audit live on Hugging Face & Zenodo (CC BY 4.0).
○ Thesis Paper In ProgressTarget: Feb 2027 Phase-I baselines finished; Cross-Attention model, XAI suite & paper submission remain.
57%
Overall FYDP Progress
8 of 14 Milestones
Phase-I: 100% Done · Next Phase: By Feb 2027
Stage 1✓ Done
Data, Blind-Swap 5K & Open Release
κ = 0.7717 · Zenodo & HF live
Stage 2✓ Done
3 Phase-I Baselines & Stats
63.10% Acc · p < 0.0001
Stage 4Feb 2027
XAI Suite, Demo & Thesis Paper
SHAP/LIME + final submission
Full Checklist ↓
I · Locked Corpus
30,000

Curated from 60,000 raw posts (55,399 cleaned) into hash-deduplicated 80/10/10 splits.

II · Blind-Swap Human IAA
κ = 0.7717

5,000 paired human rows (10,000 judgments · α = 0.7717 · 79.80% unanimous · 1,010 adjudicated).

III · Best Phase-I Baseline
63.10%

XLM-R Early Fusion Accuracy (0.6278 Macro-F1) vs. 54.47% Text-Only (+8.63 pts).

IV · Emoji Modality Lift
+12.42 pts

Macro-F1 surge on emoji posts (n = 1,974; paired t = 10.11, McNemar χ² = 96.53, p < 0.0001).

When a Single Glyph Inverts the Sentence

Conventional text classifiers treat emojis as noise to be stripped during tokenization. On real South Asian and global social feeds, discarding visual-semantic glyphs erases sarcasm cues, exaggerations, and cross-script emotional nuance—where 88.2% of Sarcasm and 84.1% of Sadness posts carry emojis.

Interactive Ablation Dissection · Toggle What the Model Sees
“When emojis are removed, XLM-RoBERTa's Sarcasm F1 collapses to 0.3153—statistically indistinguishable from a lightweight CNN-BiLSTM (p = 0.332). Re-introducing emoji semantics recovers +14.73 points on Sarcasm and +12.42 Macro-F1 across all 1,974 emoji-bearing test posts—yet static concatenation still triggers 192 emoji-hijacking regressions, directly motivating Next Phase Bidirectional Cross-Attention.” Phase-I Empirical Finding · 100% Consensus Gold test_3k (N = 3,000, p < 0.0001)
Canonical 9-Class Emotion Taxonomy (docs/label_map.json) ENG 36.9% · BN 35.3% · BNG 27.8%
00😊Joy
01😐Neutral
02😡Anger
03😢Sadness
04😮Surprise
05🙄Sarcasm
06😳Fear
07🤢Disgust
08⏳Anticipation

How We Scraped, Sanitized & Locked the 30,000-Row Corpus

We harvested 60,000 raw comments under strict language and modality quotas (ENG 24,000, BN 18,000, BNG 18,000; 42,000 [70%] emoji + 18,000 [30%] non-emoji), streamed cleaning in 5,000-row chunks to remove 4,601 noisy entries (7.67%), and locked zero-leakage evaluation splits prior to any augmentation.

Verified Platform Provenance · 100% Real-Scraped Evaluation Splits (Val 3K + Test 3K = 6,000 Rows) 0 Synthetic · 0 External
YouTube API: 3,846 (64.1%) YouTube Zero-API (yt-dlp): 1,567 (26.1%) Reddit: 310 (5.2%) Mastodon: 265 (4.4%) Lemmy: 12 (0.2%)

Source Registry & Quarantine Policy: Comments were collected across 830 tracked YouTube video IDs (spanning Bangladeshi news, comedy, cricket, drama, horror, and global channels), Arctic Shift + Reddit public JSON, Mastodon hashtag timelines, Lemmy, and news RSS. To mitigate rare-class scarcity during training only, 1,600 English rows from dair-ai/emotion (Fear 1,100 + Surprise 500) were quarantined strictly inside train_24k (is_external_train_only = 1; strictly 0 rows in Validation or Test).

Step 1 60,000 Quota-Driven Scraping — ENG 24K, BN 18K, BNG 18K (70% emoji / 30% non-emoji; ~96% YouTube + Reddit, Mastodon, Lemmy, RSS) with SQLite hash dedup.
Step 2 55,399 5K-Chunk Preprocessing — Dropped 4,601 rows (7.67%: non-target script 3,360, Hindi/Hinglish 860, length 352, dupes 24, spam 5); anonymized PII & normalized emoji tones.
Steps 3–4 44,580 Priority Queue & Gemini Flash-Lite — Queued 44,486 rows (Joy/Neutral capped 6,500), labeled 43,111 (100% pilot parse), dropped 131 (conf < 3) → 42,980 + 1,600 train-only external.
Step 6 5,000 Gold Blind Dual-Annotator Consensus — Locked 100% real val_3k & test_3k by text hash; two annotators blindly labeled all 5,000 rows (10,000 judgments, κ = 0.7717, α = 0.7717).
Step 5 30,000 Final Balanced Splits (80/10/10) — train_24k (20,472 real + 3,528 train-only paraphrases), val_3k (66.7% Gold), and test_3k (100% Gold).

End-to-End 11-Step Methodology & Dual-Stream Schema

Each comment is decomposed into clean text, normalized Unicode emoji glyphs, demojized natural-language descriptions, and quantitative affective cues—linking our completed Data Pipeline (Steps 1–6) directly into the Dual-Encoder Cross-Attention & XAI Pipeline (Steps 7–11).

Plate I · Final 11-Step Flow300 DPI
AffectFusion 11-Step Methodology Diagram

AffectFusion 11-Step Methodology

Click to inspect every data volume, encoder stream, and evaluation branch at full resolution.

Data Pipeline · Steps 1–6 (Completed ✓)

Zero-Leakage Multilingual Corpus & Blind Gold Audit

  • Steps 1–2: 60,000 raw ENG/BN/BNG rows (70% emoji) → 55,399 PII-anonymized clean rows (4,601 non-target/Hindi/noise removed); emoji skin tones normalized.
  • Steps 3–4: 44,486 priority-queued → Gemini Flash-Lite (9 classes, 100% pilot parse; 42,980 conf ≥ 3) + 1,600 train-only dair-ai/emotion = 44,580 pool.
  • Steps 5–6: Balanced 80/10/10 splits (24K train / 3K val / 3K test; +3,528 train-only paraphrases) + 5,000 blind dual-annotator gold (κ = 0.7717, α = 0.7717).
Model & Evaluation · Steps 7–11 (Baselines Done → Cross-Attn)

Dual Encoders, Cross-Attention & Tri-Method XAI

  • Steps 7A & 7B: XLM-RoBERTa-base encodes text_stream alongside a mean-pooled 300-d Emoji2Vec-style emoji encoder.
  • Steps 8 & 9: Bidirectional Cross-Attention learns mutual Text ↔ Emoji alignment before 9-class classification.
  • Steps 10A, 10B & 11: Unified SHAP, LIME, and attention maps paired with Accuracy, Macro-F1, ablations & paired significance tests → Interpretable AffectFusion.

Unified Dual-Stream Parquet Schema

Zero-null Parquet/CSV schema across train_24k, val_3k, and test_3k:

← Swipe table →

GroupColumns
Streamsraw_text, text_stream, emoji_stream, demoji_text, baseline_input
Labelslabel, label_id (0–8), language_tag, language_id (0–2)
Densityhas_emoji, emoji_count, unique_emoji_count, emoji_density, text_length, word_count
Cuesexclamation_count, question_count, uppercase_ratio, has_sarcasm_emoji_cue
Auditai_confidence, is_augmented, is_external_train_only, is_human_verified, is_double_adjudicated
Plate IIArchitecture View
Conceptual Multimodal Architecture

Conceptual Multimodal Architecture

Parallel text & emoji streams converging in bidirectional cross-attention and explainability.

Plate IIIWorkflow View
Stage-by-Stage Execution Workflow

Operational Execution Workflow

End-to-end milestone handoffs verifying zero-leakage discipline across every stage.

Blind Dual-Annotator Human-vs-Human Consensus Gold (5,000 Rows)

Evaluating models against unverified automated labels—or single-annotator passes—risks circular bias. Both researchers independently labeled all 5,000 real scraped evaluation rows across Round 1 and a Round 2 blind swap without viewing each other's annotations, achieving 79.80% unanimous agreement (3,990 / 5,000), Cohen's κ = 0.7717, and Krippendorff's α = 0.7717 (Substantial).

Human-vs-Human IAA
κ = 0.7717

α = 0.7717 · ENG 0.7651 · BN 0.8052 · BNG 0.7377

Unanimous & Adjudicated
79.80%

3,990 unanimous · 1,010 resolved (526 A1 / 482 A2 / 2 3rd)

Test 3K Consensus
100% Gold

3,000 paired rows · 78.03% raw · κ = 0.7515

Val 3K Consensus
66.7% Gold

2,000 paired rows · 82.45% raw · κ = 0.8019

Top Human-vs-Human Disagreement Pairs (1,010 Adjudicated)

Mapping genuine human ambiguity across all 5,000 paired rows highlights the exact semantic boundaries—Anger↔Disgust, Joy↔Neutral, and Sarcasm—resolved through structured adjudication:

Anger ↔ Disgust159 pairs (82 / 77)
Joy ↔ Neutral101 pairs (53 / 48)
Anger ↔ Sarcasm96 pairs (56 / 40)
Joy ↔ Sarcasm61 pairs (31 / 30)
Neutral ↔ Surprise48 pairs (22 / 26)
Sarcasm ↔ Disgust46 pairs (21 / 25)
Joy ↔ Anticipation43 pairs (18 / 25)

Read the complete rubric & Sarcasm Priority Rule in AffectFusion_Human_Annotation_Guidelines.md ↗.

Plate IV9×9 IAA Matrix
Gold 5K Blind Human-vs-Human Agreement Matrix

Blind Human-vs-Human Matrix (N = 5,000)

79.80% unanimous agreement (κ = 0.7717, α = 0.7717); see Fig. 10 below for the ENG / BN / BNG breakdown.

Archival Specimen Explorer (100% Consensus Gold test_3k)

Filter real English, Bangla, and Banglish comments to inspect exact dual-stream decomposition (text_stream, emoji_stream, Unicode CLDR demoji_text) alongside blind-swap unanimous agreements and adjudicated resolutions.

Phase-I Benchmarks & Statistical Proof

Controlled comparison of three foundational architectures on the locked 100% Consensus Gold test_3k benchmark—establishing our reference baseline and diagnosing 1,107 errors (including 192 emoji-hijacking regressions such as AFG_042100) prior to Next Phase Cross-Attention.

← Swipe table horizontally →

Model Architecture Val F1 Test Acc Test F1 ENG F1 BN F1 BNG F1 Emoji F1 Non-Emoji Sarcasm F1
CNN-BiLSTM (Kusal et al., 2025) 0.576253.37%0.5304 0.45080.56480.5190 0.54300.43580.4517
XLM-R Text-Only (Unimodal) 0.542054.47%0.5315 0.52700.54980.4379 0.51010.56610.3153
XLM-R Early Fusion (Text + Demoji) 0.653463.10%0.6278 0.62200.63790.5510 0.63430.56040.4626
CNN-BiLSTM (Kusal) XLM-R Text-Only XLM-R Early Fusion (Winner)
p < 0.0001 · All 3,000

Fusion vs. Text-Only

ΔAcc +8.63% · ΔF1 +0.0963
95% CI [+0.0785, +0.1135]
t = 9.55 · McNemar χ² = 87.93

508 test predictions rescued vs. 249 regressed.

p < 0.0001 · Emoji n = 1,974

Core Modality Proof

ΔAcc +12.56% · ΔF1 +0.1242
95% CI [+0.1003, +0.1486]
t = 10.11 · McNemar χ² = 96.53

440 emoji-bearing items rescued vs. 192 hijacked.

p < 0.0001 · vs Prior Art

Fusion vs. CNN-BiLSTM

ΔAcc +9.73% · ΔF1 +0.0974
95% CI [+0.0810, +0.1135]
t = 11.84 · McNemar χ² = 133.15

Text-Only vs. CNN-BiLSTM is non-significant (p = 0.332).

Experimental Figures & EDA Plates

Fig. 01Benchmark
3-Model Baseline Comparison

3-Model Comparison

+9.63 Macro-F1 leap from multimodal fusion.

Fig. 02Ablation
Language and Modality Breakdown

Language & Modality

+12.42 Macro-F1 gain across emoji posts.

Fig. 03Per-Class
Per-Class F1 Comparison

9-Emotion F1 Profile

Sarcasm climbs from 0.3153 to 0.4626.

Fig. 04Error Audit
9x9 Confusion Matrix

9×9 Confusion Matrix

1,107 errors guiding Next Phase Cross-Attention.

Fig. 05Dynamics
Training and Validation Curves

Convergence Curves

Stable 3-epoch optimization (~12.6 min total).

Fig. 06EDA
Class Distribution Before vs After

Class Balancing Audit

Train-only balancing with zero eval leakage.

Fig. 07EDA
Language Distribution per Class

Script Coverage

ENG, BN & BNG representation per emotion.

Fig. 08EDA
Emoji vs Non-Emoji Share

Emoji Prevalence

60.85% overall · 88.2% in Sarcasm.

Fig. 09Provenance
Split Breakdown

Zero-Leakage Breakdown

Strict provenance isolation across 80/10/10.

Fig. 10Blind-Swap IAA
Per-Language Human Agreement Matrices

Per-Language Human IAA

ENG 0.7651 · BN 0.8052 · BNG 0.7377.

Fig. 11Overview
Phase-I Summary Plate

Phase-I Summary Plate

Visual synthesis of Phase-I accomplishments.

Thesis Progress: What's Done & What Remains

All eight Phase-I engineering milestones—including blind dual-annotator consensus gold verification and publicly archiving our 30,000-row benchmark dataset on Zenodo and Hugging Face—are 100% complete. Six core Next Phase deliverables are scheduled for completion within February 2027.

Master FYDP Completion Meter · 8 Completed / 6 Remaining (57% Overall) Phase-I: 100% Complete · Final Completion: Feb 2027
Completed in Phase-I (8 milestones · 57%) Dec 2026 – Jan 2027: Cross-Attention & Ablations (4 milestones · 29%) Feb 2027: XAI, Demo & Thesis Submission (2 milestones · 14%)

Completed Till Now (Phase-I)

8 / 8 Done
I.

Multi-Platform Scraping (60,000 Raw Comments) Done

Built quota-managed scrapers across YouTube (~96% via youtube_api + yt-dlp), Reddit (Arctic Shift), Mastodon, Lemmy & RSS (70% emoji / 30% non-emoji).

II.

5K-Chunk Cleaning & PII Masking (55,399 Kept) Done

Filtered 4,601 noisy/non-target rows (7.67%), masked URLs, handles, emails & phones, normalized emoji skin tones, and deduplicated via text hashes.

III.

Priority Queue & Gemini Flash-Lite Labeling Done

Queued 44,486 rows (Joy/Neutral capped at 6,500), labeled 43,111 rows (100% pilot parse), kept 42,980 at conf ≥ 3 + 1,600 train-only DAIR-AI = 44,580 pool.

IV.

Blind Dual-Annotator Consensus Gold (5,000 Paired) Done

Both authors independently annotated all 5,000 evaluation rows (10,000 judgments: 79.80% unanimous, κ = 0.7717, α = 0.7717; 1,010 disagreements adjudicated).

V.

Zero-Leakage 80/10/10 Lock & Balancing Done

Quarantined 1,600 DAIR-AI rows (Fear 1,100 + Surprise 500) + 3,528 train-only paraphrases strictly inside train_24k; locked 100% real Val & Test.

VI.

Dual-Stream Feature Engineering Done

Engineered text_stream, emoji_stream, CLDR demoji_text, baseline_input, emoji density, punctuation & sarcasm cues + is_double_adjudicated.

VII.

3-Baseline Benchmarks & Statistical Proof Done

Evaluated CNN-BiLSTM, XLM-R Text-Only, and XLM-R Early Fusion on Gold Test—proving +12.42 Macro-F1 emoji lift (t = 10.11, p < 0.0001) and auditing 1,107 errors.

VIII.

Open Dataset Release (Zenodo & Hugging Face) Published

Archived the dataset, Datasheet, CC BY 4.0 License, and SHA-256 hashes on Zenodo (#24543680) & Hugging Face (10.57967/hf/11874).

Published Dataset, Reproducible Code & Citation

Access our publicly released Phase-I dataset on Hugging Face and Zenodo, inspect the Datasheet and SHA-256 verification ledger, or load both dataset configs directly in Python.

Note on Publication Status: The AffectFusion benchmark dataset is publicly published on Zenodo and Hugging Face with permanent DOIs. The companion thesis research paper is scheduled for submission in February 2027; the BibTeX entries below cite the openly released dataset and codebase.
Hugging Face HubDataset Live

DOI: 10.57967/hf/11874

Auto-indexed default (30K Parquet) and gold_audit (5K CSV) configs with live Dataset Viewer.

Zenodo RepositoryArchive Live

Record #24543680

Permanent archival deposit with Parquet & CSV splits, Datasheet, Frictionless JSON & ZIP bundle.

Code & DocumentationPhase-I Repo

GitHub & Docs

Scraping pipelines, Colab notebooks, blind-swap consensus CSVs, and full local reference documents.

Quick-Start Python Loader datasets
from datasets import load_dataset

# 1. Load locked zero-leakage splits (24K train / 3K val / 3K gold test)
ds = load_dataset("ragibhasan/AffectFusion")

# Optional: filter Train to 18,872 AffectFusion-native freshly scraped rows
native_train = ds["train"].filter(
    lambda x: x["is_augmented"] == 0 and x["is_external_train_only"] == 0
)

# 2. Load the 5,000-row human verification audit table
gold = load_dataset("ragibhasan/AffectFusion", "gold_audit", split="audit")
print(f"Native train: {len(native_train):,} | Gold audit: {len(gold):,}")
Cite Dataset (BibTeX)
@dataset{hasan2026affectfusion_hf,
  author       = {Hasan, MD. Ragib and Galib, MD. Asadulla Hel and Akter, Sharmin and Raza, Dewan Mamun},
  title        = {{AffectFusion: A Multilingual Multimodal Text-and-Emoji Emotion Recognition Dataset (English, Bangla, and Banglish)}},
  year         = {2026},
  month        = nov,
  publisher    = {Hugging Face},
  doi          = {10.57967/hf/11874},
  url          = {https://huggingface.co/datasets/ragibhasan/AffectFusion}
}