The final loss function in the deep learning neural network is composed of other functions in the network. Due to the existence of a large number of non-linear functions such as activation functions in the network, the entire deep learning model presents the nature of a nonconvex function. As optimizing the nonconvex model is more difficult, the solution of the nonconvex function can only represent the local but not the global. The BP algorithm is an algorithm for updating parameters and is mainly applied to deep neural networks. In this article, we will study the volume holographic image library technology, design the basic optical storage path, realize single-point multistorage in the medium, and multiplex technology with simple structure to increase the information storage capacity of volume holography. We have studied a method to read out the holographic image library with the same diffraction efficiency. The test part of the system is to test the entire facial image pattern recognition system. The reliability and stability of the system have been tested for performance and function. Successful testing is the key to the quality and availability of the system. Therefore, this article first analyzes the rules of deep learning, combines the characteristics of image segmentation algorithms and pattern recognition models, designs the overall flow chart of the pattern recognition system, and then conducts a comprehensive inspection of the test mode to ensure that all important connections in the system pass through high-quality testing is guaranteed. Then in the systematic research of this paper, based on the composite threshold segmentation method of histogram polynomial fitting and the deep learning method of the U-NET model, the actual terahertz image is cut, and the two methods are organically combined to form terahertz. The coaxial hologram reconstructs the image for segmentation and finally completes the test of the system. After evaluation, the performance of the system can meet the needs of practical applications.