Traditional Martian bow shock and magnetic pileup (magnetopause) boundary models are based on the fitting of free parameters in a prescribed formula. The form of the formula, fitted data, and considered controlling parameters distinguish the individual models from each other. However, all these models have one thing in common: the shape of the boundary and the parametric dependence assumed are fixed by the prescribed formula. The fitted data set typically consists of individual identified boundary crossings. This approach can suffer from a significant bias, as the boundary crossings are more likely to be identified in regions where a spacecraft spends more time. In this study, we use an automated region classification of the data measured by the Mars Atmosphere and Volatile EvolutioN (MAVEN) spacecraft to solar wind, magnetosheath, or magnetosphere. This is achieved by applying the Support Vector Machine method to individual spacecraft half-orbits (from periapsis to apoapsis or vice versa). Two different models of the locations of the bow shock and magnetic pileup boundaries are then constructed based on neural networks: i) a model trained using the classified data, and ii) a model trained using individual identified boundary crossings. As compared to formal empirical modeling efforts, the neural network models do not assume any prescribed shape/distance formula. Optimal model parameterization (considering the solar wind dynamic pressure, solar ionizing flux, crustal magnetic field magnitude, Alfvén Mach number, and interplanetary magnetic field magnitude) is discussed and the model performance evaluated.