## 5 Fraud Risk Management in the Honey Sector--The VACCP Approach and Innovative Technologies
### Methodology
To avoid overfitting and improve generalization, each group was expanded with augmented images to a total of 2500 images per class, and color information was removed. The augmentation process generates new variants of existing images (such as rotation, flipping, and brightness adjustment), allowing the model to encounter a wider variety of cases. The augmentation algorithm randomly applied these transformations to the pollen images, and 80% of images are used for training and 20% for validation. The split is performed within each class, so both training and validation sets maintain the same class distribution as the original dataset. The image processing pipeline includes noise reduction using a bilateral filter (parameters: diameter 9, sigmaColor and sigmaSpace set to 75) and histogram normalization with the CLAHE method (clipLimit 2.0, tileGridSize 8 \(\times\) 8). OpenCV libraries were used for filtering, CLAHE, and segmentation, while PIL was utilized for augmentation. The detailed data preprocessing pipeline was built as follows:  
1. Noise Reduction with Bilateral Filter. The bilateral filter reduces noise while preserving edges, which is particularly important for biological images, implemented as:  
1. Framework: OpenCV (cv2.bilateralFilter)
2. Parameters:  
2. Histogram and Intensity Normalization with CLAHE (Contrast-Limited Adaptive Histogram Equalization). CLAHE is a standard histogram normalization technique used to enhance contrast and equalize image brightness, especially useful in microscopic imagery:  
1. Framework: OpenCV (cv2.createCLAHE)
2. Parameters:  
1. CLAHE_CLIP_LIMIT: 2.0 (maximum histogram clip limit)
2. CLAHE_TILE_SIZE: (8, 8) (tile grid size)
3. Randomized Data Augmentation. Augmentation is used to increase the diversity of training data by applying transformations like rotation, flipping, and scaling, which helps models generalize better to real-world variations and reduces overfitting. 4. Geometric Augmentation: 1. Library: Pillow 10.3.0 (ImageOps.mirror, Image.rotate)
2. Functions (25% probability per filter): 2. Mirroring (ImageOps.mirror)
2. Rotation (Image.rotate)
5. Brightness, Contrast, and Sharpness Augmentation: 1. Library: Pillow 10.3.0 (ImageEnhance)
2. Functions (25% probability per filter): 2. ImageEnhance.Contrast (up to 120%)
2. ImageEnhance.Brightness (up to 110%)
2. ImageEnhance.Sharpness (up to 110%)  
The model was implemented using Python 3.10.12 and TensorFlow 2.14. Data preprocessing and image augmentation were performed using the OpenCV 4.9.0.80 and Keras 3.3.3 libraries. Training and testing were conducted on a NVIDIA RTX 4090 GPU server with 16 GB of RAM. Keras enables the rapid construction, training, and evaluation of deep neural networks. Pre-built modules for transfer learning were utilized, allowing for flexible adaptation of the model architecture to the specific image classification task. **Model Architecture**  
1. Base model: ResNet152 (pretrained on ImageNet)
2. Network parameters: 1. Removal of the fully connected layer (include_top = False)* Addition of custom layers:
* GlobalAveragePooling2D
* Dense layer (Dense (1024, activation ='relu'))
* Output layer (Dense (num_classes, activation ='softmax'))
* Layer freezing strategy:
* Initial phase: all ResNet152 layers frozen
* Fine-tuning phase: layers 1-482 frozen, layers 483 and above trainable,
* Input size: 256 \(\times\) 256 px  
**Training workflow**, two-phase training process:  
1. Initial phase:  
* Only the newly added layers are trained
* Hyperparameters:  
* Optimizer: Adam (default LR = 0.001)
* Number of epochs: 75 (with Early Stopping applied)
* Batch size: 32
* Loss function: categorical_crossentropy  
2.