1. Introduction
Tobacco is a cash crop with a large planting area in the world, and China is one of the countries with the largest production and consumption of tobacco. The tobacco industry has an important economic position in China, providing a large number of jobs and contributing to the country's tax revenue. Tobacco farming in central and western China plays a key role in farmers' incomes and local economic development.
With the trend of global agricultural modernization, the tobacco industry is also gradually promoting digital transformation to improve production efficiency and quality. This change plays a vital role in enhancing the competitiveness of the tobacco industry [1]. The tobacco baking process requires strict classification and identification work in order to standardize the baking, match the appropriate baking process, and improve the quality of tobacco baking. The recognition of tobacco maturity and curing stage is very important for tobacco curing. Tobacco leaves with different maturity have different curing characteristics, and manual classification makes it difficult to form a unified standard and costs manpower [2]. The recognition and classification of tobacco maturity and baking stage by machine vision technology can reduce the matching difficulty, improve tobacco baking quality, and reduce baking loss [3]. Through machine vision technology, it can automatically identify the maturity and baking stage of tobacco leaves, reduce the subjective judgment of basters, and improve the stability of the process and product quality. Through machine vision technology, the intelligent recognition of tobacco maturity and baking stage can be realized, which provides technical support for improving tobacco baking quality and realizing automatic baking [4].
In the domain of research, the ResNet model, an evolution of the highly respected ResNet architecture, is known for its effectiveness in executing deep learning challenges, particularly in the area of image classification [5]. The utility of such models in agricultural contexts, like crop classification and health monitoring, has been affirmed through extensive research. Kaiming introduced the foundational ResNet model, marking significant advancements in deep learning classification endeavors [6]. In order to tackle the aforementioned issues, Kaiming and his colleagues introduced Residual Networks (ResNet) and achieved first place in the ILSVRC (ImageNet Large Scale Visual Recognition Challenge) in 2015 [7].
ResNet-50d introduces an extended convolution technique based on traditional ResNet, allowing it to analyze a larger range of image details, thus better adapting to the detection of tobacco color changes [8,9].
In this paper, deep learning is used to study the determination of tobacco maturity, and a system for predicting tobacco baking time is designed and implemented. It is of great significance for improving the recognition efficiency and accuracy of tobacco maturity and realizing intelligent tobacco harvesting [10].
2. Methods
2.1. Dataset
The data in this paper comes from the laboratory of Fuzhou University, and there are more than six thousand pictures, which are classified according to the remaining date of baking, as shown in Figure 1. Before formal training, it is necessary to prepare the training set, verification set, and test set, which generally needs to divide all the data according to the ratio of 6:2:2. The statistics of the final tobacco samples collected in this study are shown in Table 1.
Figure 1: Images examples of tobacco leaves with three different remaining baking times (‘7 days’, ‘4 days’, ‘1 day’)
Table 1: Statistical table of tobacco leaf sample
Remaining Baking time | Sample size | training set | verification set | test set |
7 days | 307 | 185 | 61 | 61 |
6 days | 857 | 515 | 171 | 171 |
5 days | 576 | 346 | 155 | 155 |
4 days | 450 | 271 | 89 | 89 |
3 days | 288 | 173 | 57 | 57 |
2 days | 149 | 90 | 29 | 29 |
1 day | 382 | 210 | 76 | 76 |
2.2. Model training
Before the emergence of residual neural networks, deep convolutional neural networks face degradation problems. With the increase of the depth of the network, the accuracy reaches saturation and then decreases rapidly. The residual learning solves the degradation problem and helps to build a deeper layer and better recognition effect of the cuff network model.
In this paper, the residual network ResNet50 is selected as the base model, and the model structure of ResNet50 is shown in Figure 2. The input image of the model is a 3-channel RGB image of dimensions (224,224), The model consists of a convolutional layer, a Max Pool, four types of residual blocks, a global Average Pool layer, and a Fully Connected (FC) layer. The core module is the Residual Block. The basic structure of the residual block consisting of two 1x1 convolutional layers and one 3x3 convolutional layer is the same as that of the 4-class residual block, and the difference is that the number of channels in the convolutional layer is different. For the tobacco baking time prediction dataset, the number of output categories of the fully connected layer is 7.
Figure 2: ResNet50 network model
2.3. Evaluation metrics
It makes sense to use a standardized method for evaluating the classification performance of deep learning algorithms. Currently, the confusion matrix, also known as the error matrix, is commonly used as a visualization method for describing the relationship between the prediction results and the true category attributes of the sample data.
Accuracy is the number of all predictions that are correct as a percentage of the total and is calculated using the following formula:
\( Accuracy=\frac{TP+TN}{TP+FP+FN+TN}\ \ \ (1) \)
Precision refers to the proportion of correct model predictions among all outcomes predicted by the model to be 1 and is calculated as follows. The formula is as follows:
\( Precision=\frac{TP}{TP+FP}\ \ \ (2) \)
Recall is the proportion of all outcomes with a true value of 1 that the model predicts correctly, and is calculated as follows:
\( Recall=\frac{TP}{TP+FN}\ \ \ (3) \)
The F1 value is the result of the combined output of the precision rate and recall rate, the F1 value ranges from 0 to 1, the larger the value, the better the output of the model. Assuming that P is the precision rate and R is the recall rate, the formula is as follows:
\( F1=\frac{2PR}{P+R}=\frac{2TP}{2TP+FP+FN}\ \ \ (4) \)
3. Results and Discussion
3.1. Predict Result
Upon deploying the resnet50d-based model on a dataset of controlled tobacco leaf images captured throughout the baking process, the results demonstrated a high degree of accuracy. As shown in Table 2, the accuracy reaches 0.997. This denotes that the model can predict the baking duration within a minor margin of error, signifying a robust predictive capability.
Table 2: The value of the evaluation metric for the trained model
F1 | Recall | Acc |
0.994 | 0.994 | 0.997 |
Figure 3 shows training and validation accuracy/loss during the process. Looking closely at Figure 3, it can be noticed that a significant drop in accuracy in the tenth round of training, could be due to multiple factors, such as fluctuations in the quality of data inputs, model parameter adjustments, or fluctuations in the use of hardware resources. Future experiments may need to further explore the phenomenon to rule out hardware or data issues interfering with the training process.
Figure 3: Training and Validation Accuracy/Loss
3.2. Tobacco baking time prediction system
In order to validate the determination method of tobacco roasting time prediction and apply it to practical scenarios, a tobacco roasting time prediction system was designed in this study to allow users to use the system to analyze the maturity of tobacco images in a simple and fast way.
Flask is a popular Python Web framework that allows developers to create Web applications quickly and easily. This system is about using Flask to visualize the results and display them on a web page, creating interactive and engaging visualizations. The functions and processes of the system are described below:
Users can upload tobacco images to the designated area by clicking or dragging and dropping. After uploading, users can preview the selected images on the page. After uploading the images, the system will automatically predict the tobacco baking time and display the results on the page. For example, in Figure 4 and Figure 5, the system successfully predicted the uploaded tobacco leaf images and obtained the results of the training model.
Figure 4: Prediction display
Figure 5: Recognition result
4. Conclusion
This paper presents research on predicting tobacco baking time, including the acquisition of experimental samples, data pre-processing, establishment and validation of determination methods, and the design and implementation of a tobacco maturity analysis system. However, some deficiencies remain that require improvement. Below are some prospects for future research:
(1) Expanding the diversity of tobacco samples. China's tobacco cultivation area is extensive, and there are many varieties, and the tobacco samples collected in this study include only one variety due to the limitations of time and conditions, and the sample area is not representative of the varieties. Therefore, more tobacco leaves of different varieties should be collected for subsequent research.
(2) Designing a tobacco maturity analysis system for mobile. Users are able to take photos of tobacco leaves and perform predictive analysis through cell phones, and the method requires improvement of the preprocessing algorithm of tobacco leaf images.
(3) Although the ResNet50d model performs well on this prediction, it needs to be compared to other models and may still improve in efficiency or applicability.
References
[1]. Liu, Z. (2023). Tobacco roasting status monitoring and analysis system. Hubei College of Arts and Sciences.
[2]. Kuang, P. (2023). Effects of maturity on color, biochemical changes, and post-baking quality of tobacco during roasting. Guizhou University.
[3]. Jiang, Z. (2023). Research on recognizing tobacco maturity and roasting stage based on machine vision. Southwest University.
[4]. Hao, A. (2022). Research on the algorithm of a tobacco grading system based on convolutional neural network. North China University of Water Resources and Hydropower.
[5]. Li, W. (2023). A solution for gradient vanishing in neural networks. Computer Knowledge and Technology, 19(10), 19-21+28.
[6]. Wang, X., Liu, L., Wang, J., et al. (2024). Research on rock properties recognition of rock images based on convolutional neural ResNet50 residual network. Geotechnical Engineering Technology, 38(03), 294-302.
[7]. Lu, Z. (2022). Research and application of tobacco maturity determination based on ResNet. Guilin University of Electronic Science and Technology.
[8]. Lu, M., Zhou, Q., Jiang, S., et al. (2022). Deep learning and multi-scale feature fusion-based grading method for baked tobacco leaf. Chinese Journal of Agricultural Mechanical Chemistry, 43(01), 158-166.
[9]. Zhang, C., Wang, X., Liu, Z., et al. (2022). Research on real-time recognition of tobacco roasting based on deep learning. Intelligent Agriculture Guide, 2(21), 18-22.
[10]. Chang, Q., Zheng, S., Deng, Y., et al. (2024). Surface defect detection method for bamboo slices based on improved ResNet50 and migration learning. Control and Decision Making, 1-9 [2024-08-31].
Cite this article
Xu,F. (2024). Baking Duration Prediction and Management System Based on Image Features. Applied and Computational Engineering,112,102-107.
Data availability
The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.
Disclaimer/Publisher's Note
The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of EWA Publishing and/or the editor(s). EWA Publishing and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
About volume
Volume title: Proceedings of the 5th International Conference on Signal Processing and Machine Learning
© 2024 by the author(s). Licensee EWA Publishing, Oxford, UK. This article is an open access article distributed under the terms and
conditions of the Creative Commons Attribution (CC BY) license. Authors who
publish this series agree to the following terms:
1. Authors retain copyright and grant the series right of first publication with the work simultaneously licensed under a Creative Commons
Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this
series.
2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the series's published
version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial
publication in this series.
3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and
during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See
Open access policy for details).
References
[1]. Liu, Z. (2023). Tobacco roasting status monitoring and analysis system. Hubei College of Arts and Sciences.
[2]. Kuang, P. (2023). Effects of maturity on color, biochemical changes, and post-baking quality of tobacco during roasting. Guizhou University.
[3]. Jiang, Z. (2023). Research on recognizing tobacco maturity and roasting stage based on machine vision. Southwest University.
[4]. Hao, A. (2022). Research on the algorithm of a tobacco grading system based on convolutional neural network. North China University of Water Resources and Hydropower.
[5]. Li, W. (2023). A solution for gradient vanishing in neural networks. Computer Knowledge and Technology, 19(10), 19-21+28.
[6]. Wang, X., Liu, L., Wang, J., et al. (2024). Research on rock properties recognition of rock images based on convolutional neural ResNet50 residual network. Geotechnical Engineering Technology, 38(03), 294-302.
[7]. Lu, Z. (2022). Research and application of tobacco maturity determination based on ResNet. Guilin University of Electronic Science and Technology.
[8]. Lu, M., Zhou, Q., Jiang, S., et al. (2022). Deep learning and multi-scale feature fusion-based grading method for baked tobacco leaf. Chinese Journal of Agricultural Mechanical Chemistry, 43(01), 158-166.
[9]. Zhang, C., Wang, X., Liu, Z., et al. (2022). Research on real-time recognition of tobacco roasting based on deep learning. Intelligent Agriculture Guide, 2(21), 18-22.
[10]. Chang, Q., Zheng, S., Deng, Y., et al. (2024). Surface defect detection method for bamboo slices based on improved ResNet50 and migration learning. Control and Decision Making, 1-9 [2024-08-31].