Fundus images are a non-invasive imaging modality that is typically used by ophthalmologists to assess the retina. They are widely applied for detecting diabetic retinopathy (DR) and glaucoma, which are leading causes of preventable blindness in the world. In this thesis we contribute with novel tools for automated fundus image analysis based on machine learning. First, we propose a vessel segmentation method based on learning fully connected conditional random elds using structured output support vector machines. This approach allows to recover accurate segmentations of the retinal vasculature that are afterwards applied in the context of two deep learning based techniques for glaucoma and DR detection. For automated glaucoma assessment, we propose to transfer convolutional neural networks (CNNs) that were pre-trained using non-medical data. Images are adapted using state of the art preprocessing methods before feeding the CNNs, and the extracted features are used to train regularized logistic regression classi ers, achieving results that are competitive with other methods. For DR screening, we introduce a red lesion detection approach based on hybridizing deep learned and hand crafted features. A Random Forest classi er is trained on these features to identify true lesion candidates, reporting state of the art performance in benchmark data sets.