The paper presents a method for separating the contribution of pair and single top quark production in tWb-associated final state using a neural network. The proposed method makes possible to calculate such processes in a gauge-invariant way with fully taking into account interference contributions and dividing the phase space into single-resonant and double-resonant regions, which is necessary to increase the accuracy of the search for possible deviations from the predictions of the Standard Model in these processes. To train the neural network, the optimized set of observables is used to separate single-resonance and double-resonance contributions to the overall process. The use of this method allows us to avoid the disadvantages inherent in the schemes used in collider physics for calculating the processes of tWb-associated top quark production with the removal of Feynman diagrams, which leads to violation of gauge invariance, or the addition of a subtraction scheme, which leads to the appearance of negative weights for the part of simulated events. The proposed method can be used to increase the efficiency of searching for deviations from the predictions of the Standard Model in the interaction of the top quark with the W boson and b quark.