Use of STAN for polarimetric imaging of tissue with application to cancer imaging

Dear STAN community,

I am researcher in engineering developing new types of endoscopes with application to improving detection of cancer. Recently, I developed an endoscope that images polarimetric properties of samples, i.e. how they interact with polarised light. Mathematically speaking, I needed to perform a matrix factorisation but my input data was noisy and contained nasty spatially varying artefacts. I was introduced to Stan by a friend working at Google and I used it to write a Bayesian model that considered joint probabilities of groups of neighbouring pixels and used priors for some of the parameters that made physical sense for the type of sample (e.g. that tissue samples tend not to exhibit high levels of linear or circular diattenuation). Running this model to extract the maximum likelihood solution at each pixel I was able to produce clean, clear images. Effectively I was implementing a type of spatial smoothing across the factorised matrix components. Some of the parameters I was estimating were angles and so were circular in nature (von Mises distributed) but this was not a problem for Stan which has this distribution built in. Looking back, I don’t know how I would possibly have solved this difficult image processing problem without using Stan! Just thought I would post here because it seems to be an interesting physics/optics application of Stan.

The paper is available on the arXiv if anyone is interested ( and I’d be happy to share the code. I ended up using the MATLAB interface to Stan, but have recently begun experimenting with the Python interface.

Thanks again for developing Stan - I hope to use it in future for fitting models to physical data and inferring parameters.