Rewards-based image analysis in microscopy