A Neural Network (NN) is used for borehole correction (205) of resistivity logging data (201). The method comprises two stages. In the first stage (Fig. 3), the entire range of possibilities of earth models relevant to borehole compensation is sampled and a suite of tool responses (105, 107) is generated, with and without the borehole. A wide range tools responses including the borehole effects are input to the NN and the NN is trained (113) to produce the corresponding borehole-free response. In the second stage (Fig.4), the NN is validated by using as input tool responses (including borehole effects) that were not used in the training of the NN and comparing the output of the NN to the corresponding borehole-free response. If the agreement is good, then the NN has been validated and may be used to process subsequently acquired data that includes borehole effects.