Autonomous driving systems (ADSs) hold promise for enhancing safety and efficiency on the roads; yet, concerns persist due to rising fatalities involving vehicles equipped with ADSs. This research comprehensively examines the technical components of ADSs, including current challenges, system designs, evolving techniques, and critical features like sensor technologies such as Light Detection and Ranging (LiDAR) and cameras. These sensors enable vehicles to perceive their environment accurately, facilitating tasks such as navigation and obstacle avoidance. Advanced edge detection strategies for lane detection and the usage of Lane Keeping Assist (LKA) structures are crucial technologies for ADS. Hence, in this paper, we implement a modified Sobel edge detection algorithm to improve its performance for lane detection and integrate a CNN-based approach into our system. By trying various Gaussian filter parameters, we develop an optimized edge detection system that performs well in different lighting and weather conditions, such as low light or rainy weather. In our work, we implement a Convolutional Neural Network (CNN) for edge detection and train it using a comprehensive dataset of road images and traffic scenes. The dataset includes a diverse range of conditions, such as different lighting (day and night), weather (clear, rainy, foggy), and road types (highways, urban streets, rural roads). This extensive dataset allows the CNN to learn features robustly and generalize well across various driving scenarios. Simulation and results show that our CNN-based approach has high performance, as it exhibits high accuracy and low processing time needed for ADSs.