The prominent feature of autonomous vehicles is collecting real-time data in the form of road images, video through on-board sensors and cameras. Such data is then deployed to optimize the vehicular traffic network. This paper proposes a novel framework for traffic data optimization and network slicing in 6G. The main idea is automatically get the training sample from the global model. Higher sample learning accuracy is improved by deploying knowledge distillation-based training mechanism. The traffic visual data privacy is preserved using adaptive differential method. Experimentations are performed using vehicle and other datasets. Simulations results show that the proposed method has superior performance as compared with existing methods.