To detect damage to the underground pipeline, a mathematical model, allowing to take into account the most significant Factors affecting the distribution of temperature on the day surface. To implement this model, a software package has been developed and results of numerical calculations. With the help of these calculations, in particular, It is established that modern thermal imaging equipment has a principal possibility to determine an unauthorized frame in the main pipeline at a depth of two meters in clay soil.