Algebraic Topology and Geometric Pattern Recognition