Syntactic Generation of Similar Pictures

  • Nuru Jingili
  • Sigrid EwertEmail author
  • Ian Sanders
Conference paper
Part of the Advances in Intelligent Systems and Computing book series (AISC, volume 947)


In visual password systems it is important to display distractor pictures along with the user’s password picture on the authentication screen. These distractors should be similar to the password picture to make it difficult for shoulder surfers to easily identify the true password picture. In this work, we present approaches to generating similar pictures using bag context picture grammars (BCPGs). We describe how these approaches are implemented and present galleries of pictures that have similar characteristics. We then determine the mathematical similarity of the generated pictures, using the spatial colour distribution descriptor (SpCD). The spatial colour distribution descriptor has been shown to be effective in determining the similarity of computer-generated pictures in previous research, and so was seen as a good similarity measure for this research. We then describe an online survey that was conducted to determine the perceptual similarity of the pictures generated by the picture grammars. This is followed by a comparison of perceptual similarity from the survey with mathematical similarity to determine if the results are consistent. The results show that we can easily generate galleries of pictures that we feel are similar (they have common characteristics) using BCPGs; that SpCD can be used to determine the mathematical similarity of the pictures; and that there is a good correlation between SpCD and perceptual similarity, although in some instances humans do make different judgements. In terms of the desired goal of generating pictures that are similar to a selected picture, we found that controlling the level of refinement of the pictures and limiting the number of refinements of subpictures are important factors.


Syntactic picture generation Picture grammar Regulated rewriting Bag context Mathematical similarity Spatial colour distribution descriptor Perceptual similarity 



This work is based upon research supported by the National Research Foundation (of South Africa). Any opinion, findings and conclusions or recommendations expressed in this material are those of the authors and therefore the NRF does not accept liability in regard thereto. The first author also acknowledges support of the Council for Scientific and Industrial Research of South Africa.


  1. 1.
    Bhika, C., Ewert, S., Schwartz, R., Waruhiu, M.: Table-driven context-free picture grammars. Int. J. Found. Comput. Sci. 18(6), 1151–1160 (2007). Scholar
  2. 2.
    Chatzichristofis, S.A., Boutalis, Y.S., Lux, M.: Img(Rummager): an interactive content based image retrieval system. In: Proceedings of the Second International Workshop on Similarity Search and Applications, SISAP 2009, pp. 151–153. IEEE Computer Society, Washington, DC (2009).
  3. 3.
    Chatzichristofis, S.A., Boutalis, Y.S., Lux, M.: SpCD — spatial color distribution descriptor — a fuzzy rule based compact composite descriptor appropriate for hand drawn color sketches retrieval. In: Proceedings of the International Conference on Agents and Artificial Intelligence (ICAART 2010), Valencia, Spain, vol. 1 (Artificial Intelligence), pp. 58–63, January 2010.
  4. 4.
    Ewert, S.: Random context picture grammars: the state of the art. In: Drewes, F., Habel, A., Hoffmann, B., Plump, D. (eds.) Manipulation of Graphs, Algebras and Pictures, pp. 135–147. Hohnholt, Bremen (2009)Google Scholar
  5. 5.
    Ewert, S., Jingili, N., Mpota, L., Sanders, I.: Bag context picture grammars. J. Comput. Lang. 51, 214–221 (2019). Scholar
  6. 6.
    Goldberger, J., Gordon, S., Greenspan, H.: An efficient image similarity measure based on approximations of KL-divergence between two Gaussian mixtures. In: Proceedings of the Ninth IEEE International Conference on Computer Vision, pp. 487–493. IEEE (2003).
  7. 7.
    Huang, J., Kumar, S., Mitra, M., Zhu, W.J., Zabih, R.: Image indexing using color correlograms. In: Proceedings of the 1997 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, pp. 762–768. IEEE Computer Society (1997).
  8. 8.
    Järvelin, K., Kekäläinen, J.: IR evaluation methods for retrieving highly relevant documents. In: Proceedings of the 23rd Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR 2000, pp. 41–48. ACM, New York (2000).
  9. 9.
    Jingili, N., Ewert, S., Sanders, I.D.: Measuring perceptual similarity of syntactically generated pictures. In: Rango, F.D., Ören, T.I., Obaidat, M.S. (eds.) Proceedings of 8th International Conference on Simulation and Modeling Methodologies, Technologies and Applications, SIMULTECH 2018, Porto, Portugal, 29–31 July 2018. pp. 244–255. SciTePress (2018).
  10. 10.
    Kiranyaz, S., Birinci, M., Gabbouj, M.: Perceptual color descriptor based on spatial distribution: a top-down approach. Image Vis. Comput. 28(8), 1309–1326 (2010). Scholar
  11. 11.
    Le, Q.V., Smola, A.J.: Direct optimization of ranking measures. CoRR abs/0704.3359 (2007).
  12. 12.
    Li, B., Chang, E., Wu, Y.: Discovery of a perceptual distance function for measuring image similarity. Multimedia Syst. 8(6), 512–522 (2003). Scholar
  13. 13.
    Neumann, D., Gegenfurtner, K.R.: Image retrieval and perceptual similarity. ACM Trans. Appl. Percept. (TAP) 3(1), 31–47 (2006). Scholar
  14. 14.
    Okundaye, B., Ewert, S., Sanders, I.: Determining image similarity from pattern matching of abstract syntax trees of tree picture grammars. In: Proceedings of the Twenty-Fourth Annual Symposium of the Pattern Recognition Association of South Africa, pp. 83–90. PRASA, RobMech, AfLaT (2013)Google Scholar
  15. 15.
    Okundaye, B., Ewert, S., Sanders, I.: Perceptual similarity of images generated using tree grammars. In: Proceedings of the Annual Conference of the South African Institute for Computer Scientists and Information Technologists (SAICSIT 2014), pp. 286–296. ACM (2014).
  16. 16.
    Swain, M.J., Ballard, D.H.: Color indexing. Int. J. Comput. Vis. 7(1), 11–32 (1991). Scholar
  17. 17.
    Yamamoto, H., Iwasa, H., Yokoya, N., Takemura, H.: Content-based similarity retrieval of images based on spatial color distributions. In: Proceedings of the 10th International Conference on Image Analysis and Processing, pp. 951–956. IEEE (1999).
  18. 18.
    Zhou, X.S., Huang, T.S.: Relevance feedback in image retrieval: a comprehensive review. Multimedia Syst. 8(6), 536–544 (2003). Scholar

Copyright information

© Springer Nature Switzerland AG 2020

Authors and Affiliations

  1. 1.School of Computer Science and Applied MathematicsUniversity of the Witwatersrand, JohannesburgJohannesburgSouth Africa
  2. 2.School of ComputingUniversity of South AfricaFloridaSouth Africa

Personalised recommendations