Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- QCRI/CrisisMMD
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
metrics:
|
| 7 |
+
- accuracy
|
| 8 |
+
- f1
|
| 9 |
+
- recall
|
| 10 |
+
- precision
|
| 11 |
+
base_model:
|
| 12 |
+
- google-bert/bert-base-uncased
|
| 13 |
+
- microsoft/resnet-50
|
| 14 |
+
---
|
| 15 |
+
Source: CrisisMMD dataset (Alam et al., 2017)
|
| 16 |
+
|
| 17 |
+
✅Original Labels (8 classes from annotations):
|
| 18 |
+
|
| 19 |
+
Infrastructure and utility damage
|
| 20 |
+
|
| 21 |
+
Vehicle damage
|
| 22 |
+
|
| 23 |
+
Rescue, volunteering, or donation efforts
|
| 24 |
+
|
| 25 |
+
Affected individuals
|
| 26 |
+
|
| 27 |
+
Injured or dead people
|
| 28 |
+
|
| 29 |
+
Missing or found people
|
| 30 |
+
|
| 31 |
+
Other relevant information
|
| 32 |
+
|
| 33 |
+
Not humanitarian
|
| 34 |
+
|
| 35 |
+
✅Label Preprocessing (Class Merging):
|
| 36 |
+
|
| 37 |
+
Vehicle damage merged into Infrastructure and utility damage
|
| 38 |
+
|
| 39 |
+
Missing or found people merged into Affected individuals
|
| 40 |
+
|
| 41 |
+
Not humanitarian retained as a separate class
|
| 42 |
+
|
| 43 |
+
Removed very low-frequency categories (e.g., "Missing or found people" as a separate class)
|
| 44 |
+
|
| 45 |
+
✅Final Label Set (5 classes total):
|
| 46 |
+
|
| 47 |
+
Infrastructure and utility damage
|
| 48 |
+
|
| 49 |
+
Rescue, volunteering, or donation efforts
|
| 50 |
+
|
| 51 |
+
Affected individuals
|
| 52 |
+
|
| 53 |
+
Injured or dead people
|
| 54 |
+
|
| 55 |
+
Not humanitarian
|
| 56 |
+
|
| 57 |
+
✅Multimodal Consistency:
|
| 58 |
+
|
| 59 |
+
Selected only those posts where text and image annotations matched
|
| 60 |
+
|
| 61 |
+
Resulted in a total of 8,219 consistent samples:
|
| 62 |
+
|
| 63 |
+
Train set: 6,574 posts
|
| 64 |
+
|
| 65 |
+
Test set: 1,644 posts
|
| 66 |
+
|
| 67 |
+
✅ Preprocessing Done
|
| 68 |
+
Text:
|
| 69 |
+
|
| 70 |
+
Tokenized using BERT tokenizer (bert-base-uncased)
|
| 71 |
+
|
| 72 |
+
Extracted input_ids and attention_mask
|
| 73 |
+
|
| 74 |
+
Image:
|
| 75 |
+
|
| 76 |
+
Processed using ResNet-50
|
| 77 |
+
|
| 78 |
+
Extracted 2048-dimensional image features
|
| 79 |
+
|
| 80 |
+
The preprocessed data was saved in PyTorch .pt format:
|
| 81 |
+
|
| 82 |
+
train_human.pt and test_human.pt
|
| 83 |
+
|
| 84 |
+
Each contains: input_ids, attention_mask, image_vector, and label
|
| 85 |
+
|
| 86 |
+
✅ Model Architecture
|
| 87 |
+
A custom multimodal classifier that combines BERT and ResNet-50 outputs:
|
| 88 |
+
|
| 89 |
+
Component Details
|
| 90 |
+
Text Encoder BERT base (bert-base-uncased) – outputs pooler_output (768-d)
|
| 91 |
+
Image Encoder Pre-extracted ResNet-50 image features (2048-d)
|
| 92 |
+
Fusion Concatenation → FC layers → Softmax over 5 classes
|
| 93 |
+
Classifier Fully connected layers with BatchNorm, ReLU, Dropout
|
| 94 |
+
|
| 95 |
+
✅ Training Setup
|
| 96 |
+
Loss Function: CrossEntropyLoss
|
| 97 |
+
|
| 98 |
+
Optimizer: AdamW
|
| 99 |
+
|
| 100 |
+
Scheduler: StepLR (γ = 0.9)
|
| 101 |
+
|
| 102 |
+
Epochs Tried: 1, 3, 5, 8, 10
|
| 103 |
+
|
| 104 |
+
Batch Size: 16
|
| 105 |
+
|
| 106 |
+
Runtime: ~2 minutes 20 seconds per epoch on Google Colab (T4 GPU)
|
| 107 |
+
|
| 108 |
+
✅ Evaluation Metrics
|
| 109 |
+
Accuracy
|
| 110 |
+
|
| 111 |
+
Precision
|
| 112 |
+
|
| 113 |
+
Recall
|
| 114 |
+
|
| 115 |
+
F1 Score
|
| 116 |
+
|
| 117 |
+
✅ Metrics(epoch 3 with highest accuracy)
|
| 118 |
+
|
| 119 |
+
✅ Test Accuracy : 0.8820
|
| 120 |
+
✅ Precision : 0.6854
|
| 121 |
+
✅ Recall : 0.7176
|
| 122 |
+
✅ F1 Score : 0.7005
|