In this research, a K-means clustering algorithm and attention mechanism is used to improve object classification by preprocessing 3D point clouds. Robotics and autonomous driving depend heavily on point clouds obtained by LiDAR. Big data quantities and noise present challenges for traditional approaches. Post-clustering, the data is processed by an improved PointNet + + neural network with embedded attention mechanisms for object classification. PointNet + + effectively classifies objects in complicated scenarios by utilizing a hierarchical structure and attention methods to concentrate on the most pertinent portions of the input. Tests carried out on the KITTI dataset show that pre-clustering improves classification accuracy while cutting down on processing time. As evidence of the effectiveness of the suggested strategy, the findings show a notable improvement in performance measures. This approach holds potential for creating more reliable and effective perception systems for self-driving cars and other applications involving 3D data analysis. The combination of PointNet + + and K-means clustering offers improvements in speed and accuracy while reducing computing costs, addressing important issues in managing large-scale 3D point cloud data. This study highlights the potential of cluster analysis as a preprocessing step to optimize neural network-based systems, paving the way for more reliable and faster processing of 3D point cloud data in real-world scenarios.