The basic idea of twice genetic algorithm optimization of BP neural network model(TGB)is rough selection network model using genetic algorithm, then use BP neural network to determine the parameters which can make the error function obtained the minimum and determine its position in the parameter space, then the genetic algorithm again to solve the problem of possible local minima.Feature selection is a new formulation of dimension reduction methods. It can simplify the size of neural network and improve real-time and the accuracy of the system.The simulation results TGB-based network intrusion detection algorithm improve intrusion detection rate of samples in different degrees. It can reduce significantly training time and test time. It further demonstrates the effectiveness and feasibility of this method. The study is very useful to detect materials. So from the analysis, you can learn some skills for materials detecting.