Background: This paper presents a method devised to ensure the secure navigation of biped robots within hospital environments by meticulously identifying an optimal collision-free path from initial to final positions while mitigating potential damage from undetected small objects. Methods: Implementation of a modified SARSA algorithm facilitates the seamless movement of biped robots amidst unknown environments replete with static obstacles. Extensive evaluation of several YOLO algorithms is conducted to ascertain accurate vision-based obstacle detection within hospital images. Subsequent utilization of the SARSA algorithm enables the planning of obstacle-free paths within the identified hospital setting. Findings: Within the evaluated YOLO algorithms, Yolov8 emerges as the pinnacle, showcasing unparalleled accuracy in object identification and refining bounding box precision for robot navigation within complex hospital environments. The SARSA-based path planning ensures the creation of collision-free routes, affirming safe traversal for the biped robot. Particularly noteworthy is Yolov8's exceptional precision in detecting minute objects, significantly reducing collision risks. Novelty: This research marks a significant stride in advancing human-like path planning for biped robots maneuvering through intricate hospital settings. The emphasis on accurate object identification stands as a linchpin for guaranteeing the robot's secure traversal. Significance: The integration of Yolov8 substantially augments the biped robot's capacity to precisely detect small objects, thereby mitigating collision risks and potential damage. Moreover, the successful application of the SARSA algorithm in planning obstacle-free paths within complex hospital environments holds promise for augmenting real-world robot navigation, especially in sensitive environments like hospitals.