A variable template matching algorithm for anomaly detection versus kernel density and gradient convolution algorithms and ResNet-50 | 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 A variable template matching algorithm for anomaly detection versus kernel density and gradient convolution algorithms and ResNet-50 Qinwu Xu This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-4612382/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 This study first proposes a variable template matching algorithm for anomaly detection of images. Variational forms of template for defect with multiple scales, rotations and perspective transformations are included to improve its variational robustness. The normalized cross correlation between the template and the sliding window on the image is computed as the matching result. Secondly, it proposes a kernel density algorithm, in which a lower kernel density index (intensity percentile/range) of the sliding window indicates a potential anomaly. Lastly, it proposes a gradient convolution algorithm. These three traditional computer vision algorithms are implemented for anomaly detection of a group of biological images, and results are compared with that of the convolutional neural network ResNet-50. Results show that the variable template matching algorithm achieves superior performance (true positive 82% and false positive 4.9%) than both the kernel density and gradient convolution algorithms. Its detection rate is lower than the prediction of ResNet-50 (true positive 86%), but it is much faster and does not need any train images as an unsupervised learning. Therefore, it can be a potential candidate for object detection of small dataset or for a quick solution. Artificial Intelligence and Machine Learning Variable template matching normalized cross correlation kernel density binary classification anomaly detection biology images. 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-4612382","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":316925598,"identity":"6c54ef87-1e43-42ac-906a-1f70a2e524ed","order_by":0,"name":"Qinwu Xu","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAwElEQVRIiWNgGAWjYDACZijNz8DARqIWyQaitcCAwQFitfAd5z0mzcNwOHHzjeRnDz5UMMjzix3Ar0XyMF8aUEta4rYbaeaGM84wGM6cnUDAPYd5zG7zMNgAtSSYSfO2MSQY3CZOi0Ti5hnp30jSYpO4QSKHSFskD/OY/5xjkGY848ybMskZZyQI+4Xv/BljgzcVh2X729O3SXyosJHnlyagheEA2HlALABWKUFAOVwLCPAfwK1oFIyCUTAKRjYAAL92PbvtDApQAAAAAElFTkSuQmCC","orcid":"","institution":"Corning Research and Development Corporation","correspondingAuthor":true,"prefix":"","firstName":"Qinwu","middleName":"","lastName":"Xu","suffix":""}],"badges":[],"createdAt":"2024-06-20 14:19:54","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-4612382/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-4612382/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":58788263,"identity":"0eafa792-5bf5-4e21-ba6c-20680b494f52","added_by":"auto","created_at":"2024-06-21 06:40:54","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":859825,"visible":true,"origin":"","legend":"","description":"","filename":"Avariabletemplatematchingmethodforobjectdetectionv2.pdf","url":"https://assets-eu.researchsquare.com/files/rs-4612382/v1_covered_8424f90e-c8cc-4b20-86b0-7a67dd696c3d.pdf"}],"financialInterests":"The authors declare no competing interests.","formattedTitle":"\u003cp\u003eA variable template matching algorithm for anomaly detection versus kernel density and gradient convolution algorithms and ResNet-50\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":"Variable template matching, normalized cross correlation, kernel density, binary classification, anomaly detection, biology images.","lastPublishedDoi":"10.21203/rs.3.rs-4612382/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-4612382/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eThis study first proposes a variable template matching algorithm for anomaly detection of images. Variational forms of template for defect with multiple scales, rotations and perspective transformations are included to improve its variational robustness. The normalized cross correlation between the template and the sliding window on the image is computed as the matching result. Secondly, it proposes a kernel density algorithm, in which a lower kernel density index (intensity percentile/range) of the sliding window indicates a potential anomaly. Lastly, it proposes a gradient convolution algorithm. These three traditional computer vision algorithms are implemented for anomaly detection of a group of biological images, and results are compared with that of the convolutional neural network ResNet-50. Results show that the variable template matching algorithm achieves superior performance (true positive 82% and false positive 4.9%) than both the kernel density and gradient convolution algorithms. Its detection rate is lower than the prediction of ResNet-50 (true positive 86%), but it is much faster and does not need any train images as an unsupervised learning. Therefore, it can be a potential candidate for object detection of small dataset or for a quick solution.\u003c/p\u003e \u003cp\u003e \u003c/p\u003e \u003cp\u003e \u003c/p\u003e","manuscriptTitle":"A variable template matching algorithm for anomaly detection versus kernel density and gradient convolution algorithms and ResNet-50","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2024-06-21 06:32:46","doi":"10.21203/rs.3.rs-4612382/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":"a1ba6afa-9b23-47bd-a968-55e4b8b8a4bc","owner":[],"postedDate":"June 21st, 2024","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[{"id":33513246,"name":"Artificial Intelligence and Machine Learning"}],"tags":[],"updatedAt":"2024-06-21T06:32:47+00:00","versionOfRecord":[],"versionCreatedAt":"2024-06-21 06:32:46","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-4612382","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-4612382","identity":"rs-4612382","version":["v1"]},"buildId":"qtupq5eGEP_6zYnWcrvyt","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.