Unlike conventional multiphoton microscopy according to pixel by pixel point scanning, a widefield multiphoton microscope based on spatiotemporal focusing has been developed to provide fast optical sectioning images at a frame rate over 100 Hz. In order to overcome the aberrations of the widefield multiphoton microscope and the wavefront distortion from turbid biospecimens, an image-based adaptive optics system (AOS) was integrated. The feedback control signal of the AOS was acquired according to locally maximize image intensity, which were provided by the widefield multiphoton excited microscope, by using a hill climbing algorithm. Then, the control signal was utilized to drive a deformable mirror in such a way as to eliminate the aberration and distortion. A R6G-doped PMMA thin film is also increased by 3.7-fold. Furthermore, the TPEF image quality of 1 μm fluorescent beads sealed in agarose gel at different depths is improved.