## 3 Materials and Methods
### PET Identification Confidence Index and PBIA
#### 3.2.1. PIC Index Computing as Part of the PBIA
A contribution of 40% has been assigned to this factor, as the weight serves as a verification method to confirm that the product, even if damaged, matches the identification provided by the Azure Custom Vision service. \[Cor_{Factor}=\sum_{\omega_{i}}e^{-\frac{(\omega_{weight}-\omega_{i})^{2}}{2 \omega^{2}}} \tag{2}\]  
where  
\(\omega_{weight}\) is the measured weight of the object;  
\(\sigma\) is the standard deviation that reflects the weight tolerance. Using an exponential function based on normal distribution, it provides a continuous value between 0 and 1, depending on how close the measured weight is to the standard values (20 g and 30 g). This makes the evaluation more precise and more challenging to contest. Introducing exponential coefficients enables the impact of each factor on the final result to be adjusted, providing flexibility in calibrating the system. Adjustment factors based on weight variation introduce another factor that considers the consistency of the measured weights. A minor variation in weight indicates a more reliable process. The \(PIC\) value is integrated into the PBIA. The block diagram of the process involving the PBIA is presented in Figure 4. This logical flowchart outlines the complete process of the PRS. The system first detects the user's presence via the PIR sensor, identifies them through QR code scanning, and measures the object's weight. If the object's weight falls within a specific range, it calculates the \(Cor_{Factor}\). After sending the object's image to the AzureCustom Vision service for detection, the system calculates the _PIC_ index and determines whether the object is a PET or non-PET object. Based on the result, the stepper motor directs the object into the appropriate compartment, and the system updates the user's score or alert count, accordingly, using the ACTLR. Figure 4: PBIA block diagram. Objects placed on the basket flap are photographed using camera 2, which transmits the image to the Microsoft Azure Custom Vision service. It returns the classification label, the probability representing the confidence of its labeling, and the localization coordinates, in the form of a rectangle that frames the detected object in the image. These coordinates visually frame the identified object to validate the results. The integration of these functionalities is conducted automatically at the Custom Vision service level. The PBIA system parses this information in order to use it in the graphical display of the detected object on the software interface. The object's location does not influence the sorting decision in any way, as it is used only for experimental validations. The Custom Vision service returns the bounding box because the project was set to the object detection type, and not classification. The PET identification process starts with the change in the PIR sensor state. The system reads the input from the PIR sensor, which detects the presence of a user. If the PIR sensor detects a person, it proceeds to the next step. If not, it waits until the sensor value is 1 (indicating a person is present). When a person is detected, the system turns on the green and red LEDs, signaling that it is ready for use. Next, camera 1 captures an image containing the user's QR code. The system decodes the QR code to identify users and retrieve their unique ID (ClientCode). The system uses a load cell (weight sensor) to measure the object's weight in the bin. A decision block checks if the object's weight is close (\(\pm\)2 g) to 20 or 30 g, typical weights for empty PET bottles of specific sizes (e.g., 250 mL, 500 mL, and 750 mL). If the weight does not match the expected range, the \(Cor_{Factor}\) is set to 0%. If the weight matches the expected range, the \(Cor_{Factor}\) is set to 40%. This accounts for the confidence in identifying the object as a PET bottle, based solely on its weight. Camera 2 captures an image of the object for further analysis. The image is sent to Microsoft Azure's Custom Vision service, which returns a probability that the object is a PET bottle.