refactor to handle huge training set (1.2M images)