# Classification of Trash and Valuables with Machine Vision in Shared Cars
## 2 Materials and Methods  
A Ford Focus (2017 model), allocated for research and development purposes at the Aalto University, was used to install the camera unit for feeding images to the prediction model. The approach was based on the intuition that all shared vehicles from one organization would be of the same model, and hence, the prediction model can later be fine-tuned to other vehicles using the architecture developed in the current research. It is important to highlight that the camera module configuration in the vehicle was developed with the focus of system demonstration and therefore not essentially as a final solution of implementation. The setup consisted of an ELP 170\({}^{\circ}\) fisheye camera unit to obtain images of the rear seating area. The camera was located next to the left roof handle in place of an internal light because of the practical impossibility of placing it above the middle of the rear seat (as the car had a sunroof). Additionally, to ensure that clear images could be obtained under varying levels of internal illumination (especially when it is dark outside), an LED light strip was installed to run across the entire width of the car over the rear seat and was fixed at both ends to the roof handles. The camera unit was joined to a Raspberry Pi 3 Model B processor via USB. For controlling both the state (ON/OFF) and brightness of the light module, an N-channel MOSFET was employed. The power for the in-car unit was provided by A 12 V rechargeable battery source. The schematic of the integrated circuit is shown in Figure 1 while Figure 2 shows the implemented layout. It should be highlighted that that all the components of the camera unit, with exceptions of the light module and the camera itself, were positioned within the trunk of the car as shown in Figure 2. Furthermore, the battery pack was already installed in the vehicle, prior to the commencement of the current research and was intended for shared use among all research work conducted with this vehicle. Figure 3 illustrates how the sequence of events occur during the process, which commences from capturing an image and terminates when the predicted results are displayed. The original resolution of each captured image was 1920 by 1080 pixels (however, each image had to be preprocessed to scale it down to a size of 224 by 224 pixels prior to being input to the CNN). Figure 1: Schematic of the in-car camera unit. Figure 3: Process flow of the implemented detection system. Figure 2: Final configuration within the research vehicle. After receiving the detection command, the camera and light module would be activated until the image is taken. Figure 4 presents the comparison of capturing an image with and without the installed LED light. The Raspberry Pi, connected to Wi-Fi, will then receive and transmit the image to a server located remotely. Then, in the server, the prediction model, in the form of a classification algorithm, will be executed, and the results displayed subsequently. Elaborating on the communication protocols, the Raspberry Pi supports remote access, which enables program modification and execution via Secure Shell (SSH). Secure Copy Protocol (SCP) was used to transfer captured images to the remote server. Before training the prediction model, a database of images was created for the purpose of training and testing the prediction model. It contained images for the three output categories listed in the introductory section, with the inclusion of applicable exterior variations in the images, primarily with regard to different forms of shadows and levels of lighting. To collect images of empty seating areas, the approach was to execute a script, which captures an image, representing the condition of the rear seating area, on every periodic interval (ranging from 30 to 60-min time gaps) throughout the day in order to have different lighting levels and shadows across the captured frames.