A neural network based framework has been developed to search for an optimal wavelet kernel that is most suitable for a specific image processing task. In this paper, we demonstrate that only the low-pass filter, hu, is needed for orthonormal wavelet decomposition. A convolution neural network can be trained to obtain a wavelet that minimizes errors and maximizes compression efficiency for an image or a defined image pattern such as microcalcifications on mammograms. We have used this method to evaluate the performance of tap-4 orthonormal wavelets on mammograms, CTs, MRIs, and Lena image. We found that Daubechies' wavelet (or those wavelets possessing similar filtering characteristics) produces satisfactory compression efficiency with the smallest error using a global measure (e.g., mean- square-error). However, we found that Harr's wavelet produces the best results on sharp edges and low-noise smooth areas. We also found that a special wavelet, whose low-pass filter coefficients are (0.32252136, 0.85258927, 0.38458542, -0.14548269), can greatly preserve the microcalcification features such as signal-to-noise ratio during a course of compression. Several interesting wavelet filters (i.e., the g filters) were reviewed and explanations of the results are provided. We believe that this newly developed optimization method can be generalized to other image analysis applications where a wavelet decomposition is employed.