Optical-quality transparent, conducting polyaniline (PANI) thin films are suitable candidates for efficient counter electrodes for high-performance solar cells. In the first part of this work, the synthesis of highly uniform and homogenous nanostructured PANI films is reported. The film properties were assessed via scanning electron microscopy, atomic force microscopy, optical profilometry, spectrophotometry, and conductimetry. Simultaneous modeling, optimization and physical characterization of the PANI nanostructured films have not received much attention in the literature. Hence, in the second part, a multi-objective optimization approach with three objectives, namely minimum film thickness, maximum transparency, and maximum conductivity, was performed based on artificial neural network models with a novel k-fold cross-validation technique. The developed models can accurately predict the film characteristics in a wide range of design variables with most residuals remarkably less than 1.0%. Furthermore, after optimization, conductivity was increased three-fold (similar to 2.2 x 10(-1)S/cm) at a good level of transparency (similar to 55%), which suit solar cell applications.