Production equipment maintenance is essential for maintaining productivity and company continuity. For industrial equipment to operate well and for the efficient planning of demand for in-house maintenance resources, implementation time as well as proper selection of scope of maintenance activities must be determined. The use of artificial intelligence (AI) approaches to method as well as manage maintenance has been explored in a number of research during the past 10 years. This study's objective is to provide a unique method for optoelectronic sensor defect detection using predictive maintenance in an application for smart industry 4.0 based on machine learning (ML) methods. Here, data monitored by an optoelectronic sensor is gathered and processed for noise reduction and normalisation. Then, using a moath quantile convolutional neural network and spatial clustering-based extreme encoder learning, aberrant errors are discovered in the observed data features. In terms of prediction accuracy, precision, recall, F_1 score, and robustness, experimental study was done on a variety of predictive classes and their dataset. [ABSTRACT FROM AUTHOR]