Pattern Recognition on Financial Market Which machine learning or deep learning model(has to be supervised learning) will be best suited for recognizing patterns in financial markets ?

What I mean by pattern recognition in financial market :
Following Image shows how a sample pattern (i.e. Head and shoulder) looks like:

Image 1:



And Following Image shows how it actually forms in real chart events: 

Image 2:



What I'm trying to do is:
Any pattern similar to Image 1 can be defined as Head and Shoulder Pattern but in a Chart (Price Chart) it will not form as clearly as Image 1. Image 2 is the sample of Head and Shoulder Pattern form in Chart (Price Chart).
As it seems in Image 2, it can not be identified as Head and Shoulder Pattern by normal algorithms or analysis (Because there are a lot of highers and low forming a lot of structure, which can easily mislead into a lot of shoulders or head or any other structures).
I'm expecting to train machine to recognize the Head and Shoulder Pattern when similar (as Image 2) pattern is formed.  

Thank you for your time. 

Let me know if I'm taking it to wrong way. 
I only have beginners knowledge on Machine Learning.
You should look at a classifier based on Dynamic Time Warping (DTW) distance. DTW is a method that calculates an optimal match between two given sequences (e.g. time series). It has been used in a supervised learning setup, in particular it has been reported to achieved state of the art results, when used in a nearest neighbour classifier.