Nonlinear Optimization of Recurrent Neural Networks in the Prediction of Air Quality | 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 Nonlinear Optimization of Recurrent Neural Networks in the Prediction of Air Quality Ivan Niyonzima, Ronald Waweru Mwangi, Petronilla Muthoni Muriithi This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-8212332/v1 This work is licensed under a CC BY 4.0 License Status: Under Review Version 1 posted 15 You are reading this latest preprint version Abstract Ambient air pollution remains a major threat to public health, particularly in low- and middle-income countries where monitoring infrastructure is often limited. Fine particulate matter (PM2.5) is of particular concern due to its strong association with respiratory and cardiovascular diseases. This study presents a nonlinear optimization framework designed to enhance the predictive performance of Long Short-Term Memory (LSTM) networks in forecasting PM2.5 concentrations. Using a large-scale dataset of more than 506,000 hourly air quality observations collected across Uganda, the proposed model integrates a constrained nonlinear optimization mechanism into the LSTM architecture. This approach reduces overfitting, improves generalization, and provides a theoretically grounded solution to recurrent neural network instability. Experimental results show that the model achieved a Mean Squared Error (MSE) of 0.5968, a Mean Absolute Error (MAE) of 0.5276, and a coefficient of determination (R²) of 0.1875. Feature importance analysis indicated that PM10, carbon dioxide (CO₂), and humidity were the most influential predictors of PM2.5 concentrations. The model successfully captured long-term pollutant trends and seasonal variations, but it underestimated extreme pollution events, suggesting the potential value of ensemble strategies and cost-sensitive learning for improving sensitivity to peaks. Despite these limitations, the findings underscore the viability of integrating nonlinear optimization techniques within deep learning frameworks to achieve more robust and stable predictions. Importantly, this work contributes to advancing air quality forecasting in resource-constrained environments and provides a methodological foundation for future studies that aim to incorporate broader environmental and socio-economic factors. Air Quality Prediction Long Short-Term Memory (LSTM) Nonlinear Optimization PM2.5 Forecasting Machine Learning Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Under Review Version 1 posted Editorial decision: Revision requested 22 Dec, 2025 Reviews received at journal 17 Dec, 2025 Reviewers agreed at journal 17 Dec, 2025 Reviews received at journal 17 Dec, 2025 Reviewers agreed at journal 12 Dec, 2025 Reviews received at journal 07 Dec, 2025 Reviewers agreed at journal 01 Dec, 2025 Reviews received at journal 01 Dec, 2025 Reviewers agreed at journal 01 Dec, 2025 Reviewers agreed at journal 01 Dec, 2025 Reviewers invited by journal 01 Dec, 2025 Editor invited by journal 01 Dec, 2025 Editor assigned by journal 27 Nov, 2025 Submission checks completed at journal 27 Nov, 2025 First submitted to journal 26 Nov, 2025 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-8212332","acceptedTermsAndConditions":true,"allowDirectSubmit":false,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":553426690,"identity":"9506a5c9-1b42-46d0-b481-14c9546d3084","order_by":0,"name":"Ivan Niyonzima","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAuUlEQVRIiWNgGAWjYDACZgZjECUHIg48IEULmDiQQKQ9YNWJDSCSKC3m7MybjW7UHE6fH3b4IdAWOzndBgJaLJvZipNzjqXlbrydZgDUkmxsdoCAFoPDPMaHc9hscjfOTgBpOZC4jTgt/yTSDWenfyBeS3Jum02CvHQO0bawFRvn9qUZbpDOKTiQYECMX84f3iyd8+2wvPzs9M0fPlTYyRHUgtALVmlArHIQkG8gRfUoGAWjYBSMKAAAHeRDlLyHus8AAAAASUVORK5CYII=","orcid":"","institution":"Kabale University","correspondingAuthor":true,"prefix":"","firstName":"Ivan","middleName":"","lastName":"Niyonzima","suffix":""},{"id":553426691,"identity":"a93ba520-fe0c-4cc8-882f-ea1c94a5e9d3","order_by":1,"name":"Ronald Waweru Mwangi","email":"","orcid":"","institution":"Jomo Kenyatta University of Agriculture and Technology","correspondingAuthor":false,"prefix":"","firstName":"Ronald","middleName":"Waweru","lastName":"Mwangi","suffix":""},{"id":553426692,"identity":"a9d1a67c-213f-4020-91a4-85c849b3d7e5","order_by":2,"name":"Petronilla Muthoni Muriithi","email":"","orcid":"","institution":"Jomo Kenyatta University of Agriculture and Technology","correspondingAuthor":false,"prefix":"","firstName":"Petronilla","middleName":"Muthoni","lastName":"Muriithi","suffix":""}],"badges":[],"createdAt":"2025-11-26 11:23:27","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-8212332/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-8212332/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":97669459,"identity":"644c9148-b11f-48f2-8cc5-c9690e130828","added_by":"auto","created_at":"2025-12-08 09:28:01","extension":"docx","order_by":0,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":404256,"visible":true,"origin":"","legend":"","description":"","filename":"IvanManuscriptUpdated4.docx","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/2fc6891cbe0f49cb7958aab9.docx"},{"id":97498856,"identity":"9038e1cb-901c-473c-a04c-92e668e6dbc0","added_by":"auto","created_at":"2025-12-05 05:38:15","extension":"json","order_by":1,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":5824,"visible":true,"origin":"","legend":"","description":"","filename":"11bc4cde9a9e48a7be495be65a23a715.json","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/b66473c00ca7ed0662eb5648.json"},{"id":97498894,"identity":"ea8b9bde-8f71-4048-8d2a-9fb7ac7b53b2","added_by":"auto","created_at":"2025-12-05 05:38:18","extension":"xml","order_by":2,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":144821,"visible":true,"origin":"","legend":"","description":"","filename":"11bc4cde9a9e48a7be495be65a23a7151enriched.xml","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/21ad407c411aff8e34d36d78.xml"},{"id":97498895,"identity":"1e78c684-6fb3-4a35-8e5d-149620a242be","added_by":"auto","created_at":"2025-12-05 05:38:19","extension":"jpeg","order_by":3,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":56582,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage1.jpeg","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/80369dcd3648509d6242c589.jpeg"},{"id":97498893,"identity":"4019d071-5921-4f2a-a33c-e142dcae792b","added_by":"auto","created_at":"2025-12-05 05:38:18","extension":"png","order_by":4,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":126383,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/cb4617d7dc5430cbdc25c4c6.png"},{"id":97498891,"identity":"82d3a79f-f0f8-4e4c-b861-1b7e9d98587d","added_by":"auto","created_at":"2025-12-05 05:38:18","extension":"png","order_by":5,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":30676,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage3.png","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/4f110ddd5c4f2f58aec83264.png"},{"id":97498840,"identity":"039a88d5-3f80-4b7f-8ec8-249cd7f4a327","added_by":"auto","created_at":"2025-12-05 05:38:15","extension":"png","order_by":6,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":17347,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage4.png","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/3379d014c0202c0c3c682957.png"},{"id":97498854,"identity":"ae3858be-6a55-4a90-91eb-4aa3fb0d1305","added_by":"auto","created_at":"2025-12-05 05:38:15","extension":"png","order_by":7,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":29225,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage5.png","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/ea68b0101fd399c944355669.png"},{"id":97498885,"identity":"cf1cfe3a-1b30-4735-85ee-508d5aeb56af","added_by":"auto","created_at":"2025-12-05 05:38:16","extension":"png","order_by":8,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":93661,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage6.png","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/790cba4ce41a2d1c05ed3046.png"},{"id":97498836,"identity":"b3ebeabb-3d9d-4b45-8653-4583dfefcd79","added_by":"auto","created_at":"2025-12-05 05:38:14","extension":"png","order_by":9,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":10544,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/9e7d538835146bc97a7c69df.png"},{"id":97498872,"identity":"cdcc2fb2-1e99-4a82-a39c-400e9270ffe9","added_by":"auto","created_at":"2025-12-05 05:38:16","extension":"png","order_by":10,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":48222,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/1e23a69c350d64d7cc293908.png"},{"id":97498850,"identity":"ec716e96-b240-4927-8983-4deb96594217","added_by":"auto","created_at":"2025-12-05 05:38:15","extension":"png","order_by":11,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":8141,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage3.png","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/f2c6e1f60df40528dceb30c6.png"},{"id":97498877,"identity":"3ab38293-60f9-4ad6-b525-deec06662b73","added_by":"auto","created_at":"2025-12-05 05:38:16","extension":"png","order_by":12,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":5990,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage4.png","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/1ff7d20dcf002bd02bd06fde.png"},{"id":97498824,"identity":"e17406df-9e34-42e2-ae8e-490e9a164cde","added_by":"auto","created_at":"2025-12-05 05:38:14","extension":"png","order_by":13,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":8947,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage5.png","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/59b7c0f10c82eb1362aa00eb.png"},{"id":97498881,"identity":"b7feb33d-bbc1-4aa0-905d-05f5808d88c6","added_by":"auto","created_at":"2025-12-05 05:38:16","extension":"png","order_by":14,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":24827,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage6.png","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/72eee1c72949e92c3aaa87da.png"},{"id":97498842,"identity":"a0d304c4-f867-49b5-acf6-6c9985fc6440","added_by":"auto","created_at":"2025-12-05 05:38:15","extension":"xml","order_by":15,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":144197,"visible":true,"origin":"","legend":"","description":"","filename":"11bc4cde9a9e48a7be495be65a23a7151structuring.xml","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/150ed19bb16ea03704dc34c3.xml"},{"id":97498823,"identity":"7dd8f93d-8419-4e37-a942-9bbddb8a9cdb","added_by":"auto","created_at":"2025-12-05 05:38:14","extension":"html","order_by":16,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":158446,"visible":true,"origin":"","legend":"","description":"","filename":"earlyproof.html","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1/c1e08a4f699bff6a0c41170e.html"},{"id":97677752,"identity":"c218af90-186a-47e5-afb2-bec390da112d","added_by":"auto","created_at":"2025-12-08 09:54:23","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":667161,"visible":true,"origin":"","legend":"","description":"","filename":"IvanManuscriptUpdated4.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8212332/v1_covered_1270b71c-3b80-4820-93b6-71bfce68a5c8.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Nonlinear Optimization of Recurrent Neural Networks in the Prediction of Air Quality","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":false,"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":"discover-artificial-intelligence","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"diai","sideBox":"Learn more about [Discover Artificial Intelligence](https://www.springer.com/44163)","snPcode":"","submissionUrl":"","title":"Discover Artificial Intelligence","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"stoa","reportingPortfolio":"Discover Series","inReviewEnabled":true,"inReviewRevisionsEnabled":true},"keywords":"Air Quality Prediction, Long Short-Term Memory (LSTM), Nonlinear Optimization, PM2.5 Forecasting, Machine Learning","lastPublishedDoi":"10.21203/rs.3.rs-8212332/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-8212332/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eAmbient air pollution remains a major threat to public health, particularly in low- and middle-income countries where monitoring infrastructure is often limited. Fine particulate matter (PM2.5) is of particular concern due to its strong association with respiratory and cardiovascular diseases. This study presents a nonlinear optimization framework designed to enhance the predictive performance of Long Short-Term Memory (LSTM) networks in forecasting PM2.5 concentrations. Using a large-scale dataset of more than 506,000 hourly air quality observations collected across Uganda, the proposed model integrates a constrained nonlinear optimization mechanism into the LSTM architecture. This approach reduces overfitting, improves generalization, and provides a theoretically grounded solution to recurrent neural network instability. Experimental results show that the model achieved a Mean Squared Error (MSE) of 0.5968, a Mean Absolute Error (MAE) of 0.5276, and a coefficient of determination (R\u0026sup2;) of 0.1875. Feature importance analysis indicated that PM10, carbon dioxide (CO₂), and humidity were the most influential predictors of PM2.5 concentrations. The model successfully captured long-term pollutant trends and seasonal variations, but it underestimated extreme pollution events, suggesting the potential value of ensemble strategies and cost-sensitive learning for improving sensitivity to peaks. Despite these limitations, the findings underscore the viability of integrating nonlinear optimization techniques within deep learning frameworks to achieve more robust and stable predictions. Importantly, this work contributes to advancing air quality forecasting in resource-constrained environments and provides a methodological foundation for future studies that aim to incorporate broader environmental and socio-economic factors.\u003c/p\u003e","manuscriptTitle":"Nonlinear Optimization of Recurrent Neural Networks in the Prediction of Air Quality","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-12-05 05:38:08","doi":"10.21203/rs.3.rs-8212332/v1","editorialEvents":[{"type":"communityComments","content":0},{"type":"decision","content":"Revision requested","date":"2025-12-22T14:03:05+00:00","index":"","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2025-12-17T19:48:59+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"37727230846849843468210405438750234893","date":"2025-12-17T11:29:21+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2025-12-17T09:14:12+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"244656455660538278456697426200293915269","date":"2025-12-12T06:41:24+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2025-12-07T08:02:03+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"241664753543969164461461460229784628317","date":"2025-12-01T12:53:43+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2025-12-01T11:43:04+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"209954045978252541022783467822890951841","date":"2025-12-01T11:39:37+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"102719076868787013930215743898131307057","date":"2025-12-01T11:18:22+00:00","index":"hide","fulltext":""},{"type":"reviewersInvited","content":"","date":"2025-12-01T09:59:49+00:00","index":"","fulltext":""},{"type":"editorInvited","content":"","date":"2025-12-01T09:06:46+00:00","index":"","fulltext":""},{"type":"editorAssigned","content":"","date":"2025-11-27T06:18:27+00:00","index":"","fulltext":""},{"type":"checksComplete","content":"","date":"2025-11-27T06:16:44+00:00","index":"","fulltext":""},{"type":"submitted","content":"Discover Artificial Intelligence","date":"2025-11-26T11:14:44+00:00","index":"","fulltext":""}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"discover-artificial-intelligence","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"diai","sideBox":"Learn more about [Discover Artificial Intelligence](https://www.springer.com/44163)","snPcode":"","submissionUrl":"","title":"Discover Artificial Intelligence","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"stoa","reportingPortfolio":"Discover Series","inReviewEnabled":true,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"ec4decea-34fc-405e-8fdb-1494fa57d246","owner":[],"postedDate":"December 5th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"under-review","subjectAreas":[],"tags":[],"updatedAt":"2026-05-20T10:53:41+00:00","versionOfRecord":[],"versionCreatedAt":"2025-12-05 05:38:08","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-8212332","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-8212332","identity":"rs-8212332","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.