ADNN-FER: adaptive deep neural networks for real-time facial expression recognition using hybrid attention, compound loss functions, and transformer-enhanced feature fusion
Keywords:
Neural Networks, Facial Expression Recognition, Efficient Net, Transformer, Attention Mechanism, Affective ComputingAbstract
Facial Expression Recognition (FER) is a core technology in affective computing and has applications in Human–Computer Interaction, autonomous driving, clinical diagnostics, and adaptive education. However, existing FER models often suffer from occlusion sensitivity, illumination variation, ambiguous subtle expressions, and the challenge of balancing accuracy with real-time inference speed. To address these limitations, this paper proposes a novel hybrid framework, ADNN-FER, which integrates an EfficientNet-B5 convolutional backbone, a Convolutional Block Attention Module (CBAM), and a lightweight six-layer multi-head self-attention Transformer. The framework is trained end-to-end using a compound multi-objective loss function. ADNN-FER is extensively evaluated on the FER2013, RAF-DB, Affect Net, and FERPlus benchmark datasets. The proposed compound loss function combines classification loss, center loss, and intra-class variation loss to address class imbalance, annotation noise, and feature compactness simultaneously. The training pipeline further incorporates seven-stage data augmentation, 68-point facial landmark preprocessing, CLAHE normalization, and Action Unit auxiliary supervision. Model interpretability is analyzed using Grad-CAM and SHAP, while Bayesian optimization is employed for hyper parameter tuning. Ablation studies involving five model variants demonstrate the contribution of each module. Experimental results show that ADNN-FER achieves accuracies of 94.7% on FER2013, 95.1% on RAF-DB, 88.9% on Affect Net, and 92.4% on FERPlus, while operating at 52 FPS on an NVIDIA RTX 3090. Statistical analysis using paired t-tests with Bonferroni correction (p < 0.001) confirms significant improvement over ten competing methods. The proposed framework establishes a strong benchmark for real-time multi-class FER by effectively combining accuracy, efficiency, and interpretability.
References
EkmanP.FriesenW. V.Facial Action Coding SystemConsulting Psychologists PressPalo Alto, CA, USA197810.1037/t27734-000
PicardR. W.Affective ComputingMIT PressCambridge, MA, USA199710.7551/mitpress/1140.001.0001
LeCunY.BengioY.HintonG.Deep learningNature2015521755343644410.1038/nature14539
KrizhevskyA.SutskeverI.HintonG. E.ImageNet classification with deep convolutional neural networksCommunications of the ACM2017606849010.1145/3065386
GuoX.MetaCorrection: Domain-aware meta loss correction for unsupervised domain adaptation in semantic segmentation2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)Nashville, TN, USA202110.1109/CVPR46437.2021.00392
LiS.DengW.DuJ.Reliable crowdsourcing and deep locality-preserving learning for expression recognition in the wild2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR)Honolulu, HI201710.1109/CVPR.2017.277
WangK.Region attention networks for pose and occlusion robust facial action unit detectionIEEE Transactions on Image Processing20192873303331610.48550/arXiv.1905.04075
CaiJ.Identity-free facial expression recognition using conditional generative adversarial network2021 IEEE International Conference on Image Processing (ICIP)Anchorage, AK, USA202110.1109/ICIP42928.2021.9506593
MaF.SunB.LiS.Facial expression recognition with visual transformers and attentional selective fusionIEEE Transactions on Affective Computing20231421236124810.1109/TAFFC.2021.3122146
LuceyP.The Extended Cohn-Kanade Dataset (CK+): A complete dataset for action unit and emotion-specified expression2010 IEEE CVPR WorkshopsSan Francisco, CA, USA201010.1109/CVPRW.2010.5543262
ShanC.GongS.McOwanP. W.Facial expression recognition based on Local Binary Patterns: A comprehensive studyImage and Vision Computing200927680381610.1016/j.imavis.2008.08.005
DhallA.Static facial expression analysis in tough conditions: Data, evaluation protocol and benchmark2011 IEEE ICCV WorkshopsBarcelona, Spain201110.1109/ICCVW.2011.6130508
GoodfellowI. J.Challenges in representation learning: a report on three machine learning contestsNeural Networks201564596310.1016/j.neunet.2014.09.005
FarzanehH.QiX.Facial expression recognition in the wild via deep attentive center loss2021 IEEE Winter Conference on Applications of Computer Vision (WACV)Waikoloa, HI, USA202110.1109/WACV48630.2021.00245
HuJ.Squeeze-and-Excitation NetworksIEEE Transactions on Pattern Analysis and Machine Intelligence20204282011202310.1109/TPAMI.2019.2913372
WooS.ParkJ.LeeJ.-Y.KweonI. S.CBAM: Convolutional Block Attention ModuleComputer Vision – ECCV 2018Springer International PublishingCham201831910.1007/978-3-030-01234-2_1
DosovitskiyA.An image is worth 16×16 words: Transformers for image recognition at scaleProc. ICLR202110.48550/arXiv.2010.11929
LiuZ.Swin Transformer: Hierarchical vision transformer using shifted windows2021 IEEE/CVF International Conference on Computer Vision (ICCV)Montreal, QC, Canada202110.1109/ICCV48922.2021.00986
ZhangZ.Cross-modal learning with auxiliary cross-attention for facial expression recognitionIEEE Transactions on Affective Computing202415121823010.1109/TIP.2026.3688163
WenY.ZhangK.LiZ.QiaoY.A discriminative feature learning approach for deep face recognitionComputer Vision – ECCV 2016Springer International PublishingCham201649951510.1007/978-3-319-46478-7_31
LinT.-Y.Focal loss for dense object detectionIEEE Transactions on Pattern Analysis and Machine Intelligence202042231832710.1109/TPAMI.2018.2858826
SzegedyC.Rethinking the inception architecture for computer vision2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR)Las Vegas, NV, USA201610.1109/CVPR.2016.308
DengJ.RetinaFace: Single-shot multi-level face localisation in the wild2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)Seattle, WA, USA202010.1109/CVPR42600.2020.00525
DeVriesT.TaylorG. W.Improved regularization of convolutional neural networks with CutoutarXiv201710.48550/arXiv.1708.04552
ZhangH.Mixup: Beyond empirical risk minimizationProc. ICLR201810.48550/arXiv.1710.09412
TanM.LeQ. V.EfficientNet: Rethinking model scaling for convolutional neural networksProc. ICML20196105611410.48550/arXiv.1905.11946
VaswaniA.Attention is all you needProc. NeurIPS2017305998600810.48550/arXiv.1706.03762
CalvoR. A.D’MelloS.Affect detection: An interdisciplinary review of models, methods, and their applicationsIEEE Transactions on Affective Computing201011183710.1109/TAFFC.2010.1
Published
How to Cite
Issue
Section
Copyright (c) 2025 The Author(s)

This work is licensed under a Creative Commons Attribution 4.0 International License.