In this article, we propose the approach to structural optimization of neural networks, based on the braid theory. The paper describes the basics of braid theory as applied to the description of graph structures of neural networks. It is shown how networks of various topologies can be built using braid structures between layers of neural networks. The operation of a neural network based on the braid theory is compared with a homogeneous deep neural network and a network with random intersections between layers that do not correspond to the ordering of the braids. Results are obtained showing the advantage of braid-based networks over comparable architectures in classification problems.