We present a non-destructive beam profile imaging concept that utilizes machine learning tools, namely genetic algorithm with a gradient descent-like minimization. Electromagnetic fields around a charged beam carry information about its transverse profile. The electrodes of a stripline-type beam position monitor (with eight probes in this study) can pick up that information for visualization of the beam profile. We use a genetic algorithm to transform an arbitrary Gaussian beam in such a way that it eventually reconstructs the transverse position and the shape of the original beam. The algorithm requires a signal that is picked up by the stripline electrodes, and a (precise or approximate) knowledge of the beam size. It can visualize the profile of fairly distorted beams as well.