Contact electrograms (EGMs) can be used to guide atrial fibrillation ablation, however, our understanding of the correlation of electrophysiology (EP) to the underlying myocardial substrate is limited, therefore success rates are low even for EGM-guided procedures. We use neural networks to estimate the amount of collagen (extracellular component of scar) - and thus the effective conductivity - within the field of view of an electrode, from the EGM signal, in rat myocardial slices. We also detect the features of EGMs that the networks identify as important for the estimation. EGMs were recorded from rat ventricular slices (n=15) using a multi-electrode array (36 electrodes). Following EP measurements, samples were imaged using second harmonic generation (SHG) microscopy, allowing for localization and quantification of collagen. The EGM time series were paired with the normalized amount of collagen in the location of their respective electrodes. A convolutional network (1D-ResNet) was trained on the paired data, to correlate EGMs and collagen distribution. One sample consists of an EGM for one cycle length, paired with the normalized amount of collagen in the respective location of the electrode. The total sample number was 123552. Testing electrodes are randomly chosen from several slices. The normalized (between 0.0 and 1.0) true collagen quantity in the testing set has a mean of 0.57, and the average root mean square error (RMSE) in the testing set is 0.15, with a correlation coefficient of R=0.81 between the predicted and true collagen amount, successfully estimating normalized collagen quantities with an absolute error of 0.02. The network identifies the variation in the QRS, as well as cases of fractionation, as useful features for quantifying collagen underneath the electrode. This work provided the framework and proof of concept that location of scar can be predicted from EGMS using neural networks.