The Foveola shape recognition engine started life as a neurophysiology thesis (not mine) and accompanying Excel spreadsheet-based implementation (yes, really.)
My task of converting it to a proper industrial-strength software library involved extending both the model and the actual analytic engine. More significantly, it involved developing an abstraction for representing, manipulating and comparing the analysed shapes. (The original encoding method used in the thesis had a fundamental flaw, and had to be abandoned.)
The shape representation scheme I developed for Foveola is the “purest”, most elegant piece of conceptual design I’ve ever created in a piece of software. (Writing code is generally a more mundane combination of plumbing, book-keeping and piano-tuning.) Developing it gave me a little taste of how pure mathematicians must experience their creativity.