The optical sorting machine can be integrated in the cleaning flow diagram of wheat mills. Depending on the mill’s requirements in terms of cleaning capacity, availability of space and efficiency of existing mechanical cleaning equipment, the optical sorting machines can be integrated in the first cleaning section as well as in the second cleaning section. The optical sorting machine can be integrated along with the existing machineries or instead of certain cleaning machines such as spiral separator and indented cylinders.