The methods of Bayesian statistics are used to extract the value of the proton radius from the elastic $ep$ scattering data in a model-independent way. To achieve that goal a large number of parametrizations (equivalent to neural network schemes) are considered and ranked by their conditional probability $P(\mathrm{parametrization}\phantom{\rule{0.16em}{0ex}}|\phantom{\rule{0.16em}{0ex}}\mathrm{data})$ instead of using the minimal error criterion. As a result the most probable proton radii values $({r}_{E}^{p}=0.899\ifmmode\pm\else\textpm\fi{}0.003$ fm, ${r}_{M}^{p}=0.879\ifmmode\pm\else\textpm\fi{}0.007$ fm) are obtained and systematic error due to freedom in the choice of parametrization is estimated. Correcting the data for the two-photon-exchange effect leads to smaller differences between the extracted values of ${r}_{E}^{p}$ and ${r}_{M}^{p}$. The results disagree with recent muonic atom measurements.