In order to remove smelting repellent elements such as Al and to efficiently recover valuable elements such as Au from waste printed circuit boards, the author have developed an algorithm that automatically detects electronic devices containing a large amount of repellent elements and valuable elements from 2D images of circuit boards by applying image recognition technology. The two types of detection algorithms based on rule-based image processing and deep learning networks were proposed. The former focuses on the appearance characteristics (color, size, shape) of each device and sequentially performs relatively simple image processing. As a result of the detection tests on images of actual waste PC boards using, almost 100% of the heat sinks and CPU socket holders, which are repellent devices, could be detected. The detection ratio was about 80% for the aluminum electrolytic capacitors, and about 80 to 90% for the ICs and connectors, which are valuable devices, even for large ones. On the other hand, when using an algorithm based on a deep learning network, in detection tests targeting the aluminum electrolytic capacitors, ICs, and connectors mounted on waste PC boards, the detection ratio of 95% or more and false detection ratio of less than 5% were successfully achieved.