Machine-learning segmentation (right) identified patterns formed by different micelle types and chemistries, revealing how the approach could lead to UF membranes that sort by chemical affinity.