# Computer-Vision-Based Product Quality Inspection and Novel Counting System
## 2 Related Works  
### Computer-Vision-Based Defect Detection  
#### 2.1.1 Limitations of Deep Learning Techniques Based on Image Classification  
Recently, deep learning technology has made great progress and is being used in various fields. In particular, deep learning models such as CNN (convolutional neural network) and RNN (recurrent neural network) are also attracting attention in the field of image classification. Additionally, the recent emergence of new architectures such as vision  
Figure 1: This figure is a schematic image of the entire system. transformer (ViT) expands image processing possibilities, providing CNN-like performance. However, while this approach shows excellent performance, it still has several limitations. First, there is a class imbalance problem. In most datasets, the imbalance between majority and minority classes has a negative impact on the performance of deep learning models [15]. In particular, when class imbalance is severe, feature learning of minority classes is not performed properly, and the model tends to perform excellently only in predictions for majority classes [16]. In a recent study, the performance degradation of deep learning models for various class imbalance problems was analyzed, and it was found that the larger the imbalance, the greater the tendency for model accuracy to deteriorate [17; 18]. To solve this problem, you can either undersample the majority-category data using random sampling techniques to match the minority-category data or use a technique called a generative adversarial network (GAN) to oversample the minority-category data. As shown in Figure 2, the undersampling process (left) involves reducing the number of samples in the majority class (Class A) to match the sample size of the minority class (Class B). This technique helps balance the dataset but may lead to information loss as potentially valuable data from the majority class is discarded. On the other hand, the oversampling process (right) increases the sample size of the minority class by duplicating existing data or generating synthetic samples. This approach helps preserve all the majority-class data while keeping the dataset balanced. Techniques such as generative adversarial networks (GANs) have been widely used to generate realistic synthetic data for the minority class, improving model performance by effectively addressing the class imbalance problem. However, even with these methods, achieving optimal performance remains challenging due to the risk of overfitting in oversampled data and the difficulty of accurately measuring model performance [19]. Second, deep learning models such as CNN have high computational complexity and require a lot of resources during the learning and inference process [18]. Especially in a real-time environment, this requires research to optimize the computational load for real-time product quality evaluation using multiple-frame-rate cameras and various deep learning models [20; 21]. CNN can extract various spatial features of an image through multiple layers of convolution, but its computational cost is very high due to its structural characteristics. This can cause difficulties in applying deep learning models when real-time processing is required in an actual industrial environment, and in order to solve these problems, several studies have argued that lightweight network design or hardware acceleration techniques are needed. Third, using deep learning models in a manufacturing environment is subject to various limitations. Due to the nature of the manufacturing industry, the model must be retrained every time a new product is manufactured in addition to an existing product, which inevitably requires significant time and cost during the data collection and labeling process. Additionally, if the manufacturing facility or  
Figure 2: The image on the left shows the undersampling process, which reduces the data of Class A, the majority class, to match the amount of data in Class B, the minority class.