Optical food sorting machines target the removal of unwanted products from a product flow, benefitting food safety and quality by detecting foreign objects, bruised products and harmful elements. Vrije Universiteit Brussel (VUB) and Warsaw University of Technology (WUT) performed a spectroscopic study optimizing the illumination and detection parameters for nut sorting. VUB subsequently worked on an improved illumination lens design.