Weakly supervised learning for pattern classification in serial femtosecond crystallography