Is it possible to classify songs by genres based on spectrograms?
It is possible to use spectrograms for genres classification. See relevant articles Music genre recognition using spectrograms or blog post here. The later link did use CNN for this task. 

If you need training data, GTZAN or FMA could be your starting point.