  With the rapid development of cloud manufacturing, industrial production with
edge computing as the core architecture has been greatly developed. However,
edge devices often suffer from abnormalities and failures in industrial
production. Therefore, detecting these abnormal situations timely and
accurately is crucial for cloud manufacturing. As such, a straightforward
solution is that the edge device uploads the data to the cloud for anomaly
detection. However, Industry 4.0 puts forward higher requirements for data
privacy and security so that it is unrealistic to upload data from edge devices
directly to the cloud. Considering the above-mentioned severe challenges, this
paper customizes a weakly-supervised edge computing anomaly detection
framework, i.e., Federated Learning-based Transformer framework
(\textit{FedAnomaly}), to deal with the anomaly detection problem in cloud
manufacturing. Specifically, we introduce federated learning (FL) framework
that allows edge devices to train an anomaly detection model in collaboration
with the cloud without compromising privacy. To boost the privacy performance
of the framework, we add differential privacy noise to the uploaded features.
To further improve the ability of edge devices to extract abnormal features, we
use the Transformer to extract the feature representation of abnormal data. In
this context, we design a novel collaborative learning protocol to promote
efficient collaboration between FL and Transformer. Furthermore, extensive case
studies on four benchmark data sets verify the effectiveness of the proposed
framework. To the best of our knowledge, this is the first time integrating FL
and Transformer to deal with anomaly detection problems in cloud manufacturing.
