Context-aware learning for finite mixture models