## 3 Methodology
### Deep Learning Model  
To accurately predict the prices of all fruits and vegetables, it is crucial to begin by identifying and recognizing each individual fruit and vegetable. This process typically entails a series of steps, starting with the collection and annotation of a suitable dataset. Subsequently, a model is trained on this custom dataset. For the task of fruit and vegetable  
Figure 1: Hardware components. Figure 2: Illustration of the entire weighing procedure. identification or classification, we have utilized two versions of the YOLO algorithm: YOLOv5 and YOLOv7. YOLOv5 is the fifth iteration of the YOLO (You Only Look Once) series, renowned for its effectiveness in object detection tasks trained on the COCO dataset. The YOLO5 architecture consists of a backbone, neck, and head, as shown in Figure 3. Yolov5 employs CSPDarknet53 as its backbone, which is a convolutional neural network based on DarkNet-53. By utilizing the CSPNet [35] strategy, the feature map of the base layer is partitioned into two parts and subsequently merged through a cross-stage hierarchy. This split and merge approach offers notable advantages to YOLOv5, including a reduction in parameters and computational requirements (FLOPS), thereby improving the inference speed crucial for real-time object detection models. Additionally, Yolov5 incorporates the Path Aggregation Network (PANet) [36] as its neck, enhancing information flow and enabling efficient feature pyramid creation. Feature pyramids aid in the successful generalization across object scales, facilitating the identification of objects in various sizes. PANet further improves the utilization of accurate localization signals in lower layers, resulting in enhanced object location accuracy. The model head consists of a YOLO layer and is primarily responsible for the final detection step. It utilizes anchor boxes to construct output vectors containing class probabilities, abjectness scores, and bounding boxes. Yolov5 is available in various sizes, namely YOLOv5n, YOLOv5s, YOLOv5m, YOLOv5l, and YOLOv5x. Each size has its own characteristics in terms of depth and width multiples, resulting in different numbers of parameters and inference speeds. YOLOv5n maintains the same depth multiple of 0.33 as YOLO5s. However, it reduces the width multiple from 0.5 to 0.25 [37]. As a consequence, YOLOv5n utilizes approximately 75% fewer parameters compared to other YOLOv5 sizes [37]. One notable advantage of YOLOv5n is its significantly higher inference speed, as shown in Figure 4. This means that the algorithm can process object detection tasks more quickly compared to other sizes of YOLOv5. Figure 3: Architecture of YOLOv5 [38]. YOLOv7 represents a new iteration of the YOLO (You Only Look Once) model, featuring the distinct architecture showcased in Figure 5. YOLOv7 introduces architectural improvements to enhance detection speed and accuracy. The YOLO architectures typically consist of a backbone, head, and neck. The backbone performs crucial tasks such as extracting important features and passing them to the head through the neck. Unlike its predecessors, YOLOv7 replaces the darknet backbone with an extended efficient layer aggregation network (E-ELAN). E-ELAN is an enhanced version of ELAN that improves the network's learning capabilities while maintaining the stable state achieved by ELAN. It achieves this by introducing expand, shuffle, and merge cardinality operations within the computational blocks, while keeping the transition layer architecture unchanged. Group convolution is employed to expand channels and cardinality. Each computational layer applies the same group parameter and channel multiplier to all its computational blocks. The resulting feature maps are then shuffled into groups based on the set group parameter and concatenated together, preserving the original number of channels in each group. Finally, merge cardinality combines the feature maps from different groups by adding them together.