Ransomware attacks are becoming one of the most disruptive threats in modern cybersecurity, causing significant financial and operational damage to organizations worldwide. Addressing the limitations of traditional detection techniques, a novel cooperative clustering framework has been introduced, leveraging machine learning to enable real-time collaboration between multiple detection agents across distributed network environments. The system excels in identifying both known and emerging ransomware variants through unsupervised learning algorithms that autonomously group anomalous behaviors while maintaining low false positive rates. Extensive experiments demonstrated that the proposed framework outperforms existing methods in terms of detection accuracy, processing time, and scalability, even under varying network loads and attack complexities. The integration of real-time collaboration between detection agents not only increases resilience against sophisticated ransomware attacks but also ensures a rapid, autonomous response to threats, minimizing the overall impact on the targeted infrastructure. These findings highlight the potential for cooperative clustering to significantly enhance the effectiveness of ransomware detection and mitigation within broader cybersecurity frameworks, offering a scalable and adaptive defense solution.