A material network consisting of discrete material nodes and their interactions can represent complex microstructure responses. Under this interaction viewpoint, the material network can be viewed as a trainable system involving fitting parameters including not only the weights of the material nodes but also the parameters characterizing their interactions. As opposed to the other existing works, this interaction-based material network does not rely on the micromechanics of multiple-phase laminates but on constraining all requirements of a truly microscopic boundary value problem including the stress and strain averaging principles and the Hill-Mandel energetically consistent condition. Consequently, the proposed framework can be applied to microstructures with the presence of voids, which is not achievable with the laminate theory. To make a material network become a surrogate of a full-field microscopic model, this work proposes two different training procedures to calibrate its fitting parameters. On the one hand, a nonlinear training procedure is proposed considering sequential data collected from finite element simulations on the full-field model subjected to proportional loading paths. On the other hand, a linear elastic training procedure considers only the elastic response of the heterogeneous material. The accuracy and efficiency of the proposed framework for microstructures with the presence of voids are demonstrated by comparing the predictions of the trained material networks with the ones of the direct numerical simulations in both contexts of virtual testing and multiscale simulations. It is also shown that the linear elastic training procedure requires a lower computational cost but could lead to less accurate predictions in comparison with the nonlinear training procedure.