We present the first steps of a search for high-energy (> 1 PeV) gamma rays in archival data of the KASCADE experiment. With the data collected from 1996 to 2013 the KASCADE statistics is comparable with that of modern observatories. The data is provided by the KASCADE Cosmic ray Data Center (KCDC) and publicly available. We employ methods of machine learning to distinguish between air showers produced by hadronic and gamma-ray primaries. For that we design primary particle type classifiers and train them with the KASCADE Monte-Carlo simulations. We compare results of several deep learning methods: a graph neural network, a self-attention network and a compact convolutional transformer. The level of hadronic background
suppression with respect to gamma-ray signal in the best of these methods exceeds that of the original KASCADE method by more than an order of magnitude.