## 3 Methodology of the Proposed Concept
### Image Classifier  
Then, after the feature extraction and image enhancement, a non-defective/defective solar panel cell detection method is used to classify images using CNN as a feature extractor, and SVM acts as a classifier. In the architecture presented below, the output of the completely connected layer provides the input feature vectors for the SVM classifier in the proposed scheme. An SVM classifier, specifically the multiclass error-correcting codes model, was used as the final stage of the proposed defect detection. The SVM classifier was used in place of the CNN's softmax layer. SVM's objective is to determine the best hyperplane \(f(w,x)=w.x+b\) for separating two classes in a provided dataset, using the features \(x\in R^{m}\). The parameter \(w\) is learned by SVM by solving an optimization problem, as shown in Equation (12)  
\[min\frac{1}{p}w^{T}w+C\sum_{i=1}^{p}max\left(0,\ 1-y^{\prime}_{i}\Big{(}w^{T}x_{i} +b\Big{)}\right) \tag{12}\]  
where \(w^{T}w\) is the L1 norm; while \(C\) is the penalty parameter (which can be an arbitrary value or one chosen by hyper-parameter tuning), \(y^{\prime}\) is the actual label; and the \(w^{T}x+b\) is stands for the predictor function. Equation (12) which is also known as the L1-SVM, and it uses the typical hinge loss. The differentiable equivalent is the L2-SVM which gives more steady results. \[min\frac{1}{p}w^{T}\|w\|_{2}^{2}+C\sum_{i=1}^{p}max\left(0,\ 1-y^{\prime}_{i} \Big{(}w^{T}x_{i}+b\Big{)}\right)^{2} \tag{13}\]  
where \(\|w\|_{2}\) denotes the Euclidean norm or the L2 norm with the squared hinge loss. Since the radial basis function (RBF) was implemented as the kernel in SVM, cross-validation was used to obtain the optimal kernel values. Moreover, the experimental set-up was simulated via MATLAB platform, both the ground truth/actual and predicted label; the positive is assigned for the defective, while negative for a non-defective input image  
As shown in Table 4, for the image dataset distribution, 70% were used for training and 30% for testing. The HE and AHE training data consist of pairs of training samples \(\{(x_{1},y_{1}),\ \ldots\ (x_{i},y_{i})\}\), where \(x_{i}\) is the observation or input feature for the \(i\)th sample and \(y_{i}\in\{1,0\}\) is the associated class label. The SVM classifier is the discriminant function that maps an input feature space \(x_{i}\) into a class mark \(y_{i}\). The results from this module part can then be used to localize defects. The maximum epoch for the training is 100. The learning rate applied is \(1\times 10^{-4}\), and the validation frequency is set to 1000. The full description is as follows for this module part of the classification. The applied convolutional neural network (CNN) is useful as a feature extractor and a classifier [47; 48] in a wide variety of real-world applications. The Keras sequential model was used in our proposed work, and it consisted of convolutional, activation, and max-pooling layers. Below, the proposed implemented base CNN is presented with the following architectural details  
(1) INPUT: 32 \(\times\) 32 \(\times\) 1  
(2) CONV1: 3 \(\times\) 3 size, 32 filters, 1 stride \begin{table}
\begin{tabular}{c c c} \hline \hline
**Dataset** & **Histogram Equalization** & **Adaptive Histogram Equalization** \\ \hline Training & 1890 & 1890 \\ Testing & 810 & 810 \\ Total & 2700 & 2700 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Image distribution of dataset. * ReLu: max (0, \(h_{\theta}(x)\))
* POOL: 2 \(\times\) 2 size, 1 stride
* CONV2: 3 \(\times\) 3 size, 64 filters, 1 stride
* ReLU: max (0, \(h_{\theta}(x)\))
* POOL: 2 \(\times\) 2 size, 1 stride
* Fully Connected (FC): 1024 Hidden Neurons
* DROPOOUT: \(p=0.5\)
* FC: 2 output classes  
At the 10 th layer of the CNN, instead of the conventional softmax function with the cross entropy function (for computing loss), the L2-SVM is implemented. That is, the output shall be translated to the following case \(y\in\{-1,\,+1\}\), and the loss is computed by Equation (8). The weight parameters are then learned using [49].