It is known that curved beams are used widely in vibration isolation and noise reduction. The curved beam can show bistable, negative stiffness and other mechanical characteristics in the compression process through design. The preflex beam absorbs energy during the multi-state jump process and can recover its initial configuration after undergoing loading and unloading, so it is an ideal energy absorb component. In this paper, preflex beams are designed and the mechanical properties are studied and predicted by neural network. Firstly, a large number of finite element models for sinusoidal preflex beams are built by using Python randomly selected the parameters of beams. Secondly, the dataset corresponding to the parameters of the beams and mechanical properties is established. The variation trend of mechanical properties such as initial stiffness, force threshold, negative stiffness and total absorbed energy with the change of structural parameters and the sensitivity of structural parameters to the above mechanical indexes are obtained. Thirdly, by substituting the data set into the artificial neural network, the trained neural network can predict the mechanical properties of the beams within the allowable error range. At last, a new type of preflex beam with porous section is proposed in order to optimize the specific absorbed energy of the preflex beam. After data screening and optimization, the specific absorbed energy of the porous preflex beam is increased by 15.56 % compared with the beam whose section without porous. The results obtained show that the data-driven method can greatly shorten the structural design time and expand the design space. This study will provide a theoretical basis for the wider application of preflex beams in engineering field.