# FSN: Feature Shift Network for Load-Domain (LD) Domain Generalization
## 3 Feature Shift Networks
### Design of FSN  
**Design Idea.** An FSN based on the assumption that features from different domains can be converted to each other as long as a pattern can be found. The design idea comes from the sources shown in Figure 6. Since all labels in the label space of the source domain correspond to the actual working condition, and the load size in the working condition is the domain number, the number is practically meaningful in this scenario. There is a straightforward linear mapping between these numbers, represented as 0, 1, 2, and 3, which are evenly distributed along the number line shown on the right side of Figure 1. Domain numbers 0, 1, and 2 represent the source domains, corresponding to the data generated by the bearing under 0 HorsePower (HP) load, 1 HP load, and 2 HP load, respectively. These data sets belong to three distinct domains, which together comprise the source domain data. Domain number 3 represents the target domain, associated with the data generated by the bearing under 3 HP load. On the left side of Figure 1, these domain numbers are mapped to their respective domain feature spaces. These feature spaces are linearly ordered according to the domain labels, indicating a systematic pattern among them.  
Figure 5: Output and loss of relational classifiers.  
Figure 6: Design idea of FSN.  
**Network Structure.** FSN consists of a feature extractor, a feature shift network, a relation classifier, and a label classifier. Both the feature extractor and the feature shift network are implemented by ResNet50 [28]. Because our domain generalization job is classification, we chose Cross-Entropy as the loss function of the network. The feature shift network receives the output feature of a feature extractor as input, outputs a feature of the same form, and expects this feature to be mapped to features in adjacent domains. The relation classifier is implemented in the same way as in Section 3.3.  
The FSN structure is shown in Figure 7. During training, the input data are organized into the form of 1-9. Specifically, this means that there is one sample from the source domain (a + 1) and nine samples from the source domain (a). These nine samples are derived from 0 to n classifications within domain a, where n denotes the number of classifications in the task. In the actual training, domain a may be domain 0 or 1, and the corresponding domain a + 1 is domain 1 or 2. The data of domain a are changed into features after ResNet, and the extracted features of the data of domain a + 1 have to go through a feature shift network to obtain the shifted output. It is expected that this output can be aligned with the features of the data with the same labels in domain a through the relation module, and the output is the relation of 1 Score. Ultimately, when domain 3 is treated as domain a + 1, then domain 2 is treated as domain a. At this stage, the data from domain 3 are subjected to both feature extraction and feature shifting. Relationship scores are computed by comparing these features with those of each class in domain 2. The class with the highest relationship score is expected to be the true category of the data from the target domain.