# NRNH-AR: A Small Robotic Agent Using Tri-Fold Learning for Navigation and Obstacle Avoidance
## 2 Materials and Methods
### Vision-Based Environmental Understanding  
The CNNs play an important role in physical robot navigation, enabling them to understand environmental information and perform their assigned task. In the proposed scheme, the robot agent contains two CNNs, CNN 1 and CNN 2, as shown in Figure 1. CNN 1 is pre-trained offline for detecting a specific target object, and CNN 2 is trained during navigation for understanding the environment. For CNN 1, we perform transfer learning in the pre-trained MobileNet V3 [25], introducing several images of the target object with different scales and viewpoints. This CNN can be replaced by any lightweight CNN according to the hardware limitations.  
Regarding CNN 2, as shown in Figure 3, the NRNH-AR algorithm starts training a shallow CNN, follows sequential progression from SSL to USL, and finally reaches DRL. As mentioned earlier, the training of CNN 2 begins with creating a database composed of a concatenated image \(O_{co}\); one example of this can be observed at the top of Figure 3.  
In Figure 3, \(\varepsilon\) represents the current amount of environmental information (database size) and the threshold value \(\eta\) is the minimum amount of data necessary to train CNN 2; its importance lies in avoiding ineffective computational expenditure due to a lack of information. If \(\varepsilon\) exceeds \(\eta\), it indicates that there are sufficient images to train CNN 2. Otherwise, additional images are continuously added to the database. The loss value of CNN 2 decreases oscillatory as the database size increases, but the training time and energy consumption increase with the database size. Considering the relation between these two conflicting issues, we select the database size when the training loss value of CNN 2 reaches less than 1.0 the minimum database size \(\eta\), which is equal to 623.  
In the CNN 2 training process, grayscale images in the size of \(150\times 150\) are introduced as input data, and four probability values, corresponding to four classes, are output. These four classes correspond to four collision cases captured by the ultrasonic sensor, as shown  
Figure 3: CNN training process.  
in Table 1. It is worth mentioning that the other four possible cases, such as [1 0 1], [0 0 0], etc., are not included as collision cases, because these do not present any collision in front of the agent, allowing the agent to move ahead. We denominate the output of CNN 2 as \(C_{c}\) for further use in the subsequent learning phases.  
The architecture of CNN 2, which is trained using 623 concatenated observation images, \(O_{co}\), with the Adam optimizer to minimize the Categorical Cross Entropy loss function, is provided in Table 2. The number of epochs required is 50. This architecture is selected as the optimum after several analyses of the performance of the subsequent learning phases. The number of epochs is relatively small because the capability of a robotic agent to avoid obstacles can be improved through SSL, USL, and DRL.  
Once CNN 2, whose weights are fixed for use in the subsequent phases, has been trained, the study proceeded with the SSL, USL, and DRL phases, in that order.