In the present paper, a new approach to identifying an arbitrary number of inclusions, their geometry and their location in 2D and 3D structures using topological optimization was proposed. The new approach was based on the lack of initial information about the geometry of the inclusions and their location in the structure. The numerical solutions were obtained by the finite element method in combination with the method of moving asymptotes. The convergence of the finite element method at the coincidence of functions and their derivatives was analyzed. Results with an error of no more than 0.5%, i.e., almost exact solutions, were obtained. Identification at impact on the plate temperature and heat flux by solving the inverse problem of heat conduction was produced. Topological optimization for identifying an arbitrary number of inclusions, their geometry and their location in 2D problems was investigated.