FedStyle: Style-Based Federated Learning Crowdsourcing Framework for Art Commissions
Changjuan Ran Yeting Guo Fang Liu Shenglan Cui Yunfan Ye






FedStyle: Style-Based Federated Learning Crowdsourcing Framework for Art Commissions



This work is supported by The National Natural Science Foundation of China (No. 62172155). Corresponding authors: Yeting Guo and Fang Liu. 

    1st Changjuan Ran
School of Design 

Hunan University

Changsha, China 

s220800533@hnu.edu.cn
2nd Yeting Guo
College of Computer 

National University of Defense Technology

Changsha, China 

guoyeting13@nudt.edu.cn
3rd Fang Liu
School of Design 

Hunan University

Changsha, China 

fangl@hnu.edu.cn 

4th Shenglan Cui
School of Design 

Hunan University

Changsha, China 

cuisl@hnu.edu.cn
5th Yunfan Ye
College of Computer 

National University of Defense Technology

Changsha, China 

yunfan951202@gmail.com











    
===============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================




The unique artistic style is crucial to artists' occupational competitiveness, yet prevailing Art Commission Platforms rarely support style-based retrieval. Meanwhile, the fast-growing generative AI techniques aggravate artists' concerns about releasing personal artworks to public platforms. To achieve artistic style-based retrieval without exposing personal artworks, we propose FedStyle, a style-based federated learning crowdsourcing framework. It allows artists to train local style models and share model parameters rather than artworks for collaboration. However, most artists possess a unique artistic style, resulting in severe model drift among them. FedStyle addresses such extreme data heterogeneity by having artists learn their abstract style representations and align with the server, rather than merely aggregating model parameters lacking semantics. Besides, we introduce contrastive learning to meticulously construct the style representation space, pulling artworks with similar styles closer and keeping different ones apart in the embedding space. Extensive experiments on the proposed datasets demonstrate the superiority of FedStyle.



federated learning, contrastive learning, art commissions




§ INTRODUCTION

Numerous independent artists in the world are registered in art commission platforms to find possible commercial orders <cit.>.
These platforms enable artists to exhibit artwork examples, await requests, or find user-posted solicitations, such as Artistree, Fiverr, MadeMay, etc. 
Individual artistic styles serve as distinctive markers to identify artists, reflecting the years of training professional artists undergo to cultivate their unique artistic ideals <cit.>. 
However, users seeking commissions, often lacking professional art expertise, struggle to articulate specific individual artistic styles or recall artists aligned with such styles.At best, they can find similar style reference images. Consequently, they are compelled to engage in ceaseless searches or adopt a passive stance, awaiting artists undertaking commissions, as prevailing art commission platforms mainly support keyword retrieval, leaving the style-guided artist retrieval problem unresolved.

To address the aforementioned problem, content-based image retrieval could serve as an alternative solution. However, well-established image search engines such as Google Lens, Tineye, and Yandex mainly retrieve images by global features that highlight similar salient objects, and do not support image retrieval based on similarity in artistic style, which limits their applicability in art commissions.Noticeably, an individual style is typically expressed across the artist's range of works <cit.>. Therefore, style classification is preferable to image retrieval in individual artistic style representation. Specifically, a style-based image classification solution with artists' names as labels is proposed for style-guided artist retrieval. To train a style classification model with satisfactory accuracy, rich artistic images from various contemporary artists should be collected. However, there are persistent challenges in collecting such datasets. First, uploading artistic images to a centralized server poses a risk of data leakage. Second, the development of AI-generated art and associated fine-tuning techniques has fueled artists' reluctance to share their works online <cit.>. Even when some artists do share their artworks, they may also be watermarked <cit.> or pixel-level disturbed <cit.> and unnoticeable to the human eye, making style feature extraction difficult.

In this paper, we propose FedStyle, a Federated Learning crowdsourcing framework for individual artistic Style classification. Federated learning (FL) <cit.> is a privacy-preserving distributed learning paradigm. Motivated by FL, the artists train their own style classification model with local personal artworks and share their model parameters instead of artworks with the server for aggregating a global style classification model. Such collaborative training is not as straightforward as it seems to be in practice. Since each artist only has his/her own style of images, the locally trained model can be easily overfitting and lose the ability to distinguish the artist’s style from others. Meanwhile, the convergence direction of the local models among artists is greatly different, resulting in the poor performance of the aggregated global model. In view of the extreme data heterogeneity problem, FedStyle abstracts and learns the style representation from each artist to regularize the model training and aggregation. It consists of local style training and global style aggregation. The former systematically learns the abstract local style representation, incorporating awareness of local style prediction loss, representation disparities across various styles, and distinctions in representation relative to the server. The latter aggregates these distributed local style representations into the global model with a tiny public dataset, enabling the global model to distinguish various styles. 

The main contributions are summarized as follows:


    
  * We propose FedStyle, the first-of-its-kind style-based FL crowdsourcing framework tailored for art commissions, in which data are extremely heterogeneous.
    
  * Fedstyle learns the style representations along with the model parameters to reduce the impact of data heterogenity on model performance. Besides, we design training loss by introducing contrastive learning to meticuloursly construct the style representation space.
    
  * We manually collect artists' artwork based on their styles as experimental datasets. The quantitative and qualitative evaluation results showed the superiority and reasonableness of FedStyle with higher overall accuracy and F1-score compared to baselines, with the satisfaction from both buyers and artists to FedStyle.




§ RELATED WORK

Style Representation and Learning.
Early efforts by Karayev et al. <cit.> laid the groundwork for artistic style classification by utilizing layer activations from a Convolutional Neural Network, followed by numerous similar studies <cit.>.
Recently, ALADIN <cit.> was proposed to learns fine-grained style embeddings through a multiple-stage encoder, utilizing Adaptive Instance Normalization values and a concatenated AdaIN feature set. A primary limitation of these methods is their assumption of a pre-collected centralized dataset, neglecting considerations of data privacy. Therefore, FL is introduced in the design of FedStyle.

Federated Learning.
As a privacy-preserving distributed learning paradigm, FL is widely used in healthcare, finance, advertising, and various domains <cit.>. However, the local data among clients in FL are usually heterogeneous, making the global aggregated model hard to converge. Many researchers are devoted to solving this problem. FedProx <cit.> incorporates a proximal term to minimize client drift by preventing local parameters from being too far from the global parameters after updates. SCAFFOLD <cit.> and FedDC <cit.> use gradient calibration to fix local drift. Additionally, studies such as MOON <cit.>, FedProto <cit.>, and FedProc <cit.> try to align the local model with the global model at the feature level through local loss design. A recent work, FPL <cit.>, focuses on domain shift and introduces a consistency regularization to better cluster prototypes and construct unbiased prototypes. Most of the aforementioned methods assume that each client has two or more classes of data, failing to cover the case that there is no overlap in data classes between clients, which exists in art commissions.





§ MOTIVATION

As artists may use watermarking to prevent personal artworks from being used for model training in the context of generative AI, we have conducted 2 pre-experiments, trying to figure out 2 questions: whether the presence of cloaked images in the centralized dataset affects the performance of style classification model; how well the classical FedAvg <cit.> works on heterogeneous data distribution settings. We train Artiststyle dataset (cf. <ref>) using Resnet-18 <cit.>.

Poor style classification under the cloaked images. Fig. <ref>(a) illustrates the style classification performance when cloaked images occupy different proportions of the dataset. We randomly select 200 images of 5 classes from Artiststyle for training and cloak some of them by Mist <cit.>, which is a promising image watermarking tool designed for image style protection. As shown in Fig. <ref>(a), the inclusion of cloaked images detracts the model from performing learning task, for the test accuracy declining with the proportion increasing. With the increasing concerns on the data privacy, artists tend to provide cloaked images, but they could not support to train a high-performance model. Thus, we are motivated to provide a distributed crowdsourcing learning solution, which supports artists to train an individual artistic style classification model collaboratively without sharing their artworks.

Poor style classification under the highly heterogeneous images. Fig. <ref>(b) shows the performance of the global model under different data heterogeneity simulations using FedAvg algorithm. 202 Evenly means that the data is evenly and randomly distributed among clients. 203 Dirichlet distribution Dir(α) is used to simulate the heterogeneous settings, with a smaller α indicating the higher heterogeneity. 204 Sorted means each client has only one class of data from the whole dataset, representing the extreme data heterogeneity. It's observed that the accuracy reaches the lowest value when data are arranged following sorted distribution, compared to the highest value when data are distributed evenly. Obviously, the highly heterogeneous setting leads to the serious model drift and significant negative impact on the aggregated global model. It motivates us to explore solutions to address the extreme data heterogeneity problem in FL.





§ METHODOLOGY

Facing the above challenges, we propose FedStyle that learns the style representation for each artist and aggregates all the representations into the global model.



 §.§ System Framework

Fig.<ref> shows the overview of FedStyle. It is essentially a iterative optimization loop of the following four steps.

202 Each client trains its local model and calculates the representation of local unique style based on its personal artworks. During the training, the client would take into account the the local style prediction loss, representation differences with different styles and representation differences with the server. In that way, it reduces the model drift and increases the style distinguishability among clients. 

203 Then they upload their local style representations and model parameters to the central server. 

204 The server weights these distributed local models to form a global model, and further performs global model training to aggregate the distributed local style representations. In that way, the global model obtains knowledge about various style representations and reduces the negative impact of model drift on the global model convergence. 

205 Finally, the global model parameters and style representations are sent back to the client for further optimization. 

Next we would describe the two key steps of local style learning and global style aggregation in detail.



 §.§ Local Style Training

To get a representative abstract style representation, we extract the average embedding vector of the penultimate network layer as the local style representation, and then optimize the representation by keeping it away from other style representations and keeping close with the corresponding global ones and local historical ones. 

Given images of style i from the i-th client's personal artworks D_i, the style is the average value of the embedding vectors of these images,

    m_i^(i) = 1/ |D_i | ∑_(x,y)∈ D_if(x;θ_i)

where m_i^(i) denotes the style representation of client i, with the subscript denoting the index of the local client and superscript denoting the class index. x is the input image and y is the label. f(θ_i) is the embedding function of client i, parameterized by θ_i, and f(x;θ_i) denotes the embeddings of x, extracted from the penultimate layer of a classification model.

Considering local personal artworks in each client is a unique class of data, the local classification model is prone to overfitting. Therefore, to effectively leverage label information, we propose to use contrastive learning <cit.> for local model training, in addition to the generally used loss of classification error. The loss function consists of 3 parts. 202 ℒ_1 minimizes the classification error. 203 ℒ_2 tries to pull the sample embedding close to the style they belong to and keep them isolated from other styles simultaneously. 204 ℒ_3 is designed to align the local style with the respective unbiased global style. The local loss function is defined as follows: 

    ℒ_L(D_i)   =λ_1·ℒ_1(y,y)+λ_2·ℒ_2(m_i^(i),m_i^',m)
       +λ_3·ℒ_3(m_i^(i),m)

where λ_1, λ_2 and λ_3 are importance weights. ℒ_1 is the loss of classification error, ℒ_2 is the contrastive loss and ℒ_3 calculates the mean squared error (MSE) loss. y is the label of x, and y is the output. m_i^' denotes the style sets of client i in the previous round, and m is the global styles, with the overlining denotes that the parameter is from the server. ℒ_2 is defined as:

    ℒ_2(m_i^(i),m_i^',m)   =∑_j=1^C(ℒ_cs(m_i^(i),m_i^(j)')+ℒ_cs(m_i^(i),m^(j)))
       /(ℒ_cs(m_i^(i),m_i^(i)')+ℒ_cs(m_i^(i),m^(i)))

where ℒ_cs calculates the exponential value of the cosine similarity. ℒ_3 is defined as:

    ℒ_3(m_i^(i),m)=ℒ_mse(m_i^(i),m^(i))

The procedure of local style training is shown is Algorithm 1.



 §.§ Global Style Aggregation

The central server is dedicated to training a global classification model from distributed individual artistic styles. Specifically, we collect some public artistic images from the Internet for global model training. The optimization objective for the server is to cluster samples of the same artistic style and furthermore separate different styles by contrasting with local styles. The global loss function can be formulated as

    ℒ_G(D^(i) )   =λ_4·ℒ_1(y,y)+λ_5·ℒ_2(m^(i),m^',m_j^(j)),
       j∈{1,2,⋯,C}

where λ_4 and λ_5 is importance weights. ℒ_1 is the loss of classification and ℒ_2 is the contrastive loss. y is the label of x from style i in the public dataset D^(i), and y is the output. m^(i) and m^' denote the global style i and the previous round global style sets respectively. 
m_j^(j) denotes the collected local style. C is the total number of categories, equal to the total number of local clients. ℒ_2 is defined as:

    ℒ_2(m^(i),m^',m_j^(j))   =∑_j=1^C(ℒ_cs(m^(i),m_j^(j))+ℒ_cs(m^(i),m^(j)'))
       /(ℒ_cs(m^(i),m_i^(i))+ℒ_cs(m^(i),m^(i)'))


The procedure of global style aggregation is shown in Algorithm 2. 





§ EXPERIMENT AND EVALUATION



 §.§ Experiment Setup

Datasets. Different from the general style mentioned in public artwork datasets like Wikiart <cit.>, the individual artistic style represents the distinctive essence of an artist's artworks <cit.>. The style remains stable within a period and may change over his/her career, as also stated by many contemporary artists in a survey <cit.>, leading to the inapplicability of Wikiart sorted by artist in this evaluation. To simulate our targeted scenario as realistically as possible, we recruited 5 artists with over 10 years of experience to help collect artworks with consistent individual artistic styles. We collected two datasets, Artiststyle and Conllustration. 
Artiststyle comprises 5624 artwork images of 26 classes, refined from Wikiart. 

Conllustration is an illustration dataset containing 3238 artworks from 18 contemporary artists. https://github.com/ZpFhnu/Artiststyle18Artiststyle is public online and Conllustration will be made available on request for research only, considering contemporary artists' copyright. More details are in the supplements.

In quantitative experiments, 18 classes out of 26 in Artiststyle and all classes in Conllustration are used for training, respectively. The rest 8 classes of data in Artiststyle are allocated for the framework scalability experiment. Each client has one class of data. It corresponds to each artist having a unique artistic style. Each client uses 80% and 20% data for training and testing, respectively. We select 10% data from the training dataset as the public dataset in the central server. 

Model settings and Implementation Details. We leverage Resnet-18 <cit.> to train the art images. It consists of 17 convolutional layers, 2 batch normalization layers, 4 MaxPool layers, and 4 residual blocks. All the experiments were performed on an NVIDIA 6000 machine, using the Pytorch framework.
We use the SGD optimizer with a learning rate of 0.01 and momentum of 0.5. The entire FL training process lasts for 100 rounds to ensure convergence. The client uploads to the server every 5 local training epochs, and the local batch size is 32 in all experiments.

Baselines. We compare FedStyle with the following baselines. 202 Local refers to training models with the public dataset. 203 FedAvg <cit.> is a classical FL baseline that averages the local model as the global model. 204 FedProx <cit.> utilizes the Euclidean distance between the global model parameters and the local ones as the additional regularization term of the loss function. 205 FedProto <cit.> shares the prototype of each class instead of the model parameter. 206FPL <cit.> constructs cluster prototypes and unbiased prototypes to provide a fair convergent target.









 §.§ Quantitative Evaluation

We evaluate the accuracy and F1-score of FedStyle and baselines on the two datasets. For Artiststyle, λ_1, λ_2, λ_3, λ_4, λ_5 are set to 10, 0.05, 20, 10, 0.005 respectively. For Conllustration, the values of λ_1 and λ_2 are set to 40 and 0.5, respectively. 

The results are as shown in Fig.<ref>. It's observed that our FedStyle obtains optimal or suboptimal accuracy and F1-score on both the two datasets. Specifically, in the last 10 rounds of training on Artiststyle, the average accuracy of FedStyle is 75.12%, followed by FedProx, FedAvg, Local, FPL and FedProto, with accuracy of 72.76%, 68.07%, 67.24%, 63.27% and 57.95%, respectively. Besides, compared to FedProx, FedAvg and Local, our FedStyle achieves model convergence with fewer communication rounds and more stability. From the four line charts, it appears that the performance of FedProto and FPL has been significantly degraded, even worse than the local learning stage (Local) without federated communication, while FedStyle outperforms the best baseline (FedProx) during most of the communication rounds. Local models of each artist may converge in different directions due to extreme heterogeneity, resulting in local optima rather than global optima and degrading FL performance. The results demonstrates that our FedStyle is more effective in the collaborative artistic style learning and classification application, which exhibits the extreme data heterogeneity. 

Framework Scalability.
We further evaluate the model performance under different number of clients. The results are shown in Table <ref>. The N stands for the number of classes, which is also the number of clients. It clearly depicts that compared with other baselines, FedStyle consistently achieves the highest accuracy and higher F1-score in the majority of cases, verifying the scalability of our system.


Ablation Study. We conduct experiments to validate the effect of each loss term of designed local loss ℒ_L(Eq.<ref>), shown in Fig.<ref>. It is found that all components help to improve the performance, showing their necessity and effectiveness. We find ℒ_3 has a greater impact than other components when training on Artiststyle and ℒ_2 a key loss term in enhancing FedStyle's performance when training on Conllustration.



 §.§ Qualitative Assessment


Study setup. We invited 4 artists with over 10 years of professional painting experience and 5 buyers with demands for customized artworks to evaluate the performance of FedStyle. We randomly selected one image from each class in Artiststyle and Conllustration as query images. First, participants were asked to evaluate FedStyle's test results on query images, using a 5-point Likert scale to assess the reasonableness of the results. Second, we conducted semi-structure interviews with them after system testing.

Results. The statistical analysis results are shown in Table <ref>. Avg, D-value, and S.D. represent the mean, range, and standard deviation, respectively. All average scores have passed 3 (neutral), indicating the reasonableness of the testing results given by our system. 

In the interview, artists expressed their willingness to participate in Fedstyle, noting that it can broaden the way they receive commissions while safeguarding their individual artworks. Buyers affirmed that Fedstyle can significantly save the time and effort of discovering preferred artists. All of them certified the availability of style classification. Considering the page limit, we attached more design details and results of the qualitative assessment in the supplements.





§ CONCLUSION

In this paper, we introduce FedStyle, a style-based federated learning crowdsourcing framework dedicated to addressing the real needs of users involved in art commissions, in which data across artists are extremely heterogeneous. It learns the style representation of each artist in addition to model parameters to reduce the model drift among artists. 
Extensive experiments demonstrate FedStyle's effectiveness.


In the future, there will be a consideration of fine-grained factors for a more professional-style analysis. Efforts will be made to address practical challenges like communication costs when deploying FedStyle in real-world scenarios. 













IEEEbib


