Abstract
Genetic improvement has been used to improve functional and non-functional properties of software. In this paper, we propose a new approach that applies a genetic programming (GP)-based genetic improvement to trade between functional and non-functional properties of existing software. The paper investigates possibilities and opportunities for improving non-functional parameters such as execution time, code size, or power consumption of median functions implemented using comparator networks. In general, it is impossible to improve non-functional parameters of the median function without accepting occasional errors in results because optimal implementations are available. In order to address this issue, we proposed a method providing suitable compromises between accuracy, execution time and power consumption. Traditionally, a randomly generated set of test vectors is employed so as to assess the quality of GP individuals. We demonstrated that such an approach may produce biased solutions if the test vectors are generated inappropriately. In order to measure the accuracy of determining a median value and avoid such a bias, we propose and formally analyze new quality metrics which are based on the positional error calculated using the permutation principle introduced in this paper. It is shown that the proposed method enables the discovery of solutions which show a significant improvement in execution time, power consumption, or size with respect to the accurate median function while keeping errors at a moderate level. Non-functional properties of the discovered solutions are estimated using data sets and validated by physical measurements on physical microcontrollers. The benefits of the evolved implementations are demonstrated on two real-world problems—sensor data processing and image processing. It is concluded that data processing software modules offer a great opportunity for genetic improvement. The results revealed that it is not even necessary to determine the median value exactly in many cases which helps to reduce power consumption or increase performance. The discovered implementations of accurate, as well as approximate median functions, are available as C functions for download and can be employed in a custom application (http://www.fit.vutbr.cz/research/groups/ehw/median).
Similar content being viewed by others
References
A. Agapitos, S.M. Lucas, Evolving efficient recursive sorting algorithms, in IEEE Congress on Evolutionary Computation, pp. 2677–2684 (2006)
R.H. Chan, C.W. Ho, M. Nikolova, Salt-and-pepper noise removal by median-type noise detectors and edge-preserving regularization. IEEE Trans. Image Process. 14, 1479–1485 (2005)
B. Cody-Kenny, E.G. Lopez, S. Barrett, locoGP: improving performance by genetic programming java source code, in Genetic Improvement 2015 Workshop, ed. by W.B. Langdon, J. Petke, D.R. White (ACM, Madrid, 2015), pp. 811–818
N. Devillard, Fast Median Search: An ANSI C Implementation (1998). http://ndevilla.free.fr/median/median.pdf
Y. Dong, A new directional weighted median filter for removal of random-valued impulse noise. IEEE Signal Process. Lett. 14(3), 193–196 (2007)
E.R. Dougherty, J.T. Astola, (eds.) Nonlinear Filters for Image Processing. SPIE/IEEE Series on Imaging Science and Engineering. SPIE/IEEE (1999)
H. Esmaeilzadeh, A. Sampson, L. Ceze, D. Burger, Neural acceleration for general-purpose approximate programs. Commun. ACM 58(1), 105–115 (2014)
B.W. Goldman, W.F. Punch, Analysis of cartesian genetic programming’s evolutionary mechanisms. IEEE Trans. Evol. Comput. 19(3), 359–373 (2015)
J. Han, M. Orshansky, Approximate computing: An emerging paradigm for energy-efficient design, in Proceedings of the 18th IEEE European Test Symposium, pp. 1–6. IEEE (2013)
M. Harman, B.J. Jones, Search-based software engineering. Inf. Softw. Technol. 43, 833–839 (2001)
W.D. Hillis, Co-evolving parasites improve simulated evolution as an optimization procedure. Phys. D 42(1–3), 228–234 (1990)
H. Juille, Evolution of non-deterministic incremental algorithms as a new approach for search in state spaces, in Genetic Algorithms: Proceedings of the 6th International Conference (ICGA95), ed. by L. Eshelman (Morgan Kaufmann, Pittsburgh, PA, USA, 1995), pp. 351–358
R.E. Kalman, A new approach to linear filtering and prediction problems. Trans. ASME J. Basic Eng. 82(Series D), 35–45 (1960)
D.E. Knuth, The Art of Computer Programming, vol. 3, 2nd edn. (Sorting and Searching. Addison Wesley Longman Publishing Co., Inc, Redwood City, 1998)
W.B. Langdon, M. Harman, Optimizing existing software with genetic programming. IEEE Trans. Evol. Comput. 19(1), 118–135 (2015)
R. Maronna, D. Martin, V. Yohai, Robust Statistics: Theory and Methods, Wiley Series in Probability and Statistics (Wiley, New Jersey, 2006)
D. Martin, C. Fowlkes, D. Tal, J. Malik, A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics, in Proceedings of the 8th International Conference Computer Vision, vol. 2, pp. 416–423 (2001)
J.F. Miller, Cartesian Genetic Programming (Springer, Berlin, 2011)
J.F. Miller, S.L. Smith, Redundancy and computational efficiency in cartesian genetic programming. IEEE Trans. Evol. Comput. 10(2), 167–174 (2006)
V. Mrazek, Z. Vasicek, L. Sekanina, Evolutionary approximation of software for embedded systems: Median function, in Genetic Improvement 2015 Workshop, ed. by W.B. Langdon, J. Petke, D.R. White (ACM, Madrid, 2015), pp. 795–801
K. Nepal, Y. Li, R.I. Bahar, S. Reda, Abacus: A technique for automated behavioral synthesis of approximate computing circuits, in Proceedings of the Conference on Design, Automation and Test in Europe, DATE ’14, pp. 1–6. EDA Consortium (2014)
J. Petke, M. Harman, W.B. Langdon, W. Weimer, Using genetic improvement and code transplants to specialise a C++ program to a problem class, in 17th European Conference on Genetic Programming, LNCS, vol. 8599, ed. by Miguel Nicolau, et al. (Springer, Granada, Spain, 2014), pp. 137–149
R. Poli, W.B. Langdon, N.F. McPhee, A Field Guide to Genetic Programming.Published via http://lulu.com and http://www.gp-field-guide.org.uk (2008)
A. Sampson, W. Dietl, E. Fortuna, Gnanapragasam, D., Ceze, L., Grossman, D.: Enerj: Approximate data types for safe and general low-power computation, in Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 164–174. ACM (2011)
P. Schmidt, Simple median filter library designed for the arduino platform (2014). https://github.com/daPhoosa/MedianFilter
E. Schulte, J. Dorn, S. Harding, S. Forrest, W. Weimer, Post-compiler software optimization for reducing energy, in Proceedings of the 19th International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS’14 (ACM, Salt Lake City, 2014), pp. 639–652
L. Sekanina, Evolutionary design space exploration for median circuits, in Applications of Evolutionary Computing, LNCS 3005, pp. 240–249. Springer (2004)
L. Sekanina, M. Bidlo, Evolutionary design of arbitrarily large sorting networks using development. Genet. Progr. Evolv. Mach. 6(3), 319–347 (2005)
L. Sekanina, Z. Vasicek, Approximate circuits by means of evolvable hardware. in Proceedings of the 2013 IEEE Symposium Series on Computational Intelligence (SSCI), 2013 IEEE International Conference on Evolvable Systems, pp. 21–28. IEEE CIS (2013)
P. Sitthi-Amorn, N. Modly, W. Weimer, J. Lawrence, Genetic programming for shader simplification. ACM Trans. Gr. 30(6), 152:1–152:12 (2011)
J.L. Smith, Implementing median filters in xc4000e fpgas. XCell 23(1), 16 (1996)
T. Sun, Y. Neuvo, Detail-preserving median based filters in image processing. Pattern Recognit. Lett. 16, 341–347 (1994)
V.K. Valsalam, R. Miikkulainen, Using symmetry and evolutionary search to minimize sorting networks. J. Mach. Learn. Res. 14(1), 303–331 (2013)
Z. Vasicek, L. Sekanina, Evolutionary approach to approximate digital circuits design. IEEE Trans. Evol. Comput. 19(3), 432–444 (2015)
Z. Vasicek, K. Slany, Efficient phenotype evaluation in cartesian genetic programming, in Proceedings of the 15th European Conference on Genetic Programming, LNCS 7244, pp. 266–278. Springer Verlag (2012)
S. Venkataramani, A. Sabne, V.J. Kozhikkottu, K. Roy, A. Raghunathan, Salsa: systematic logic synthesis of approximate circuits, in The 49th Annual Design Automation Conference 2012, DAC ’12, pp. 796–801. ACM (2012)
Z. Wang, A. Bovik, H. Sheikh, E. Simoncelli, Image quality assessment: from error visibility to structural similarity. IEEE Trans. Image Process. 13(4), 600–612 (2004)
D.R. White, A. Arcuri, A. John, Evolutionary improvement of programs. IEEE Trans. Evol. Comput. 15(4), 515–538 (2011)
A. Yazdanbakhsh, D. Mahajan, B. Thwaites, J. Park, A. Nagendrakumar, S. Sethuraman, K. Ramkrishnan, N. Ravindran, R. Jariwala, A. Rahimi, H. Esmailzadeh, K. Bazargan, Axilog: Language support for approximate hardware design, in Design, Automation and Test in Europe, DATE’15, pp. 1–6. EDA Consortium (2015)
Acknowledgments
This work was supported by the Czech science foundation project 14-04197S—Advanced Methods for Evolutionary Design of Complex Digital Circuits.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Vasicek, Z., Mrazek, V. Trading between quality and non-functional properties of median filter in embedded systems. Genet Program Evolvable Mach 18, 45–82 (2017). https://doi.org/10.1007/s10710-016-9275-7
Received:
Revised:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10710-016-9275-7