# Computer Vision and Machine Learning-Based Predictive Analysis for Urban Agricultural Systems
## 3 Methodology  
To explore the identified research gaps in forecasting sensor measurements in urban agriculture environments, a novel method is proposed and evaluated in a plant monitoring setup where strawberry plants are grown and monitored. The proposed sensor measurement forecasting method involves capturing and processing images from a thermal camera, then using these thermal images as input to machine learning model for nearby sensor measurement forecasting, for example, light intensity, soil water content, and relative humidity. Informed by the successful forecasting methodologies demonstrated in the two discussed papers [16; 17], a novel model is conceptualized. The proposed architecture (Figure 1) employs a 120 \(\times\) 160 temperature pixel array from thermal images as its primary input, adapting this data for use in a regression model framework. The thermal image (2D array of temperature values) will be preprocessed prior to being used. Colored images are rendered using the default colormap of the camera module software, which is employed to visualize thermal imagery, offering a more distinct representation of the data. However, these colored images are not used during the model training. The model is engineered to leverage the efficiency of convolutional neural network architectures in the processing and analysis of image data, aiming to enhance the precision in forecasting sensor measurement data. As output, the trained model gives a sensor reading at the same date time when the thermal image was taken. The proposed multilayer CNN architecture is an adjustment from \"VGGnet\" [18]-type architectures. It is designed for image analysis with an emphasis on extracting a singular continuous output from visual data. The network begins with an input layer that accepts a 120 \(\times\) 160 pixel image. This input is then processed through a sequence of convolutional layers, where each layer is equipped with numerous filters to detect various features. These filters generate multiple feature maps, increasing the depth of the network. The first convolutional layer reduces the image size, and each subsequent convolutional layer is followed with a max-pooling layer, which further downsizes the spatial dimensions. Max-pooling is a common technique used to reduce the spatial size of the representation to decrease the number of parameters and computation in the network, to also control the overfitting [19]. The convolutional layers, through their hierarchical structure, are designed to capture progressively higher-level features of the input image. This process begins with simple edges and textures, progresses through complex patterns, and parts of objects, and ends by resulting in high-level features that compactly represent the input image. After the last convolutional and max-pooling layer, the data are flattened into a one-dimensional array, which is a common practice before passing the data to the next layers. The architecture then includes a dense layer, which integrates the features extracted by the convolutional layers. This is followed by two more fully connected layers with 128 and 64 neurons, which continue to refine the data for the final output. The last layer is a single neuron to output a single measurement for a sensor, for example, in this study, light intensity, relative air humidity, or soil water content. The proposed CNN regression model could be particularly useful in precision agriculture for monitoring crop conditions by providing multiple continuous sensor measurements from non-contact thermal image data, with an aim to extract as much environmental information as possible only from the thermal images. Also, possibilities to obtain more than one sensor reading from a single thermal image or obtaining one sensor reading from multiple historical thermal images remains, given  
Figure 1: Scheme of proposed model architecture for sensor measurement forecasting.