This task required building a CNN-based model to accurately predict whether an image input to the interface contains a cat or a dog. The built model was trained on 25,000 images at different resolutions to classify images into two classes: cats or dogs. During the training phase, the model extracted features from the input images to correctly classify them.
At the end of each epoch during the analysis phase, the model reported values for the loss function and other metrics, including binary cross-entropy and mean squared error. These metrics assessed how well the model was learning. Once the model was trained, testing was performed to evaluate performance. At this stage, Pearson correlation and accuracy metrics were used to characterize the proportion of correctly classified images (Nasir et al., 2020). As a final validation, the model was tested using a single input image to determine if it contained a cat.
The construction of the interactive application interface for the user was based on the use of the Tkinter library with GUI; several mechanisms underlie this algorithm. First, the interface launches a new Image Prediction window with a single Select the Image button when the code is compiled. Clicking this button opens the user’s folders and lets the user select an image from the computer. Once the client selects an image, it is automatically resized to the required model size (94×125 pixels) and normalized so the model correctly accepts the input.
The result of the predictive classification is displayed in the same window: if the prediction is greater than 0.5, the interface displays the message “It’s a cat,” otherwise, it displays “It’s a dog.” In practice, this is a fairly simple Tkinter-based interface that identifies a person in a photo. Figure 1 below shows the outcomes of using the interface; the results appear valid.

It is worth noting that not every uploaded image is correctly classified. Several strategies could be applied to the model to improve its performance. First, increasing the dataset’s size and diversity is recommended to improve sample representativeness and train the model more finely (Wu et al., 2020).
Secondly, there is a risk of overtraining the model; hence, regularization can help mitigate this threat (Moradi et al., 2020). Thirdly, as an option, convolutional and fully connected layers can be added to learn more complex and deeper features of the data. Finally, one can try to find a pattern in which images are misjudged to consider the field for further modifications.
References
Moradi, R., Berangi, R., & Minaei, B. (2020). A survey of regularization strategies for deep models. Artificial Intelligence Review, 53(6), 3947-3986.
Nasir, I. M., Khan, M. A., Yasmin, M., Shah, J. H., Gabryel, M., Scherer, R., & Damaševičius, R. (2020). Pearson correlation-based feature selection for document classification using balanced training. Sensors, 20(23), 1-18.
Wu, Y., Dobriban, E., & Davidson, S. (2020). Deltagrad: Rapid retraining of machine learning models.