With the development of terahertz band applications, terahertz devices have also been extensively studied. Terahertz band biosensors are widely used in biomedical micro detection, but the problems of terahertz spectrum prediction and structural design are complex and time-consuming. This article proposes an efficient deep learning method to replace traditional electromagnetic simulation and apply it to the inverse design of terahertz metasurface biosensors. Deep learning is divided into two parts, forward design and inverse design. The forward design is composed of a feedforward neural network(FNN) that can quickly predict spectral response based on input structural parameters. The trained FNN provides a large number of training samples for inverse design. The inverse design includes feature transformer neural network(FTNN) and generator neural network(GNN), FTNN outputs spectral response based on input performance indicators, and GNN outputs geometric structural parameters based on input spectral response. This inverse design uses spectral response as an intermediate medium to achieve input performance indicators and output geometric structural parameters, enabling on-demand design of terahertz metasurface biosensors. The test results show that the proposed design scheme based on deep learning methods can output appropriate structural parameters according to the required frequency and bandwidth of the analyte. The output structural parameters were simulated and verified using electromagnetic simulation software, and the simulation results were consistent with the predicted results. This method of replacing electromagnetic simulation with neural networks can be applied to the spectral prediction and design problem research of terahertz devices, providing more possibilities for the future application of terahertz devices.