Light-induced segregation limits the practical application of mixed halide perovskites in solar cells. Herein, halide segregation is evaluated by a data-driven approach with constructing a bandgap database of 53,361 mixed ABX3 [where A = Cs, formamidinium (FA) or methylammonium (MA); B = Pb or Sn; X = Br, Cl, or I] perovskites. A transfer learning strategy was employed to fine-tune the parameters of a Graph Neural Network model using experimental and density functional theory (DFT)-calculated bandgaps. This approach accelerated the construction of a unique database, distinguishing it from others primarily focused on ABX3 perovskite element substitution. The database is characterized by continuously varying compositions and accurate bandgaps. It was utilized to calculate the free energy of 20,688 mixed iodine-bromine perovskites and generate corresponding phase diagrams for predicting their light-induced segregation behavior. It is found that the bandgap increases with decreasing ionic radii at the A-site and X-site. This composition-dependent bandgap difference drives halide segregation. Moreover, using a higher Cs content at the A-site, rather than MA, reduces this bandgap difference, enhancing photostability. The proposed data-driven strategy can facilitate the targeted design of novel perovskites with mixed compositions and the investigation of halide perovskite segregation.