We demonstrate a novel closed-loop input design technique on the detection of particles in an imaging system such as a fluorescence microscope. The probability of misdiagnosis is minimized while constraining the input energy such that for instance phototoxicity is reduced. The key novelty of the closed-loop design is that each next input is designed based on the most recent information. Using updated hypothesis probabilities, the input energy distribution is optimized for detection such that unresolved pixels have increased illumination next image acquisition. As compared to conventional open-loop, the results show that (regions of) particles are diagnosed using less energy in the closed-loop approach. Besides the closed-loop approach being viable for particle detection in fluorescence microscopy measurements, it can be developed further to apply in different areas such as sequential object segmentation for reliable and efficient product inspection in Industry 4.0.