MentalRoBERTa-Caps: A capsule-enhanced transformer model for mental health classification

IF 1.9 Q2 MULTIDISCIPLINARY SCIENCES
MethodsX Pub Date : 2025-07-09 DOI:10.1016/j.mex.2025.103483
Faheem Ahmad Wagay , Jahiruddin , Yasir Altaf
{"title":"MentalRoBERTa-Caps: A capsule-enhanced transformer model for mental health classification","authors":"Faheem Ahmad Wagay ,&nbsp;Jahiruddin ,&nbsp;Yasir Altaf","doi":"10.1016/j.mex.2025.103483","DOIUrl":null,"url":null,"abstract":"<div><div>In recent years, the dominance of Large Language Models (LLMs) such as BERT and RoBERTa has led to remarkable improvements in NLP tasks, including mental illness detection from social media text. However, these models are often computationally intensive, requiring significant processing time and resources, which limits their applicability in real-time or resource-constrained environments. This paper proposes a lightweight yet effective hybrid model that integrates a 6-layer RoBERTa encoder with a capsule network architecture to balance performance, interpretability, and computational efficiency. The contextual embeddings generated by RoBERTa are transformed into primary capsules, and dynamic routing is employed to generate class capsule outputs that capture high-level abstractions.</div><div>To validate performance and explainability, we employ LIME (Local Interpretable Model-Agnostic Explanations) to provide insights into feature contributions and model decisions. Experimental results on benchmark mental health datasets demonstrate that our approach achieves high accuracy while significantly reducing inference time, making it suitable for deployment in real-world mental health monitoring systems.<ul><li><span>1.</span><span><div>To design a computationally efficient architecture for mental illness detection using a lightweight RoBERTa encoder integrated with capsule networks.</div></span></li><li><span>2.</span><span><div>To perform a detailed time complexity analysis highlighting the trade-offs between performance and efficiency.</div></span></li><li><span>3.</span><span><div>To enhance model interpretability through LIME-based feature attribution, supporting transparent and ex- plainable predictions.</div></span></li></ul></div></div>","PeriodicalId":18446,"journal":{"name":"MethodsX","volume":"15 ","pages":"Article 103483"},"PeriodicalIF":1.9000,"publicationDate":"2025-07-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"MethodsX","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S2215016125003280","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"MULTIDISCIPLINARY SCIENCES","Score":null,"Total":0}
引用次数: 0

Abstract

In recent years, the dominance of Large Language Models (LLMs) such as BERT and RoBERTa has led to remarkable improvements in NLP tasks, including mental illness detection from social media text. However, these models are often computationally intensive, requiring significant processing time and resources, which limits their applicability in real-time or resource-constrained environments. This paper proposes a lightweight yet effective hybrid model that integrates a 6-layer RoBERTa encoder with a capsule network architecture to balance performance, interpretability, and computational efficiency. The contextual embeddings generated by RoBERTa are transformed into primary capsules, and dynamic routing is employed to generate class capsule outputs that capture high-level abstractions.
To validate performance and explainability, we employ LIME (Local Interpretable Model-Agnostic Explanations) to provide insights into feature contributions and model decisions. Experimental results on benchmark mental health datasets demonstrate that our approach achieves high accuracy while significantly reducing inference time, making it suitable for deployment in real-world mental health monitoring systems.
  • 1.
    To design a computationally efficient architecture for mental illness detection using a lightweight RoBERTa encoder integrated with capsule networks.
  • 2.
    To perform a detailed time complexity analysis highlighting the trade-offs between performance and efficiency.
  • 3.
    To enhance model interpretability through LIME-based feature attribution, supporting transparent and ex- plainable predictions.

Abstract Image

心理roberta - caps:一个用于心理健康分类的胶囊增强变压器模型
近年来,BERT和RoBERTa等大型语言模型(llm)的主导地位已经导致NLP任务的显着改进,包括从社交媒体文本中检测精神疾病。然而,这些模型通常是计算密集型的,需要大量的处理时间和资源,这限制了它们在实时或资源受限环境中的适用性。本文提出了一个轻量级但有效的混合模型,该模型集成了一个6层RoBERTa编码器和一个胶囊网络架构,以平衡性能、可解释性和计算效率。RoBERTa生成的上下文嵌入被转换为主胶囊,并使用动态路由来生成捕获高级抽象的类胶囊输出。为了验证性能和可解释性,我们使用LIME(局部可解释模型不可知论解释)来提供对特征贡献和模型决策的见解。在基准心理健康数据集上的实验结果表明,我们的方法在显著减少推理时间的同时达到了较高的准确率,适合在现实世界的心理健康监测系统中部署。利用集成胶囊网络的轻量级RoBERTa编码器,设计一种计算效率高的精神疾病检测体系结构。执行详细的时间复杂度分析,突出性能和效率之间的权衡。通过基于lime的特征归因增强模型的可解释性,支持透明和可解释的预测。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
MethodsX
MethodsX Health Professions-Medical Laboratory Technology
CiteScore
3.60
自引率
5.30%
发文量
314
审稿时长
7 weeks
期刊介绍:
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信