The structure optimization of probabilistic neural network is still an unsolved and challenging problem. In this paper, a modified probabilistic neural network is proposed by using affinity propagation. Firstly, the basic probabilistic neural network is presented and the associated problems are analyzed. Then the affinity propagation clustering algorithm is adopted to optimize the structure of the probabilistic neural network. Finally, the proposed probabilistic neural network with affinity propagation is applied in the Iris data classification case. The simulation results show that the proposed method can shrink the number of pattern neurons and improve the accuracy rate of testing samples without the need of extra running time.