Skip to content
Enrique Tomás Martínez Beltrán
HomeResearchPublicationsTeachingBlog
ENES
Contact
HomeResearchPublicationsTeachingBlog
ENES
Contact

Enrique Tomás Martínez Beltrán

Federated learning, trustworthy AI and cyberdefense research, focused on systems that are robust, privacy-preserving and useful in security operations.

  • Privacy Policy
  • Terms of Service
  • Accessibility Statement
  • GitHubopens in a new tab
  • LinkedInopens in a new tab
  • Google Scholaropens in a new tab
  • ResearchGateopens in a new tab
  • ORCIDopens in a new tab
  • Scopusopens in a new tab
  • DBLPopens in a new tab
  • Web of Scienceopens in a new tab

Enrique Tomás Martínez Beltrán. All rights reserved.

Back to top

This site loads optional analytics from Google and external analytics providers only if you accept. You can decline and continue using the site normally.

  1. Home
  2. Research Notes on Federated Learning, Cybersecurity and Cyberdefense
  3. Decentralized Federated Learning: Fundamentals and Applications
DFLFederated LearningAIPrivacyDecentralization

Decentralized Federated Learning: Fundamentals and Applications

Architectures, topologies and security considerations for DFL

Enrique Tomás Martínez Beltrán

Ph.D. Researcher in Federated Learning and Cybersecurity

September 15, 202315 min read
  • LinkedInopens in a new tab
  • Xopens in a new tab
Decentralized Federated Learning: Fundamentals and Applications

Funded by: Fundación Séneca (Science and Technology Agency of the Region of Murcia)

Grant: 21629/FPI/21

Decentralized Federated Learning (DFL)1 is useful in settings where several participants need to train models together but raw data should remain local. Unlike centralized federated learning, DFL reduces the dependence on a single coordinator and moves part of the collaboration logic to the network participants.

DFL is a federated system in which communications are decentralized among the participants of a network. This can reduce the risk of a single point of failure, lower some communication costs, improve scalability, and reduce reliance on a central authority.

Federated Learning Timeline
Federated Learning Timeline

DFL also introduces challenges that need careful study. At its core is the question of how to train collaboratively while preserving privacy and keeping the system robust. By looking at i) DFL architectures, ii) components, iii) topologies, iv) communication protocols, and v) security methods, the main mechanisms and trade-offs become clearer.

Federated Learning Approaches
Federated Learning Approaches

The post also covers trust management and optimization choices, including algorithm selection and performance evaluation. It then looks at applications of DFL in sectors such as healthcare, manufacturing, mobile services, military systems and vehicles, where decentralization can be useful when raw data should not be moved to a central server.

Mathematical Foundations of DFL

Decentralized Aggregation

In DFL, the aggregation process is distributed across the network. A common decentralized formulation can be expressed as:

θi(t+1)=∑j∈Niwij θj(t)+α∇fi(θi(t))\theta_i^{(t+1)} = \sum_{j \in \mathcal{N}_i} w_{ij}\,\theta_j^{(t)} + \alpha \nabla f_i(\theta_i^{(t)})θi(t+1)​=j∈Ni​∑​wij​θj(t)​+α∇fi​(θi(t)​)

Where:

  • θi(t)\theta_i^{(t)}θi(t)​ is the model parameters of node i at iteration t
  • Ni\mathcal{N}_iNi​ is the set of neighbors of node i
  • wijw_{ij}wij​ is the weight of the connection between nodes i and j
  • α\alphaα is the learning rate
  • ∇fi(θi(t))\nabla f_i(\theta_i^{(t)})∇fi​(θi(t)​) is the gradient of the local loss function

Convergence Analysis

The convergence of DFL can be analyzed using an inequality of the following form:

E ⁣[∥θ(t)−θ\*∥2]≤(1−μ)t∥θ(0)−θ\*∥2+σ2μ\mathbb{E}\!\left[\lVert \theta^{(t)} - \theta^\* \rVert^2\right] \leq (1-\mu)^t \lVert \theta^{(0)} - \theta^\* \rVert^2 + \frac{\sigma^2}{\mu}E[∥θ(t)−θ\*∥2]≤(1−μ)t∥θ(0)−θ\*∥2+μσ2​

Where:

  • θ\*\theta^\*θ\* is the optimal solution
  • μ\muμ is the strong convexity parameter
  • σ2\sigma^2σ2 is the variance of the stochastic gradients

DFL Architecture and Components

Network Topology

DFL networks can be organized in various topologies:

  1. Ring Topology: Sequential communication pattern
  2. Mesh Topology: All-to-all communication
  3. Star Topology: Hub-and-spoke communication
  4. Random Graph: Probabilistic connections

Security and Privacy in DFL

Privacy-Preserving Techniques

DFL incorporates several privacy-preserving mechanisms:

  1. Differential Privacy: Adding calibrated noise to gradients
  2. Secure Aggregation: Cryptographic protocols for model aggregation
  3. Homomorphic Encryption: Computing on encrypted data
  4. Zero-Knowledge Proofs: Verifying computations without revealing data

Cyberattack Detection with DFL

Another application scenario is in cyberattack detection. As cyberattacks grow more frequent and sophisticated, detection becomes increasingly challenging. DFL could empower a network of computers to train an ML model to identify suspicious behavior patterns entirely privately and decentralized. This setup could prevent attackers from accessing user data and speed up the detection of such cyber threats.

Real-World Applications

Healthcare

DFL enables collaborative medical AI without sharing sensitive patient data:

Python
class HealthcareDFL:
    def __init__(self):
        self.medical_model = self.build_medical_model()
        self.hospitals = {}
        
    def build_medical_model(self) -> nn.Module:
        """Build model for medical diagnosis"""
        return nn.Sequential(
            nn.Linear(512, 256),
            nn.ReLU(),
            nn.Dropout(0.4),
            nn.Linear(256, 128),
            nn.ReLU(),
            nn.Linear(128, 64),
            nn.ReLU(),
            nn.Linear(64, 10),  # Multi-class medical diagnosis
            nn.Softmax(dim=1)
        )
        
    def train_on_medical_data(self, hospital_id: str, patient_data: torch.Tensor):
        """Train model on local medical data"""
        # Ensure data privacy through local training
        local_model = copy.deepcopy(self.medical_model)
        optimizer = torch.optim.Adam(local_model.parameters(), lr=0.001)
        
        # Training loop with privacy-preserving techniques
        for epoch in range(10):
            optimizer.zero_grad()
            outputs = local_model(patient_data)
            loss = self.calculate_medical_loss(outputs, labels)
            loss.backward()
            optimizer.step()
            
        return local_model

Manufacturing

Industrial IoT applications benefit from DFL for predictive maintenance:

Python
class ManufacturingDFL:
    def __init__(self):
        self.maintenance_model = self.build_maintenance_model()
        self.factories = {}
        
    def build_maintenance_model(self) -> nn.Module:
        """Build model for predictive maintenance"""
        return nn.Sequential(
            nn.Linear(256, 128),
            nn.ReLU(),
            nn.Dropout(0.3),
            nn.Linear(128, 64),
            nn.ReLU(),
            nn.Linear(64, 1),  # Maintenance prediction
            nn.Sigmoid()
        )
        
    def predict_maintenance_needs(self, sensor_data: torch.Tensor) -> float:
        """Predict when maintenance is needed"""
        with torch.no_grad():
            prediction = self.maintenance_model(sensor_data)
            return prediction.item()

Performance Optimization

Communication Efficiency

Python
class CommunicationOptimizer:
    def __init__(self):
        self.compression_ratio = 0.1
        self.sparsification_threshold = 0.01
        
    def compress_gradients(self, gradients: torch.Tensor) -> torch.Tensor:
        """Compress gradients to reduce communication overhead"""
        # Top-k sparsification
        flat_gradients = gradients.flatten()
        k = int(len(flat_gradients) * self.compression_ratio)
        
        _, indices = torch.topk(torch.abs(flat_gradients), k)
        compressed_gradients = torch.zeros_like(flat_gradients)
        compressed_gradients[indices] = flat_gradients[indices]
        
        return compressed_gradients.reshape(gradients.shape)
        
    def adaptive_communication(self, node_id: str, 
                            convergence_rate: float) -> bool:
        """Adaptive communication based on convergence rate"""
        if convergence_rate < 0.01:
            return True  # Communicate more frequently
        else:
            return False  # Reduce communication frequency

Trust Management

Reputation System

Python
class TrustManager:
    def __init__(self):
        self.reputation_scores = {}
        self.contribution_history = {}
        
    def update_reputation(self, node_id: str, contribution_quality: float):
        """Update node reputation based on contribution quality"""
        if node_id not in self.reputation_scores:
            self.reputation_scores[node_id] = 0.5  # Initial neutral score
            
        # Exponential moving average
        alpha = 0.1
        self.reputation_scores[node_id] = (
            alpha * contribution_quality + 
            (1 - alpha) * self.reputation_scores[node_id]
        )
        
    def get_trusted_nodes(self, threshold: float = 0.7) -> List[str]:
        """Get list of trusted nodes above threshold"""
        return [
            node_id for node_id, score in self.reputation_scores.items()
            if score >= threshold
        ]

Future Directions

The future of DFL includes several promising directions:

  1. Quantum-Resistant DFL: Preparing for quantum computing threats
  2. Edge Computing Integration: Optimizing for resource-constrained devices
  3. Cross-Domain DFL: Enabling collaboration across different domains
  4. Explainable DFL: Making DFL decisions interpretable and transparent

Conclusion

Decentralized Federated Learning is a practical direction for collaborative learning when privacy, security and decentralization matter. Its value depends on the details: topology, aggregation, communication costs, robustness and the threat model.

Key insights from this exploration:

  • DFL enables privacy-preserving collaborative learning
  • Blockchain integration enhances trust and traceability
  • Cyberattack detection benefits from decentralized approaches
  • Healthcare and manufacturing are prime application domains
  • Performance optimization is crucial for practical deployment

As DFL continues to evolve, it will play an increasingly vital role in shaping the future of artificial intelligence, particularly in domains where privacy and security are paramount.

Footnotes

  1. Martinez Beltrán, E. T., Quiles Pérez, M., Sánchez Sánchez, P., López Bernal, S., Bovet, G., Gil Pérez, M., Martínez Pérez, G., & Huertas Celdrán, A. (2023). Decentralized Federated Learning: Fundamentals, State of the Art, Frameworks, Trends, and Challenges. IEEE Communications Surveys & Tutorials doi: 10.1109/COMST.2023.3315746 ↩

Related Research

NEBULA: A Platform for Decentralized Federated Learning

March 13, 2025

NEBULA: A Platform for Decentralized Federated Learning

This guide reviews NEBULA as a platform for decentralized federated learning, from basic concepts to applications in healthcare, IoT, and cybersecurity, with practical implementation examples.

Federated Learning Without Sharing Raw Data

January 29, 2024

Federated Learning Without Sharing Raw Data

An introduction to federated learning as a way to train models collaboratively without sharing raw data.