We propose a Bayesian method to select the rank of the coefficients of the random effects in a spatial mixed effects model. Specifically, we model Gaussian data using both covariates and wavelet basis functions. The first step in our methodology selects the number of wavelets using the deviance information criterion (DIC), which is a well-established approach for selecting the number of basis functions. It is possible to see large sampling variability in the selected rank, and the DIC is known to favor more complex models over parsimonious models. To address these issues, we create a neural network that bridges the latent process, defined using the DIC selected rank, with the latent process defined on any other rank. The second stage of our algorithm involves the use of DIC on each node of the neural network. In addition to bypassing the over-selection tendency of DIC, the proposed method also improves the estimation of the true rank of the basis functions with few computations. We consider both a one- and two-dimensional wavelet bases in the spatial setting.