Uneven solar irradiance across photovoltaic (PV) modules — commonly caused by shadows from clouds, trees, or nearby structures — leads to substantial energy losses and degrades the overall performance of large-scale PV installations. When modules receive different levels of sunlight, power mismatch develops within the array, and the power-voltage curve exhibits multiple peaks, making it difficult for standard maximum power point tracking methods to function effectively. To address these limitations, this work introduces a hybrid intelligent framework that combines Particle Swarm Optimization (PSO) with a Deep Neural Network (DNN) to enable dynamic, real-time reconfiguration of PV array electrical connections. Rather than relying on fixed wiring topologies, the proposed system continuously evaluates shading patterns detected by light-dependent resistor (LDR) sensors and adjusts relay-switching configurations through an Arduino-controlled matrix to maximize power output at any given moment. The DNN component is trained on operational data comprising voltage, current, irradiance, and temperature measurements to identify and classify abnormal operating states including open-circuit failures, short-circuit faults, and partial shading events. The PSO component handles the combinatorial optimization of switching sequences to minimize current mismatch across parallel strings. Simulation experiments conducted under a range of shading intensities — from mild and moderate to severe and dynamically varying conditions — confirm that the proposed PSO-DNN framework delivers superior power recovery, lower energy losses, and faster system response in comparison with conventional static configurations. The solution is particularly suitable for cost-sensitive and decentralized solar energy deployments.