The realization of automatic operation of production by the industrial Internet of Things needs the functional assistance of machine vision technology. Different from the recognition and detection of some known features, it is difficult to realize defect detection in machine vision applications. Therefore, this article studies the industrial production defect detection method based on machine vision technology in industrial Internet of Things. Firstly, in the second chapter, the images of industrial products collected by machine vision system are preprocessed and thinned to obtain more ideal detection accuracy and measurement accuracy. The methods of image binarization, morphological processing, thinning and burr elimination are given in detail. In the third chapter, product defect detection model is constructed based on U-Net network, and residual structure, hole convolution module, strip pooling module and attention mechanism module are introduced to optimize the network model. Experimental results verify the effectiveness of the model for product defect detection.