A machine-learning tool to identify bistable states from calcium imaging data