SPP-SCL: Semi-Push-Pull Supervised Contrastive Learning for Image-Text Sentiment Analysis and Beyond
Authors:
Jiesheng Wu¹, Shengrong Li² (Corresponding author) ¹ School of Computer and Information, Anhui Normal University, Wuhu, China ² College of Artificial Intelligence, Nanjing University of Aeronautics and Astronautics, Nanjing, China
- This repository provides codes for "SPP-SCL: Semi-Push-Pull Supervised Contrastive Learning for Image-Text Sentiment Analysis and Beyond" AAAI 2026. Paper
Existing Image-Text Sentiment Analysis (ITSA) methods may suffer from inconsistent intra-modal and inter-modal sentiment relationships. Therefore, we develop a method that balances before fusing to solve the issue of vision-language imbalance intra-modal and inter-modal sentiment relationships; that is, a Semi-Push-Pull Supervised Contrastive Learning (SPP-SCL) method is proposed. Specifically, the method is implemented using a novel two-step strategy, namely first using the proposed intra-modal supervised contrastive learning to pull the relationships between the intra-modal and then performing a well-designed conditional execution statement. If the statement result is false, our method will perform the second step, which is inter-modal supervised contrastive learning to push away the relationships between inter-modal. The two-step strategy will balance the intra-modal and inter-modal relationships to achieve the purpose of relationship consistency and finally perform cross-modal feature fusion for sentiment analysis and detection. Experimental studies on three public image-text sentiment and sarcasm detection datasets demonstrate that SPP-SCL significantly outperforms state-of-the-art methods by a large margin and is more discriminative in sentiment.
Figure 1: Overall architecture of SPP-SCL. The framework includes two main steps: intra-modal sentiment alignment via supervised contrastive learning, and conditional inter-modal sentiment alignment.
Figure 2: Quantitative Results
Figure 3: Qualitative Results.
The training and testing experiments are conducted using PyTorch with an NVIDIA Tesla V100 GPU of 16 GB Memory.
-
Configuring your environment (Prerequisites):
- Installing necessary packages:
pip install -r requirements.txt. - Our training, validation, and testing partitioning follows the CLMLF partitioning method in NAACL2022 to ensure fair comparison.
- Installing necessary packages:
-
Downloading necessary data:
-
downloading the datasets and moving them into
./data/, which can be found from two MVSA Datasets for MVSA-Single and MVSA-Multiple Datasets. HFM Dataset can be found from HFM. Also, these datasets can be downloaded from our (Baidu Drive) (extraction code:5iew). -
downloading our weights and move them into
./save_models/MVSA-S.pth or MVSA-M.pth or HFM.pth, which can be found from (Baidu Drive) (extraction code: afr5). -
downloading pre-trained ResNet50 and bert-base-uncased weights and move them into
./pre_train/and./bert-base-uncased/, which can be found from Baidu Drive (extraction code: dgp6) and Baidu Drive (extraction code: ys4w).
-
-
Training Configuration:
- After you download the dataset, just run
train.pyto train our model.
- After you download the dataset, just run
-
Testing and Evaluating Configuration:
- After you download all the trained weights, just run
test.pyto perform a prediction. -
📢 Important Update: Due to accidental server cleanup, all models were retrained on new hardware. The updated results (see
results.txt) are even better than those reported in the AAAI 2026 paper.
- After you download all the trained weights, just run
Note: If you have difficulty accessing Baidu Drive, please contact us for alternative download links.
Please cite our paper if you find the work useful. Thanks!
@article{Wu_Li_2026,
title={SPP-SCL: Semi-Push-Pull Supervised Contrastive Learning for Image-Text Sentiment Analysis and Beyond},
volume={40},
url={https://ojs.aaai.org/index.php/AAAI/article/view/37200},
DOI={10.1609/aaai.v40i3.37200},
number={3},
journal={Proceedings of the AAAI Conference on Artificial Intelligence},
author={Wu, Jiesheng and Li, Shengrong},
year={2026},
month={Mar.},
pages={2173-2181}
}
For any questions, discussions, or collaboration opportunities, please contact:
Jiesheng Wu
School of Computer and Information, Anhui Normal University, Wuhu, China
Email: jasonwu@mail.nankai.edu.cn