A computer-implemented method for providing feedback to a patient using an inhaler of a specific type for inhaling a therapeutic aerosol according to instructions for use provided to the patient for, or along with, the inhaler, the method comprising the steps of: (a) obtaining a sequence of digital audio signals and a sequence of digital video signals emitted from the patient while using the inhaler; (b) recognising the type of the inhaler by processing the video signals; (c) recognising whether the patient has deviated from the instructions by processing the audio and video signals; (d) if a deviation was recognised in step (c), recognising the type of the deviation; and (e) presenting to the patient one or more feedback messages indicating (i) whether a deviation was recognised; (ii) if a deviation was recognised, the type of deviation; and optionally (iii) an inhalation manoeuvre without the deviation; wherein steps (a) to (e) are performed by a portable feedback device for handheld use comprising - a data processing system; - a data memory; - a camera; - a microphone; - a display; and - a speaker; and wherein the method is characterised in that step b) is performed by analysing the video and audio signals using an artifical neural network trained to identify an inhaler type, and step c) is performed by using a method to detect a regular motion comprising the steps: perform the following steps on a series of frames of said video signals of the patient using the inhaler: (o') optionally converting the color information of said frame to greyscale (i') selecting a portion of a frame through which said regular motion passes through; (ii') computing the mean brightness value within said portion of the frame; (iii') storing said mean brightness value of said portion of said frame in a buffer; repeating steps (i') - (iii') for a sequence of frames comprising a plurality of frames, wherein said portion of a frame is identical in each frame creating a buffer of brightness values; calculating the average of the mean brightness of all values determined and stored in said buffer of brightness values; subtracting said determined average of the mean brightness from each value in said buffer to generate a zero centered buffer; computing the zero crossing rate of said zero centered buffer; comparing the determined zero crossing rate with predetermined reference values to obtain an estimate on the speed or strength of said regular motion; wherein said regular motion is shaking. (a) obtaining a sequence of digital audio signals and a sequence of digital video signals emitted from the patient while using the inhaler; (b) recognising the type of the inhaler by processing the video signals; (c) recognising whether the patient has deviated from the instructions by processing the audio and video signals; (d) if a deviation was recognised in step (c), recognising the type of the deviation; and (e) presenting to the patient one or more feedback messages indicating (i) whether a deviation was recognised; (ii) if a deviation was recognised, the type of deviation; and optionally (iii) an inhalation manoeuvre without the deviation; (i) whether a deviation was recognised; (ii) if a deviation was recognised, the type of deviation; and optionally (iii) an inhalation manoeuvre without the deviation; - a data processing system; - a data memory; - a camera; - a microphone; - a display; and - a speaker; perform the following steps on a series of frames of said video signals of the patient using the inhaler: (o') optionally converting the color information of said frame to greyscale (i') selecting a portion of a frame through which said regular motion passes through; (ii') computing the mean brightness value within said portion of the frame; (iii') storing said mean brightness value of said portion of said frame in a buffer; (o') optionally converting the color information of said frame to greyscale (i') selecting a portion of a frame through which said regular motion passes through; (ii') computing the mean brightness value within said portion of the frame; (iii') storing said mean brightness value of said portion of said frame in a buffer; repeating steps (i') - (iii') for a sequence of frames comprising a plurality of frames, wherein said portion of a frame is identical in each frame creating a buffer of brightness values; calculating the average of the mean brightness of all values determined and stored in said buffer of brightness values; subtracting said determined average of the mean brightness from each value in said buffer to generate a zero centered buffer; computing the zero crossing rate of said zero centered buffer; comparing the determined zero crossing rate with predetermined reference values to obtain an estimate on the speed or strength of said regular motion;