Structures made of heterogeneous materials, such as composites, often require a multiscale approach when their behavior is simulated using the finite element method. By solving the boundary value problem of the macroscale model, for previously homogenized material properties, the resulting stress maps can be obtained. However, such stress results do not describe the actual behavior of the material and are often significantly different from the actual stresses in the heterogeneous microstructure. Finding high-accuracy stress results for such materials leads to time-consuming analyses in both scales. This paper focuses on the application of machine learning to multiscale analysis of structures made of composite materials, to substantially decrease the time of computations of such localization problems. The presented methodology was validated by a numerical example where a structure made of resin epoxy with randomly distributed short glass fibers was analyzed using a computational multiscale approach. Carefully prepared training data allowed artificial neural networks to learn relationships between two scales and significantly increased the efficiency of the multiscale approach.