A non-transitory computer-readable medium comprising instructions that, when executed by one or more processors of an electronic device comprising a touch screen, cause the electronic device to perform a method comprising:
- obtaining first touch data, sensed using one or more touch sensing electrodes of the touch screen, wherein the first touch data includes data representing noise;
- inputting, to a machine learning algorithm that includes a gated recurrent unit having one or more channels, one or more vectors of image data associated with an image displayed at a same time the first touch data was obtained, the one or more vectors of image data equal in number to the one or more touch sensing electrodes arranged along a same dimension, wherein an input to each of the one or more channels of the gated recurrent unit is one of the one or more vectors of image data;
- obtaining estimated noise by estimating, via the machine learning algorithm, the noise based on the image data;
- and
- removing the estimated noise from the first touch data to obtain second touch data.