The simultaneous recording of electroencephalogram (EEG) and functional magnetic resonance imaging (fMRI) can give new insights into how the brain functions. However, the strong electromagnetic field of the MR scanner generates artifacts that obscure the EEG and diminish its readability. Among them, the ballistocardiographic artifact (BCGa) that appears on the EEG is believed to be related to blood flow in scalp arteries leading to electrode movements. Average artifact subtraction (AAS) techniques, used to remove the BCGa, assume a deterministic nature of the artifact. This assumption may be too strong, considering the blood flow related nature of the phenomenon. In this work we propose a new method, based on canonical correlation analysis (CCA) and blind source separation (BSS) techniques, to reduce the BCGa from simultaneously recorded EEG-fMRI. We optimized the method to reduce the user's interaction to a minimum. When tested on six subjects, recorded in 1.5 T or 3 T, the average artifact extracted with BSS-CCA and AAS did not show significant differences, proving the absence of systematic errors. On the other hand, when compared on the basis of intra-subject variability, we found significant differences and better performance of the proposed method with respect to AAS. We demonstrated that our method deals with the intrinsic subject variability specific to the artifact that may cause averaging techniques to fail.