Proton imaging promises to produce accurate relative stopping power (RSP) maps crucial for particle therapy treatment planning. However, secondary particles produced in the proton nuclear interactions with the medium increase detector noise, creating artifacts in the tomographic reconstruction. A Bayesian most-likely generating process (MLGP) model is developed to predict the generating-process/particle pair producing each event measured on the detector. In the MLGP, the measurements are generated from one of N models representing electromagnetic/nuclear processes. First, a likelihood model is constructed for each process. The flag q_i in [0, N] relates the i-th measurement to one of the models. The likelihood of a measurement originating from a given process is extracted from the process model. The MLGP posterior is the product of these likelihoods over all particles with a prior estimated from the expected production-ratio of each process. The set of flags is modified iteratively to maximize the MLGP posterior, relating the most-likely particle/process to each measurement. The MLGP is compared to the 3sigma filter. To validate the MLGP, proton and helium ions are simulated (n=10^6, 330 MeV/u) crossing a water tank and an abdomen phantom. For protons, both in the water tank and the abdomen, the 3sigma filter has a successful identification rate lower (93%) than the MLGP (96%). For helium, in both phantom the 3sigma filter does not identify secondaries accurately (<56% real positives) compared to the MLGP (95%). In addition, the MLGP allows to identify a fraction of the secondaries (>29%) as protons, deuteron, tritium and ^3He. The higher rate of true identifications compared to the 3sigma method shows that the MLGP is a prime candidate for filtering in particle imaging, paving the way for higher precision particle imaging. Furthermore, the classification of secondaries is encouraging for future applications, e.g. dose recuperation and nuclear cross-section tomography.