This paper focuses on an image sensor communication system that uses an LED as the transmitter and a high-speed image sensor (camera) as the receiver. Communication in this scheme depends on the quality of images transmitted from the LED to the sensor. If the image becomes unfocused on the way to the receiver, the LED luminance that make up the signal cannot be detected, so the receiver cannot demodulate the signal data. To overcome this problem, this study proposes a novel demodulation scheme to recover data from a degraded image, based on a maximum likelihood decoding (MLD) algorithm. The proposed method creates template images that imitate all possible blinking patterns produced by the LED transmitter, and then calculates the Euclidean distances between pixels in the captured image and the pseudo images for all possible blinking patterns. Finally, the algorithm chooses the image template with the smallest Euclidian distance from the received signal as the recovered data. Though an exhaustive set of image templates must be prepared for the proposed MLD, the number of templates depends on the number of LEDs on the transmitter. Thus, the computational complexity of this method increases as the number of transmitter LEDs increases. To reduce the computational complexity of the proposed MLD algorithm, the binary differential evolution (BDE) algorithm is used, which is a swarm intelligence technique. Computer simulations are used to evaluate the BDE algorithm's usefulness for reducing computational complexity and improving the BER of the communication system.