Abstract: The disclosure discloses a method and device for image recognition. The method comprises: placing instruction blocks in a required order; acquiring an encoded instruction block image that represents the instruction block pattern and the placement order; recognizing a single instruction block image from the encoded instruction block image; comparing the single instruction block image with a standard instruction block image to obtain the matching degree of the instruction block; determining, according to the matching degree, standard instruction blocks corresponding to respective instruction block images; sorting the instruction block images according to the coordinates in the encoded instruction block image; parsing the instruction block images according to the sorting order to obtain instructions. The method for image recognition can help children learning concepts such as manipulation, use and programming of intelligent programmable devices more easily.