An automated algorithm to extract features from retinal fundus image to detect diabetic retinopathy and assess its severity using deep learning