The predictive maintenance function is ensured with the earlier detection of errors and faults in the machinery before reaching its critical stages. On the other hand, the challenges faced by Internet of things (IoT) devices are the security problem because they can be easily attacked by comparing the other devices such as computers or portable devices. It cannot solve the highdimensional issues and imbalanced data. The computation cost is very expensive when using the modern sampling method. In addition, the conventional methods for predictive maintenance are incorporated with a single method. So, the maintenance and prognostic tasks are very hard to address simultaneously. Thus, a new predictive manufacturing system in Industry 4.0 for examining the machines is proposed. In the initial stage, the data are collected from IoT industry sensors. Considerably, the data cleaning is carried out, and deep features are extracted through the "Multi-Scale Dilation Attention Convolutional Neural Network (MSDA-CNN)." Further, the deep, weighted features are extracted, where the weight is optimized using the hybrid algorithm named Probabilistic Beetle Swarm-Butterfly Optimization (PBS-BO). In the end, the weighted features are given to the Optimized Hybrid Fault Detection (OHFD) that is performed by the "Deep Neural Network (DNN) and Deep Belief Network (DBN)." Finally, if any faults in machines are predicted, then the system sends alerts to the industrialists for suitable decision-making. The efficiency of the suggested model is evaluated on a set of real measurements in Industry 4.0.