A method and an apparatus for performing a localization of a movable treatment device having an inertial sensor and configured to treat a target surface. A motion pattern recognition device discriminates between two or more motion patterns contained in a set of motion patterns. An interface provides at least one inertial sensor data from the inertial sensor to the motion pattern recognition device. At least one inertial sensor data represents a movement of the movable treatment device. A neural network is configured to receive the at least one inertial sensor data and to map the at least one inertial sensor data to at least one motion pattern contained in the set of motion patterns associated with one or more different zones of the target surface so that the mapping of the at least one inertial sensor data with the at least one motion pattern indicates an estimation of the location of the device with respect to at least one zone of the target surface.