Horizontal atmospheric wind shear causes wind velocity fields to have different directions and speeds. In images of clouds acquired using ground-based sky imaging systems, clouds may be moving in different wind layers. To increase the performance of a global solar irradiance forecasting algorithm, it is important to detect of multiple layers of clouds. The information obtained from a global solar irradiance forecasting algorithm is necessary to optimize and schedule the solar generation resources and storage devices in a smart grid. This investigation studies the performance of unsupervised learning techniques when detecting the number of cloud layers in cloud images. The images are acquired using an innovative infrared sky imaging system mounted on a solar tracker. Different mixture models are used to infer the distribution of the cloud features. The optimal number of clusters in the mixture models is decided after implementing different Bayesian metrics and comparing these with a temporal Ising model. The motion vectors are computed using a pyramidal weighted implementation of the Lucas-Kanade algorithm. The correlations between the cloud velocity vectors and temperatures are analyzed to find the method that leads to the most accurate results. We have found that the temporal Ising model outperformed the detection accuracy of the Bayesian metrics.