## 5 Fraud Risk Management in the Honey Sector--The VACCP Approach and Innovative Technologies
### Methodology  
The convolutional neural network (CNN) approach was selected due to its demonstrated effectiveness in extracting complex morphological features from biological images, which is essential for accurate pollen classification  
The analytical module of the honey authentication system employs a convolutional neural network (CNN) framework to classify the botanical origin of honey based on microscopic pollen images using two independent processes: segmentation and classification. **Segmentation process**  
The segmentation pipeline is designed to extract individual pollen grain images from complex microscopic images. To achieve accurate results, the system utilizes the Mask R-CNN ResNet50 FPN model, which combines object detection (bounding boxes) with instance segmentation (pixel-level masks for each detected object). Due to its ability to extract features at different levels of depth, ResNet-50-FPN is frequently used for segmentation tasks. ResNet-50 has an effective FPN, which both captures low-level and high-level image features and helps to semantically segment and detect objects at multiple scales. FPN boosts a model's multi-scale object detection abilities by merging high-resolution fine-detail shallow features with semantically rich deep features. The process consists of the following stages:  
1. Data Loading: 1. Images and corresponding segmentation masks are loaded. 2. Each mask encodes different object instances using different colors (background is black (#000000)). 2. Transformations: 1. Images are converted to tensors. 2. During training, random horizontal flips are applied for data augmentation. 3. Model Training:  
Figure 1: System pipeline architecture. Source: Author’s own work. * The Mask R-CNN model is initialized with weights pretrained on the COCO dataset. * The classifier and segmentation heads are adapted to the number of classes (in this case: background + 1 object class). * Training is performed for 10 epochs using the SGD optimizer and a step learning rate scheduler. * The trained model is loaded and used to segment new images. * For each image, segmentation masks and bounding boxes are generated. * Results are saved as cropped image fragments and preview images with marked bounding boxes. **Network Parameters:**  
* Architecture: Mask R-CNN with ResNet-50-FPN backbone. * Pretraining: Weights pretrained on the COCO dataset. * Number of classes: 2 (background + 1 object class). * Hidden layer: 256 neurons. * Type: SGD
* Learning rate: 0.005
* Momentum: 0.9
* Weight decay: 0.0005
* Batch size:
* Training: 2
* Testing: 1
* Number of epochs: 10  
The segmentation model achieved strong performance on the test dataset, with an average pixel-wise accuracy of 95% and an averaged F1-score of 0.93, indicating both high precision and recall in distinguishing and segmenting the target objects. **Classification Process**  
The ResNet152 architecture was chosen for its depth and proven performance in transfer learning tasks, enabling the model to leverage pretrained knowledge and adapt efficiently to the specific characteristics of pollen imagery. This combination allows for robust feature representation and improved classification accuracy compared to traditional machine learning methods. The input dataset comprised labeled pollen images obtained from honey samples collected across five regions of Poland. The training data were divided into 19 groups (pollen type, number of images): CALLUNA (2199 images), RHAMNACEAE (259 images), VITEX (685 images), PLANTAG-INACEAE (402 images), ECHIUM (2207 images), FAGOPYRUM (2271 images), BRAS-SICA_NAPUS1 (757 images), ARTEMISA (2221 images), EUCALYPTUS (1713 images), DANDELION (891 images), TILIA (2171 images), PINUS (1771 images), PHACELIA (2214 images), LAVANDULA (1393 images), CHENOPODIUM (386 images), HELIANTHUS (2816 images), CIRSIUM (647 images), AMBROSIA (857 images), SALIX (1088 images).