With the emergence of the Industrial Internet of Things(IIoT) and Industry 4.0, industrial automation has grown as an important vertical in recent years. Smart manufacturing techniques are now becoming essential to keeping up with the global industrial competition. Decreasing the machine's downtime and increasing tool life are crucial factors in reducing machining process costs. Therefore, introducing complete process automation utilizing an intelligent automation system can enhance the throughput of manufacturing processes. To achieve this, intelligent manufacturing systems can be designed to recognize materials they interact with and autonomously decide what actions to take whenever needed. This paper aims to present a generalized approach for fully automated machining processes to develop an intelligent manufacturing system. As an objective to accomplish this, the presence of workpiece material is automatically detected and identified in the proposed system using a CNN-based machine learning algorithm. Further, the CNC lathe's machining toolpath is automatically generated based on workpiece images for a surface finishing operation. Machining process parameters (spindle speed and feed rate) are also autonomously controlled, thus enabling full machining process automation. The implemented system introduces cognitive abilities into a machining system, creating an intelligent manufacturing ecosystem. The improvised system is capable of identifying various materials and generating toolpaths based on the type of workpieces. The accuracy and robustness of the system are also validated with different experimental setups. The presented results demonstrate that the proposed approach can be applied in manufacturing systems without the need for significant modification.