A lightweight hybrid deep learning approach for fashion mnist classification with explainable attention visualization

H Hafeez Ahmad T Tahira Anwar Lashari S Saima Anwar Lashari I Ijaz Khan F Farzana Jabeen

Abstract

The classification of fashion images is an essential task in the e-commerce sector, where accurate categorization improves user experience and refines product discovery. Convolutional Neural Networks (CNNs) and Transformers have demonstrated strong performance in image classification tasks due to their ability to learn complex visual features. However, deep variants of these architectures, such as VGG-19, ResNet-50, Vision Transformer (ViT), and Swin Transformer, contain tens of millions of parameters, requiring high memory and powerful GPUs for training, which makes them less suitable for low-resource and edge device environments. To address these limitations, this research proposes a lightweight hybrid architecture, TinyCNN with Linear Self-Attention (LSA), optimized for resource-constrained settings. The proposed model contains fewer than half a million parameters and is trainable on a CPU, achieving a classification accuracy of 91.47% on the Fashion-MNIST dataset. In addition, multiple Explainable Artificial Intelligence (XAI) techniques are implemented, including Self-Attention visualization, Multi-Head Attention, Attention Flow, Attention Rollout, Fixed query position attention maps, Integrated Gradients, LIME, and SHAP, to provide visual interpretability of the model’s predictions and enhance transparency in its decision-making process.

Article Details

Journal PLoS ONE
Volume / Issue Vol. 21, Issue 6
Published June 23, 2026
Pages e0351671
ISSN 1932-6203
Publisher Public Library of Science

Journal Info

PLoS ONE

Public Library of Science

ISSN: 1932-6203 Open Access Health Sciences

Authors (5)

H

Hafeez Ahmad

T

Tahira Anwar Lashari

S

Saima Anwar Lashari

I

Ijaz Khan

F

Farzana Jabeen