Addressing Class Imbalance in Malware Detection with Cost-Sensitive Learning: A Framework for Enhanced Performance | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Addressing Class Imbalance in Malware Detection with Cost-Sensitive Learning: A Framework for Enhanced Performance Isaac Kofi Nti, Owusu Nyarko-Boateng, Esther N. G. Khakata This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7149820/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Malware detection remains a key yet challenging aspect of computer security. Mainly due to the constantly evolving nature of malware and the growing complexity of cyber-attacks. Conventional malware detection methods are known to perform poorly when confronted with imbalanced datasets. In this study, we introduce a cost-sensitive ensemble learning methodology combined with feature importance analysis to effectively address the class imbalance problem in malware detection tasks. Specifically, we applied different cost learning matrices on the Light Gradient Boosting Machine (LightGBM) and Random Forest (RF) as feature selection techniques to measure their impact on detection performance. Our results showed that cost-sensitive learning can improve malware detection accuracy on imbalanced malware data. Our feature importance analysis offered a good insight into identifying higher predictors of malware. Overall, our study provides a promising path toward improving malware detection capabilities, ultimately contributing to enhancement in computer security. Artificial Intelligence and Machine Learning Malware-detection cost-sensitive LightGBM random-forest interpretability trustworthy-AI Full Text Additional Declarations The authors declare no competing interests. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7149820","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":486944562,"identity":"fe28069e-e193-4c91-b623-dddc771acefd","order_by":0,"name":"Isaac Kofi Nti","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAuklEQVRIiWNgGAWjYFACxgYgISEHYh54QJQONrAWC2OwlgTitIDJikSQRgaitJjLNzc+5vkjkT4/7PBDoC12croNBLRYtjE2G/O2SeRuvJ1mANSSbGx2gIAWg2OMbdK8DUAtsxNAWg4kbiNKC8hhhrPTP5CihU0iQV46h2hbEpsN57ZJGG6Qzik4kGBAjF8OH3/44M2fOnn52embP3yosJMjqAWhF6zSgFjlICDfQIrqUTAKRsEoGFEAALhfQyfNdO0xAAAAAElFTkSuQmCC","orcid":"https://orcid.org/0000-0001-9257-4295","institution":"School of Information Technology University of Cincinnati Cincinnati, USA","correspondingAuthor":true,"prefix":"","firstName":"Isaac","middleName":"Kofi","lastName":"Nti","suffix":""},{"id":486944563,"identity":"acc32fd2-2ce1-4a91-bb18-40292bab3cd8","order_by":1,"name":"Owusu Nyarko-Boateng","email":"","orcid":"https://orcid.org/0000-0003-0300-2469","institution":"","correspondingAuthor":false,"prefix":"","firstName":"Owusu","middleName":"","lastName":"Nyarko-Boateng","suffix":""},{"id":486944564,"identity":"d6a54f6f-e7dd-4673-a6f5-0c83cd668e74","order_by":2,"name":"Esther N. G. Khakata","email":"","orcid":"https://orcid.org/0000-0003-3145-6193","institution":"School of Computing and Engineering Sciences Strathmore University Nairobi, Kenya","correspondingAuthor":false,"prefix":"","firstName":"Esther","middleName":"N. G.","lastName":"Khakata","suffix":""}],"badges":[],"createdAt":"2025-07-17 14:06:17","currentVersionCode":1,"declarations":{"humanSubjects":false,"vertebrateSubjects":false,"conflictsOfInterestStatement":false,"humanSubjectEthicalGuidelines":false,"humanSubjectConsent":false,"humanSubjectClinicalTrial":false,"humanSubjectCaseReport":false,"vertebrateSubjectEthicalGuidelines":false},"doi":"10.21203/rs.3.rs-7149820/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7149820/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":87003477,"identity":"7386b40f-e61b-4766-927c-d2c9dab538e1","added_by":"auto","created_at":"2025-07-18 07:50:56","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":600832,"visible":true,"origin":"","legend":"","description":"","filename":"AIBThingsNTIV3.0Final.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7149820/v1_covered_8fcfb05b-4d23-4eea-a19e-ebe33ca56f60.pdf"}],"financialInterests":"The authors declare no competing interests.","formattedTitle":"\u003cp\u003eAddressing Class Imbalance in Malware Detection with Cost-Sensitive Learning: A Framework for Enhanced Performance\u003c/p\u003e","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Malware-detection, cost-sensitive, LightGBM, random-forest, interpretability, trustworthy-AI","lastPublishedDoi":"10.21203/rs.3.rs-7149820/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7149820/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eMalware detection remains a key yet challenging aspect of computer security. Mainly due to the constantly evolving nature of malware and the growing complexity of cyber-attacks. Conventional malware detection methods are known to perform poorly when confronted with imbalanced datasets. In this study, we introduce a cost-sensitive ensemble learning methodology combined with feature importance analysis to effectively address the class imbalance problem in malware detection tasks. Specifically, we applied different cost learning matrices on the Light Gradient Boosting Machine (LightGBM) and Random Forest (RF) as feature selection techniques to measure their impact on detection performance. Our results showed that cost-sensitive learning can improve malware detection accuracy on imbalanced malware data. Our feature importance analysis offered a good insight into identifying higher predictors of malware. Overall, our study provides a promising path toward improving malware detection capabilities, ultimately contributing to enhancement in computer security.\u003c/p\u003e","manuscriptTitle":"Addressing Class Imbalance in Malware Detection with Cost-Sensitive Learning: A Framework for Enhanced Performance","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-07-18 07:42:49","doi":"10.21203/rs.3.rs-7149820/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"e0bb9d2a-03ad-452e-bf65-de416489e521","owner":[],"postedDate":"July 18th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[{"id":51698786,"name":"Artificial Intelligence and Machine Learning"}],"tags":[],"updatedAt":"2025-07-18T07:42:49+00:00","versionOfRecord":[],"versionCreatedAt":"2025-07-18 07:42:49","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-7149820","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7149820","identity":"rs-7149820","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.