We introduce a strategy to select optimal mini-batches for target-oriented least-squares reverse time migration that adopts stochastic optimizers to solve the inverse problem. The proposed method with optimal mini-batches can improve image quality at reduced computational costs. We formulate the optimal shot selection criterion using a shot effectiveness metric and clustering techniques. We first calculate the illumination and effectiveness using forward modeling operations for each shot. We then apply K-means clustering on the shot effectiveness to obtain optimal mini-batches suitable for stochastic optimization methods. Clustering shots into optimal mini-batches can help retain only those necessary shots to image a target zone. These batches are a-priori calculated only once and used for all iterations. We adopt the stochastic Adam optimizer to speed up the algorithm's convergence. A novel beam migration approach based on frame theory is used to speed up the analysis. This beam method extracts only subsets of beams needed for the migration calculation from the surface data. Efficiency is further enhanced due to the spectral localization of the beams. The presented workflow leads to a robust and efficient inversion algorithm that provides high-resolution images in hard-to-image target zones.