## 2 Material and Method
### Wavelet Haar  
DWT, which is based on Haar wavelet basis functions, is used for dimensionality reduction in the data. Algorithm coefficients and prediction time consumption are better used with DWT (wavelet basis function and the number of transformation layers are Haar-4 respectively) [50]. The Haar wavelet is a type of wavelet function used in wavelet analysis. The wavelet function is a mathematical tool for analyzing and representing texture images of various types of meat or data simultaneously in the time and frequency domains. The Dutch mathematician [PERSON] presented this function first in 1910. The Haar wavelet is one of the easiest wavelets to understand and use due to its discrete and straightforward character. It is a local segment function often used in data compression, image processing, and image analysis because of its ability to quickly identify variations in the texture images of various types of meat. The image is separated into smaller intervals for the Haar wavelet transform, and each interval is then subjected to the Haar wavelet. This procedure enables the imaging of different signal components at various resolutions. The main advantage of Haar waves is their ability to convey high-frequency information effectively; so, they are often used in applications requiring rapid identification of edges or signal changes. Approximation coefficients and detail-based mathematical formulas can be used to describe the Haar wavelet transform. The calculation for discrete signal \(x\)\([n]\) with a length of \(N\), estimation coefficient \(A\)\([k]\), and detail coefficient \(D\)\([k]\) at level k is as follows:  
A. Approximation Coefficient:  
\[A[k]=\frac{x[2k]+x[2k+1]}{\sqrt{2}} \tag{2}\]  
B. Detail Coefficient:  
\[D[k]=\frac{x[2k]-x[2k+1]}{\sqrt{2}} \tag{3}\]  
Figure 2: Classification Stage Model. This process can be repeated at each transformation level by replacing \(x\)\([n]\) with \(A\)\([k]\) for the next level. The following are the basic steps to perform the Haar wavelet transform:  
1. The intervals for texture photos of different types of meat are divided into smaller intervals. Convolution operations on adjacent intervals or the average of two consecutive values can achieve this. 2. After separating the intervals, the approximation coefficient (\(A\)) and detail coefficient (\(D\)) are calculated. The approximation coefficient represents the finer details or low-frequency components in the texture image of a type of meat. The detail coefficient represents high-frequency elements or information that are coarser or change more quickly. 3. Coefficient values are normalized to suit the needs of a particular use case. Adjusting scales or assigning weights can be part of this process. Table 1 below shows the estimated pseudocode (cA) and detail coefficients (cH, cV, and CD) calculated in the Haar wavelet transform:  
In the pseudocode above, the researchers started by taking a grayscale image from the input image (if the image is in color). Thereafter, they divided the image into 2 \(\times\) 2 sub-blocks. Following that, for each sub-block, they calculated the average pixel as the approximation component as well as the horizontal, vertical, and diagonal details as the detail coefficients component. After calculating all the components, the researchers combined these values to form cA, cH, cV, and cD, which, respectively, represented the approximation coefficient and detail coefficients components of the Haar wavelet transform. In this code, the Haar coefficient is a function to calculate the approximation coefficients and details of the Haar wavelet transform for the input image. This function uses pywt.dwt2 from PyWavelets to perform the Haar wavelet transform. The transformation results were then separated into approximation coefficients (cA) and detail coefficients (cH, cV, and cD), which represent coarse and detailed information from the image, respectively, for the horizontal, vertical, and diagonal dimensions.