  The atomic force microscope (AFM) is a versatile, high-resolution tool used
to characterize the topography and material properties of a large variety of
specimens at nano-scale. The interaction of the micro-cantilever tip with the
specimen causes cantilever deflections that are measured by an optical sensing
mechanism and subsequently utilized to construct the sample topography. Recent
years have seen increased interest in using the AFM to characterize soft
specimens like gels and live cells. This remains challenging due to the complex
and competing nature of tip-sample interaction forces - large tip-sample
interaction force is necessary to achieve good signal-to-noise ratios; However,
large force tends to deform and destroy soft samples. In situ estimation of the
local tip-sample interaction force is needed to control the AFM cantilever
motion and prevent destruction of soft samples while maintaining a good
signal-to-noise ratio. This necessitates the ability to rapidly estimate the
tip-sample forces from the cantilever deflection during operation. This paper
proposes a first approach to a near real-time framework for tip-sample force
inversion. We pose the inverse problem of extracting the tip-sample force as an
unconstrained optimization problem. A fast, parallel forward solver is
developed by utilizing graphical processing units (GPU). This forward solver
shows an effective 30000 fold speed-up over a comparable CPU implementation,
resulting in milli-second calculation times. The forward solver is coupled with
a GPU based particle-swarm optimization implementation. We illustrate the
framework on three classes of tip-sample interaction inversions. Each of these
inversions is performed in sub-second timings, showing potential for
integration with on-line AFM imaging and material characterization
