Barycentric-alignment and invertibility for domain generalization