Integrating Large Language Models and Graph Convolutional Networks for Semi-Supervised Image Classification
Implementation accompanying the paper "Integrating Large Language Models and Graph Convolutional Networks for Semi-Supervised Image Classification".
Paper (arXiv): https://arxiv.org/abs/2607.09104
Dataset (Zenodo): https://doi.org/10.5281/zenodo.21367287
This repository implements a multimodal pipeline for semi-supervised image classification that combines visual representations extracted from multiple vision models with semantic similarity scores generated by a Large Language Model (LLM).
The proposed pipeline supports multiple visual encoders and allows experiments to be performed using different visual representations without modifying the downstream processing stages.
- ResNet-152
- DINOv2 ViT-G/14
- Vision Transformer (ViT-B/16)
- Visual feature extraction
- Image caption generation using BLIP
- Ranking-based organization of visual neighbors
- LLM-based semantic similarity scoring
- Graph construction
- Semi-supervised image classification using Simplified Graph Convolution (SGC)
.
├── notebooks/
│ ├── 01_generate_blip_captions.ipynb
│ ├── 02_preprocess_and_consolidate_outputs.ipynb
│ ├── 03_llm_similarity_scoring.ipynb
│ └── 04_graph_based_multimodal_classification.ipynb
│
├── data/
├── results/
├── requirements.txt
└── README.md
- Python 3.10+
- Git
- 7-Zip (or p7zip)
sudo apt update
sudo apt install p7zip-fullbrew install p7zipInstall 7-Zip from:
Clone the repository:
git clone https://github.com/<username>/llm-gcn-semisupervised-image-classification.git
cd llm-gcn-semisupervised-image-classification(Optional) Create a virtual environment:
python -m venv .venvActivate it:
Linux/macOS
source .venv/bin/activateWindows
.venv\Scripts\activateInstall the required packages:
pip install -r requirements.txtThe graph-based experiments require PyTorch Geometric (PyG).
Please install PyG according to your PyTorch version and CUDA configuration by following the official installation guide:
https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html
The datasets required to reproduce the experiments are hosted on Zenodo due to GitHub file size limitations.
DOI:
https://doi.org/10.5281/zenodo.21367287
Download all files from inputs.zip and place them in the data/ directory before running the notebooks.
Run the notebooks in the following order.
| Notebook | Description |
|---|---|
| 01_generate_blip_captions.ipynb | Generates image captions for the Corel5K dataset using BLIP. |
| 02_preprocess_and_consolidate_outputs.ipynb | Creates ranking files and combines image rankings with BLIP captions. |
| 03_llm_similarity_scoring.ipynb | Uses an LLM to estimate semantic similarity scores between image captions. |
| 04_graph_based_multimodal_classification.ipynb | Performs graph construction, SGC training, evaluation and plot generation. |
corel5k_images.7z
captions.csv
corel5k_lists.txt
One ranking file:
CNN-ResNet.7zcorel5k_dinov2_vitg14.txtrks_VIT-B16_original_corel5k.txt
rank_<model>.csvcaptions_rank_<model>.csv
captions_rank_<model>.csv
scores_<llm>_<model>_k<k>.csv
corel5k_lists.txtlabels_corel5k.py
One feature file:
cnn-last_linear-resnet152.npzfeatures_corel5k_dinov2_vitg14.npyfeatures_VIT-B16_corel5k.npy
One LLM score file:
scores_<llm>_<model>_k<k>.csv
accuracy_vs_threshold_knn_<llm>_<model>_k<k>.pdfaccuracy_vs_threshold_reciprocal_knn_<llm>_<model>_k<k>.pdfplots.zip
To reproduce the experiments:
- Clone this repository.
- Install the required dependencies.
- Download the datasets from Zenodo.
- Place all files downloaded from
inputs.zipinto thedata/directory. - Run the notebooks sequentially.
If you use this repository, please cite:
@article{Piscioneri2026,
title={Integrating Large Language Models and Graph Convolutional Networks for Semi-Supervised Image Classification},
author={Camila Piscioneri Magalhães and Lucas Pascotti Valem},
journal={arXiv preprint arXiv:2607.09104},
year={2026}
}