This study proposes a means for calculating the interaction force during the scanning process using a scanning near-field optical microscope (SNOM) probe. The determination of the interaction force in the scanning system is regarded as an inverse vibration problem. The conjugate gradient method is applied to treat the inverse problem using available displacement measurements. The results show that the conjugate gradient method is less sensitive to measurement errors and prior information on the functional form of quality was not required. Furthermore, the initial guesses for the interaction force can be arbitrarily chosen for the iteration process.