{"paper_id":"0bfc0dcf-c5a4-4d7a-955c-21cf1dcb2fbc","body_text":"Intelligent Spam Filtering and Analysis Using Web Automation, ReportLab, and Ensemble Machine Learning Techniques | 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 Intelligent Spam Filtering and Analysis Using Web Automation, ReportLab, and Ensemble Machine Learning Techniques Sathvik Eppakayala, Shiva Kumar Goud Ankula This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-5941111/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 The greatest cybersecurity problem of spam emails results in security risks and unnecessary mails in inboxes. To resolve this issue, we developed a real-time automated spam filtering system that efficiently detects and filters spam emails. The goal was to build a model that not only achieves high accuracy but also continuously works without the intervention of a user. We have trained and tested five machine learning classifiers: logistic regression, decision tree, K-nearest neighbors (KNN), Gaussian naive Bayes, and AdaBoost. We have compared their performances with precision, recall, and F1-score. Among them, AdaBoost has performed the best, showing the highest accuracy in classifying spam and legitimate emails. In order to improve the reliability, we combined and balanced two different spam email datasets so that our model adapts well to the various types of emails. This meant that we implemented a fully automatic system by constructing a web application using Python Flask. We deployed Selenium to get emails from a user's inbox automatically and to classify them real-time. Subsequently, it generates an automatically created PDF report using ReportLab, which highlights the detected patterns of spam mail and the success rate of spam filtering. A hands-free mechanism ensures that this process does not require users to check and go through their spam emails manually and thus increases both efficiency and security. Our results indicated that real-time machine learning-based spam filtering along with automation boosts accuracy and reliability. Our system is scalable and adaptable, so it can be useful for many email platforms. We will try to improve the model further, adapting it in order to follow the evolving techniques of spammers, improving speed of processing, and integrating some additional security features. Our contribution is toward making advanced, real-time spam-filtering solutions able to protect the users from unwanted and harmful e-mails. Spam Email Machine learning Ensemble Automation Flask Selenium Full Text Additional Declarations No competing interests reported. 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-5941111\",\"acceptedTermsAndConditions\":true,\"allowDirectSubmit\":true,\"archivedVersions\":[],\"articleType\":\"Research Article\",\"associatedPublications\":[],\"authors\":[{\"id\":412141042,\"identity\":\"35dc4534-5195-4abb-a297-9e3434757fed\",\"order_by\":0,\"name\":\"Sathvik Eppakayala\",\"email\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABOUlEQVRIie2PP0vDQBiH7zi4LkdvvSPVfoVIICj+yVdRAulym1NRNFC4yepa0Q+hS3A0HLSLdo60Q2IGF5cgSruIl6JIaYqOgvcMLz9+vA/3HgAGwx8FhnrUPxNhzTxOdSb1nxRcprhUQODbpYJ/qwAGhMvAV1MBtbpx0TtUTVwbZC/FjWrw8NZtv4qdBgYoe0wWFX459PlVX61JIhwW3yliwTAYrUS+Pgw7jlhU7ETYPMUKSiAAi2VAVhHoj3iEtEKwVaF4iXCm6bvyJH3KJzMFQ7nPo+Olis2Ey6+l2pNs19WvbBGLIAyLSC1V2HgYbJyftnzJnt31e63wHkYWjAYEo+q/0Iuuejh529w+o608aUvmsYQWxTQ68Gitk+UVCmCknJ35Es1KVLH+rRzNl3CyZNtgMBj+JR9GS2SX2aJKgQAAAABJRU5ErkJggg==\",\"orcid\":\"\",\"institution\":\"R.V.R. \\u0026 J.C. College of Engineering\",\"correspondingAuthor\":true,\"prefix\":\"\",\"firstName\":\"Sathvik\",\"middleName\":\"\",\"lastName\":\"Eppakayala\",\"suffix\":\"\"},{\"id\":412141043,\"identity\":\"549e2feb-c6d8-406a-8f08-a3434481ca6c\",\"order_by\":1,\"name\":\"Shiva Kumar Goud Ankula\",\"email\":\"\",\"orcid\":\"\",\"institution\":\"R.V.R. \\u0026 J.C. College of Engineering\",\"correspondingAuthor\":false,\"prefix\":\"\",\"firstName\":\"Shiva\",\"middleName\":\"Kumar Goud\",\"lastName\":\"Ankula\",\"suffix\":\"\"}],\"badges\":[],\"createdAt\":\"2025-02-01 09:53:22\",\"currentVersionCode\":1,\"declarations\":\"\",\"doi\":\"10.21203/rs.3.rs-5941111/v1\",\"doiUrl\":\"https://doi.org/10.21203/rs.3.rs-5941111/v1\",\"draftVersion\":[],\"editorialEvents\":[],\"editorialNote\":\"\",\"failedWorkflow\":false,\"files\":[{\"id\":75961550,\"identity\":\"76fac701-52a9-4ff0-931e-7efe57669c8c\",\"added_by\":\"auto\",\"created_at\":\"2025-02-11 02:55:07\",\"extension\":\"pdf\",\"order_by\":1,\"title\":\"\",\"display\":\"\",\"copyAsset\":false,\"role\":\"manuscript-pdf\",\"size\":512997,\"visible\":true,\"origin\":\"\",\"legend\":\"\",\"description\":\"\",\"filename\":\"IntelligentSpamFilteringandAnalysisUsingWebAutomation.pdf\",\"url\":\"https://assets-eu.researchsquare.com/files/rs-5941111/v1_covered_68f4b371-3082-4836-8a6e-0aea3c72f97f.pdf\"}],\"financialInterests\":\"No competing interests reported.\",\"formattedTitle\":\"Intelligent Spam Filtering and Analysis Using Web Automation, ReportLab, and Ensemble Machine Learning Techniques\",\"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\":\"info@researchsquare.com\",\"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\":\"Spam, Email, Machine learning, Ensemble, Automation, Flask, Selenium\",\"lastPublishedDoi\":\"10.21203/rs.3.rs-5941111/v1\",\"lastPublishedDoiUrl\":\"https://doi.org/10.21203/rs.3.rs-5941111/v1\",\"license\":{\"name\":\"CC BY 4.0\",\"url\":\"https://creativecommons.org/licenses/by/4.0/\"},\"manuscriptAbstract\":\"\\u003cp\\u003eThe greatest cybersecurity problem of spam emails results in security risks and unnecessary mails in inboxes. To resolve this issue, we developed a real-time automated spam filtering system that efficiently detects and filters spam emails. The goal was to build a model that not only achieves high accuracy but also continuously works without the intervention of a user. We have trained and tested five machine learning classifiers: logistic regression, decision tree, K-nearest neighbors (KNN), Gaussian naive Bayes, and AdaBoost. We have compared their performances with precision, recall, and F1-score. Among them, AdaBoost has performed the best, showing the highest accuracy in classifying spam and legitimate emails. In order to improve the reliability, we combined and balanced two different spam email datasets so that our model adapts well to the various types of emails. This meant that we implemented a fully automatic system by constructing a web application using Python Flask. We deployed Selenium to get emails from a user's inbox automatically and to classify them real-time. Subsequently, it generates an automatically created PDF report using ReportLab, which highlights the detected patterns of spam mail and the success rate of spam filtering. A hands-free mechanism ensures that this process does not require users to check and go through their spam emails manually and thus increases both efficiency and security. Our results indicated that real-time machine learning-based spam filtering along with automation boosts accuracy and reliability. Our system is scalable and adaptable, so it can be useful for many email platforms. We will try to improve the model further, adapting it in order to follow the evolving techniques of spammers, improving speed of processing, and integrating some additional security features. Our contribution is toward making advanced, real-time spam-filtering solutions able to protect the users from unwanted and harmful e-mails.\\u003c/p\\u003e\",\"manuscriptTitle\":\"Intelligent Spam Filtering and Analysis Using Web Automation, ReportLab, and Ensemble Machine Learning Techniques\",\"msid\":\"\",\"msnumber\":\"\",\"nonDraftVersions\":[{\"code\":1,\"date\":\"2025-02-11 02:30:54\",\"doi\":\"10.21203/rs.3.rs-5941111/v1\",\"editorialEvents\":[{\"type\":\"communityComments\",\"content\":0}],\"status\":\"published\",\"journal\":{\"display\":true,\"email\":\"info@researchsquare.com\",\"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\":\"ec38b2a1-3740-4a78-b256-c20a5db0869d\",\"owner\":[],\"postedDate\":\"February 11th, 2025\",\"published\":true,\"recentEditorialEvents\":[],\"rejectedJournal\":[],\"revision\":\"\",\"amendment\":\"\",\"status\":\"posted\",\"subjectAreas\":[],\"tags\":[],\"updatedAt\":\"2025-02-11T02:30:54+00:00\",\"versionOfRecord\":[],\"versionCreatedAt\":\"2025-02-11 02:30:54\",\"video\":\"\",\"vorDoi\":\"\",\"vorDoiUrl\":\"\",\"workflowStages\":[]},\"version\":\"v1\",\"identity\":\"rs-5941111\",\"journalConfig\":\"researchsquare\"},\"__N_SSP\":true},\"page\":\"/article/[identity]/[[...version]]\",\"query\":{\"redirect\":\"/article/rs-5941111\",\"identity\":\"rs-5941111\",\"version\":[\"v1\"]},\"buildId\":\"8U1c8b4HqxoKbykW_rLl7\",\"isFallback\":false,\"isExperimentalCompile\":false,\"dynamicIds\":[84888],\"gssp\":true,\"scriptLoader\":[]}","source_license":"CC-BY-4.0","license_restricted":false}