  [Abridged] Although galaxies are found to follow a tight relation between
their star formation rate and stellar mass, they are expected to exhibit
complex star formation histories (SFH), with short-term fluctuations. The goal
of this pilot study is to present a method that will identify galaxies that are
undergoing a strong variation of star formation activity in the last tens to
hundreds Myr. In other words, the proposed method will determine whether a
variation in the last few hundreds of Myr of the SFH is needed to properly
model the SED rather than a smooth normal SFH. To do so, we analyze a sample of
COSMOS galaxies using high signal-to-noise ratio broad band photometry. We
apply Approximate Bayesian Computation, a state-of-the-art statistical method
to perform model choice, associated to machine learning algorithms to provide
the probability that a flexible SFH is preferred based on the observed flux
density ratios of galaxies. We present the method and test it on a sample of
simulated SEDs. The input information fed to the algorithm is a set of
broadband UV to NIR (rest-frame) flux ratios for each galaxy. The method has an
error rate of 21% in recovering the right SFH and is sensitive to SFR
variations larger than 1 dex. A more traditional SED fitting method using
CIGALE is tested to achieve the same goal, based on fits comparisons through
Bayesian Information Criterion but the best error rate obtained is higher, 28%.
We apply our new method to the COSMOS galaxies sample. The stellar mass
distribution of galaxies with a strong to decisive evidence against the smooth
delayed-$\tau$ SFH peaks at lower M* compared to galaxies where the smooth
delayed-$\tau$ SFH is preferred. We discuss the fact that this result does not
come from any bias due to our training. Finally, we argue that flexible SFHs
are needed to be able to cover that largest SFR-M* parameter space possible.
