With the development of the edge computing, privacy protection problems face new challenges due to the end-to-edge distributed computation on different devices of different owners. In order to protect privacy with high efficiency, we propose an idea of transmitting only the information related to main tasks to remote offloading devices, and keeping the private information on the user device itself or nearby safe devices. This paper proposes a distributed layout privacy protection strategy to ensure the bidirectional tasks of gender recognition and privacy protection. The key is to design a favorable feature extraction module with privacy concealment, which runs on user device or nearby safe device through adversarial fine-tuning. And other modules like attribute feature analysis and inference module and attribute classification module, run on other servers. Two effective privacy protected gender identification methods of the local and global fine-tuning method are proposed. The local fine-tuning method freezes either of the feature extraction module or the inference modules, while global fine-tuning method adjusts the weights of all the modules simultaneously. Experimental results show although the local fine-tuning method is more accurate and effective, the convergence speed of the global fine-tuning method is faster and the training process is more concise.
Citation: Yao Y, Zhao S, Ni Z (2026) Hiding in plain sight: Adversarial identity concealment for facial gender recognition in edge computing. PLoS One 21(11): e0362254. https://doi.org/10.1371/journal.pone.0362254
Editor: Feng Ding, Nanchang University, CHINA
Received: November 3, 2025; Accepted: October 22, 2026; Published: November 20, 2026
Data Availability: No data was generated by this study. The following existing data source was used: the Labeled Faces in the Wild (LFW) dataset from the University of Massachusetts Amherst, available at http://vis-www.cs.umass.edu/lfw/ via web address. The LFW dataset is publicly available for non-commercial research purposes and requires no special access permissions.
Funding: The work of Zhengwei Ni was supported in part by the Tongxiang General Artificial Intelligence Research Institute Project TAGI2-B-2024-0017. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
Competing interests: The authors have declared that no competing interests exist.
With the popularization of intelligent Internet devices such as smart phones and wearable devices, and the real-time performance requirements of various intelligent applications, the limited network bandwidth in the cloud computing architecture will become a bottleneck. Mobile Edge Computing [1] is to offload the computing tasks of users’ intelligent applications to the adjacent edge servers, which can reduce the overhead of local resources, alleviate the communication delay and communication congestion caused by cloud computing, improve the task computing efficiency, and meet the requirements of user application service quality. However, since computing of the tasks are to be offloaded and distributed to edge servers or other service nodes, and the owners of the edge nodes or servers may be in various forms, an emerging privacy protection problem for edge computing arise. For instance, the intermediate processing results of the server probably contain private data, and the attacker may violate the privacy by attacking the task data offloaded to the edge servers [2] or a remote server. Privacy may also be leaked during transmission. The privacy attribute protection provided by the existing edge computing is not perfect.
So far, many privacy protection methods have been proposed. Most of them consider one-time transformation, scrambling, and encryption [3–5], which will introduce a lot of computation load not ignorable for the system.Moreover, the terminal in edge computation environment is very sensitive to computation load increase.
At present, there are many edge intelligent applications including various face attribute features extraction. While identifying certain attributes, there may be a risk of extracting the characteristics of identity attributes at the same time, since there are many correlations between identity features and these task related attributes. It is a great challenge to protect user privacy from being stolen by edge servers, while dispersing tasks on each node without adding extra computation.
Therefore, in this paper, we propose a face image privacy protection method suitable for edge intelligence. We focus on face gender recognition as the main task taking the identity information as the privacy information to discuss the privacy protection strategy. A novel network model is proposed with two feature inference networks for the attributes of gender and identity respectively, and a privacy-concealment feature extraction network with functions of identity feature concealment and gender feature extraction. Through two-way adversarial adjustment through the gradient reversal layer (GRL) [6–8], the information output by the privacy-concealment feature extraction network only includes gender feature, without identity attribute features.
By using the gradient reversal layer (GRL), the identity-sensitive information is blanked at the near-user terminal, so that there is no sensitive information transmitted to the remote server. At the same time, the information related to the main task to transfer to remote devices.
Since this method adopts the adversarial training method [9,10]and has many modules, it is hard to use the global training method to achieve the purpose of gender recognition and identity privacy concealment at one step as most existing networks do. The parameters can easily get trapped in local optima. To solve it, we propose multi-step training methods based on sub-module training which employ specific loss functions to iteratively update specific module parameters.
The contributions of this paper can be summarized as follows:
The rest of this paper is organized as follows. In Section II, we discuss the related work. In Section III, we present our ideas and the proposed approach. Our method is experimentally evaluated in Section IV. Section V summarizes the full paper.
In edge intelligence, uploading data to edge servers introduces challenges to privacy protection. Privacy protection for machine learning applications may cause significant computing costs [11–13], making privacy protection in edge computing more challenging. Meanwhile, most of present works of image privacy protection are for face recognition applications [14,15], but not for recognition of other facial attributes.
For example, Wang et al. [16] propose a privacy preserving facial recognition technology based on convolutional neural networks, which is used for facial feature extraction. In order to overcome the problem of privacy leakage, a nearest neighbor algorithm for calculating cosine similarity on encrypted feature vectors is proposed. But the encryption process introduces enormous computational complexity. Cheng et al. [17] propose a privacy protection scheme based on secure nearest neighbor algorithm, which can calculate and compare the cosine similarity of feature vectors under real ciphertext. Then the encrypted data is distributed to edge computing devices through cloud server. Similar to the work in [16] the encryption process introduces enormous computational complexity. The encryption enormous computational cost is not ignorable to the terminal in edge computation environment, which is very sensitive to computation load increase.
With the proposal of federated learning [18], some researchers introduce federated learning into edge computing. In federated learning, multiple participating devices have their own local data. These participants do not need to upload data to a central server, but instead train a unified model through shared model updates [19]. For example, Liu et al. [20] propose a privacy protection framework named P2FEC combining federated learning and edge computing, which can build a unified deep learning model across multiple users or devices without uploading their data to a centralized server. Lu et al. [21] propose a privacy protection data sharing mechanism for distributed multi-party Internet of Things(IoT) applications, which incorporates federated learning into the licensed blockchain. However, federated learning requires a large amount of communication between the client and servers, which lead to low communication efficiency. At the same time, due to the scattered data on different clients, federated learning cannot use all the data for training like traditional machine learning methods. Different clients may have different amounts and qualities of data, which lead to data imbalance and a decrease in model accuracy.
Current research on edge intelligence generally focuses on optimizing the performance and efficiency of deploying deep learning technology to edge intelligence environments. They solve problems such as Quality of Experience(QoE) [22], task deadline time [23], energy consumption, transmission cost and communication delay [24]. The enormous computational burden brought in by privacy protection remains a problem on edge intelligence.
As edge computing is a relatively new field, there are relatively few related research articles on privacy protection. Thus, we survey other works on multi-server privacy protection such as the Secure Multi-party Computing method [25]. These multi-party security computing methods typically use multiple cloud servers [26,27]. The Secure Multi-party Computing method effectively solves the problem of data privacy and security by computing together among multiple participants without sharing the original data [28]. Ma et al. [29] propose a secure face authentication scheme, that adopts a convolutional neural network to extract the feature vector of the face, use two non-collusion servers to respectively store the user’s encrypted face features and complete face verification. All data is transmitted in ciphertext state, and no other device except the face authentication server can decrypt the data. Cai et al. [30] propose a secure face recognition scheme in a joint outsourcing cloud environment, which can effectively protect the privacy of user data for a semi-trusted model. Haghighat et al. [31] use secure circuits and the secure multi-party computing technology of homomorphic encryption to realize face recognition in the encrypted domain. Secure Multi-party Computing typically involves a large amount of computation and communication between multiple parties, leading to higher computation and communication costs. At the same time, when processing large-scale data, the encryption process significantly slows down computation speed.
The machine learning algorithm operating on the encrypted features, not only serves the purpose that the original data cannot be obtained, i.e., the purpose of privacy protection, but also has the advantages of accurate reasoning and recognition in further steps. However, its encryption technology introduces long calculation delay and high energy consumption to the system [16,17], which requires us to further improve the encryption algorithm.
In terms of privacy protection, early works mainly focus on facial privacy protection in the field of face recognition and location privacy protection in the field of intelligent transportation [32]. Generally, they depend on one time transformation, scrambling, and encryption [33,34]. But it often incurs high computation load not ignorable for the system. The terminal in edge computation environment is very sensitive to computation load increase [13,35]. Therefore, to use machine learning to protect privacy in edge computing, the first problem to be solved is the high computational complexity.
Given that many applications focus on facial attributes rather than facial recognition, we are committed to making contributions in this field. We use adversarial methods in machine learning to directly extract features that do not contain privacy information, which cannot be recovered in subsequent processing. Our method obtains privacy-free features related to face attributes through adversarial training, which only introduces extra computation costs in the training phase. It does not introduce any additional computational burden in real-time computation phase, thus successfully solves the problem of high computational complexity in present privacy works.
In this paper, we take the gender recognition based on face as the main task, the identity as the privacy information to discuss privacy protection strategies in edge computing scenarios. We propose adversarial training methods to ensure the bidirectional tasks of face attribute feature extraction and privacy feature concealment. Especially, we design a good feature extractor to separate the gender information and the sensitive identity information intertwined in the original data domain. As shown in Fig.1, we divide the network into three modules: the privacy concealment feature extraction module with gender feature extraction, the attribute feature analysis and inference module and the attribute classification module. Different modules run on different types of entities as shown in Fig. 1.
The privacy concealment feature extraction module runs on the safe terminals that are relatively close to the user, which can ensure that no privacy features are transmitted to distant edge servers [36,37]. The attribute feature analysis and inference module and the attribute classification module can run on the devices far away from the user, because there is no privacy feature in the modules anymore.
We expect that the output of the privacy concealment feature extraction module can be used in the attribute feature analysis and inference module to achieve the two-fold functions of gender recognition and identity privacy concealment. This training process requires adversarial fine-tuning of the attribute feature analysis and inference modules and the privacy concealment feature extraction module.
This module is composed of a convolutional neural network (CNN). The input to the module is the image dataset with gender classification labels and identity classification labels. The image input is represented as , where X represents the image input space, and the image classification label is , where Y = {1,2,3...k} represents the image classification label space. When classifying gender, k = 2; when classifying identity , the value of d depends on the specific number of identities. The recognition of gender and identity uses the same dataset. In the training stage, the face image formed by the image input x after preprocessing is transformed into an D-dimensional feature vector after the mapping transformation of , and the preliminary feature extraction is completed.
The feature maps extracted by the privacy-concealment feature extraction module will be input to the attribute feature analysis and inference module. The output of the privacy concealment feature extraction module will be divided into two branches, and input into the gender inference and classification module and the identity inference and classification module . represents the weight parameter for gender feature analysis, and represents the weight parameter for the identity feature analysis.
This gender inference module consists of a multi-layer CNN and fully connected layers. We expect that the gender can be recognized by the gender inference module. If it is not the case, fine-tuning on the gender related modules is required to ensure that gender information can be accurately extracted.
The feature maps output by the privacy-concealment feature extraction module is sent to the module for identity inference. When the privacy concealment is not achieved, it will infer the identity information successfully. If this is the case, privacy concealment-feature extraction module will be fine-tuned using the GRL to continue the privacy concealment process.
In the gender model, we gradually improve the category prediction accuracy, and minimize the loss function , as shown in (3).
is the classification label of the actual gender. (2) is the prediction vector of the gender classification.
In the identity model, our purpose is to gradually reduce the category prediction accuracy, and maximize the loss function , as shown in (6).
The purpose of training is to achieve high accuracy of gender recognition and ensure that the accuracy of identity recognition is ultimately lower than 10% for identity privacy protection. If a certain purpose is not achieved, freeze the network of privacy concealment feature extraction or the network of the attribute feature analysis and inference module to iteratively update the network parameters to perform adversarial fine-tuning. The network flow chart is shown in Fig. 2.
The global fine-tuning method is different from the local fine-tuning method. If the purpose of training is not achieved, adversarial global fine-tuning of the relevant modules of identity hiding and gender recognition is required, and the network parameters are updated iteratively. No fixed modules are fixed while fine-tuning the privacy feature concealment module and corresponding feature inference module towards the certain function for gender identification or identity protection. The network flow chart is shown in Fig. 3.
Experiments are performed on the LFW face recognition dataset, which is an unconstrained natural scene face recognition dataset. It consists of more than 13,000 face pictures of famous people with different orientations, expressions and lighting environments. There are more than 5,000 people, of which 1,680 have face pictures more than one. In this experiment, 24 individuals were selected from the LFW database for data training with identity tags 023. Among them, 80% of the pictures are randomly selected for training, and the remaining 20% for testing.
Furthermore, we provide a supplementary clarification regarding the rationale for dataset selection, explicitly articulating the alignment between the unconstrained, in-the-wild characteristics of the LFW dataset and the privacy-preservation objectives of this study. Although contemporary works on facial attribute recognition commonly employ datasets such as CelebA or VGGFace2, which offer more consistent attribute annotations or larger scales, we opt for LFW due to its data distribution encompassing highly diverse variations in pose, expression, and illumination under natural conditions—i.e., the classic “in-the-wild” benchmark. Facial images captured by edge intelligent devices in real-world scenarios are often non-ideal and unconstrained, a condition that LFW emulates effectively. This facilitates a rigorous evaluation, under challenging unconstrained settings, of the proposed method’s effectiveness in suppressing the separability of identity-related privacy features.
Fig 4 shows the parameters of the network model. A uses the GRL to adjust the network to finally extract the gender features without identity features. B and C can realize their respective inference functions through fine-tuning. The network parameters are shown in Table 1.




