Intelligent tobacco leaf identification model fine tuning training method and system based on data pruning
The data pruning-based method for fine-tuning the tobacco leaf recognition model addresses manual grading inefficiencies and high computing costs by optimizing the model with a reduced dataset, ensuring efficient and accurate tobacco leaf recognition.
Patent Information
- Application Number
- CN202411310029.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-03
AI Technical Summary
Traditional handmade cigar production relies heavily on manual operations for tobacco leaf grading, which is time-consuming, prone to deviations due to personal subjectivity and environmental factors, and difficult to scale, leading to unstable accuracy and quality control issues. Additionally, existing computer vision and deep learning models for tobacco leaf recognition face challenges with high computing and annotation costs, making it hard to efficiently process new batches of samples.
A data pruning-based method for fine-tuning an intelligent tobacco leaf recognition model, involving data set collection, preprocessing, pre-training, pruning, and fine-tuning using a pre-trained model to reduce dataset size and improve training efficiency, including steps like decoding video streams, data enhancement, and using L1 regularization and cross-entropy functions for model optimization.
The method enables efficient and accurate tobacco leaf recognition by reducing dataset size, minimizing computing and storage requirements, and enhancing model performance, thus improving production efficiency and quality control.
Smart Images

Figure CN119251616A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a data pruning-based intelligent tobacco leaf recognition model fine-tuning training method and system. Background Art
[0002] Traditional handmade cigar production still needs to rely on large-scale manual operations, including steps such as wrapper fermentation, classification and rolling. However, there are some problems with this method: workers need to receive systematic professional training and practice for a period of time to master the necessary skills to make accurate judgments based on the visual characteristics of tobacco leaves. However, due to differences in personal subjective feelings and the influence of environmental factors, manual grading has deviations. Secondly, the preliminary training process for manual grading is complicated and time-consuming, and the training effect is difficult to predict, resulting in low efficiency and unstable accuracy of wrapper grading. As the scale of wrapper processing expands, this will lead to a decline in wrapper quality, restricting the expansion of production scale.
[0003] In addition, the stability of the worker team is poor, and the turnover rate of experienced workers is high, resulting in large fluctuations in raw material grading. At the same time, a large amount of manual work means that the collection of key data still needs to rely on manual records and statistics, such as raw material tracking, processing parameters, and fermentation and aging time. Due to the diversity of materials on site, frequent circulation, complex processes and a large number of workers, it is difficult to accurately grasp the quantity and status information of materials, resulting in difficulties in quality control and resource optimization allocation.
[0004] Therefore, it is of great significance to combine computer vision and deep learning algorithms to identify wrapper tobacco leaves. In the tobacco processing industry, the quality of tobacco leaves directly affects the quality of the final product, so the grading and identification of tobacco leaves is a key link. Traditional tobacco leaf grading relies on manual operation, but there are many problems: workers need professional training to master grading skills, manual grading results have obvious deviations, and manual recording of key information makes quality control difficult.
[0005] In recent years, computer vision and deep learning algorithms have been introduced to improve the efficiency and accuracy of tobacco leaf grading. However, model fine-tuning based on large-scale tobacco leaf data is limited by computing power, storage and annotation costs, which makes it difficult to process new batches of tobacco leaf samples. However, with the continuous increase in new batches of tobacco leaf samples, fine-tuning models using large-scale data faces a series of challenges. First, processing large-scale data requires high-performance computing equipment and a large amount of storage space, which is an expensive investment for many production environments. Secondly, the annotation process is time-consuming and costly, requiring a lot of human resources and time. At the same time, the training process of large-scale data sets is also very time-consuming, making it difficult to respond quickly to changes in production needs. If new batches of tobacco leaf samples cannot be effectively identified and classified in time, it will directly affect production efficiency and product quality. Therefore, in response to these limitations, it is necessary to find more effective methods for model fine-tuning and training to ensure the performance and accuracy of tobacco leaf recognition models. Summary of the invention
[0006] The purpose of the present invention is to provide a method and system for fine-tuning a smart tobacco leaf recognition model based on data pruning, so as to solve the problems in the prior art of time-consuming labeling and recognition of new batches of tobacco leaf samples, affecting production efficiency, etc.
[0007] The present invention solves the above problems through the following technical solutions:
[0008] The fine-tuning training method of the intelligent tobacco leaf recognition model based on data pruning includes:
[0009] Step A: Collect the video data set to be pruned;
[0010] Step B, preprocessing the collected video data set to obtain a training set S, a validation set Y and a test set C;
[0011] Step C: Input the preprocessed tobacco leaf image training set S into the tobacco leaf recognition base model W t Pre-training is performed to obtain a universal and robust tobacco leaf feature representation;
[0012] Step D: Using the pre-trained tobacco leaf recognition base model W t Prune the new tobacco leaf samples x in the tobacco leaf image training set S to form a pruned tobacco leaf sample dataset For subsequent model fine-tuning training;
[0013] Step E: Collect the pruned tobacco leaf sample data set The tobacco leaf sample x' in the input is input into the pre-trained tobacco leaf recognition base model W t , for tobacco leaf recognition model W t Perform fine-tuning training to obtain the tobacco leaf test model W t ”;
[0014] Step F: Input the preprocessed tobacco leaf image test set C into the tobacco leaf test model W t ” for testing.
[0015] As a further improvement, in step B, the collected video data set is preprocessed, and the specific method is as follows:
[0016] B2.1. Decode the video stream captured by the camera to decode the video file into a series of images;
[0017] B2.2. Crop the image according to the requirements;
[0018] B2.3, scale the image to a uniform resolution;
[0019] B2.4. Use data enhancement technology to rotate and flip images to increase the diversity of training data;
[0020] B2.5. Normalize the image pixel values to map the pixel values to a specific range.
[0021] B2.6. Combine the processed images into sequence data in chronological order, and divide the processed sequence data into a training set S, a validation set Y, and a test set C.
[0022] As a further improvement, the decoding of the video stream captured by the camera is implemented through the ffmpeg tool library.
[0023] As a further improvement, the normalization process includes: mapping the decoded image frame m to between 0 and 1 by the following formula:
[0024]
[0025] Among them, m i Represented as the i-th image frame in the video dataset, represents the minimum pixel value of the i-th decoded image frame, represents the maximum pixel value of the i-th decoded image frame, x i Represents the standard value of the i-th decoded image frame after normalization;
[0026] The video dataset after the final normalization is represented as X = [x1, x2, ..., x n ], n means that the video dataset contains a total of n frames.
[0027] As a further improvement, in step C, the pre-processed tobacco leaf image training set S is input into the tobacco leaf recognition base model W t Pre-training, the specific methods include:
[0028] C3.1. Tobacco leaf recognition model W t Including the backbone and classifier C, through the tobacco leaf recognition base model W t The classifier C classifies the tobacco leaf images in the tobacco leaf image training set S and obtains the classification label predicted by the model
[0029] C3.2, use the cross entropy function as the loss function for model training; cross entropy function 1 is represented as follows:
[0030]
[0031] Among them, Y i represents the true classification label of the i-th tobacco leaf sample, represents the model predicted classification label of the i-th tobacco leaf sample;
[0032] C3.3, the size of the model parameters is limited by the L1 regularization loss function, which enables the model to learn sparse features; the expression of the L1 regularization loss function is as follows:
[0033] L = ∑λ|w| (Formula 3);
[0034] λ is a regularization parameter used to balance the importance of task loss and regularization loss; w is the corresponding model parameter.
[0035] As a further improvement, the step C further includes:
[0036] Before C3.1, the preprocessed video dataset is processed into video labels and processed into classification labels Y, Y i ∈Y, as the label for subsequent model training and testing, where the classification label Y is the set of all tobacco grade labels in the preprocessed video dataset, and M represents the total number of categories in the video dataset.
[0037] As a further improvement, in step D, the pre-trained tobacco leaf recognition base model W is used. t Prune the new tobacco leaf samples x in the tobacco leaf image training set S to form a pruned tobacco leaf sample dataset For subsequent model fine-tuning training; specific methods include:
[0038] D4.1. Using the pre-trained tobacco leaf recognition base model W t The backbone of extracts feature F from the new tobacco leaf sample x in the tobacco leaf image training set S, in the expectation that feature F is discriminative; and uses feature F to input the pre-trained tobacco leaf recognition base model W tThe classifier C calculates the metric function L(x,y) to measure the confidence of the tobacco leaf sample x through the metric function L(x,y);
[0039] D4.2. Store the extracted features F in the feature dictionary, and prune the new tobacco leaf samples x in the tobacco leaf image training set S by the dimension n of the feature dictionary to form a pruned tobacco leaf sample dataset.
[0040]
[0041] As a further improvement, in step D, the calculation formula of the metric function L(x, y) is:
[0042] L(x,y)=p(W t ,x) (Formula 4);
[0043] The metric function L(x,y) represents the tobacco leaf recognition base model W for the input training tobacco leaf sample x t The prediction confidence of tobacco leaf sample x is p(W t ,x); p(·) is the distance function, which represents the prediction confidence of the model prediction value after passing through the softmax function and before entering the classifier C.
[0044] As a further improvement, in step E, the pre-trained tobacco leaf recognition base model W t Perform fine-tuning training to obtain the tobacco leaf test model W t ”, the specific methods include:
[0045] The predicted label of the pruned tobacco leaf sample x' is obtained by calculating the metric function
[0046] And use the cross entropy function as the loss function for model training. The cross entropy function 2 is represented as follows:
[0047]
[0048] Among them, Y i represents the true classification label of the i-th tobacco leaf sample, Represents the model predicted classification label of the i-th tobacco leaf sample after pruning.
[0049] As a further improvement of the present invention, the present invention also solves the above-mentioned problem through the following technical solutions:
[0050] The intelligent tobacco leaf recognition model fine-tuning training system based on data pruning includes:
[0051] The data acquisition module, data preprocessing module, model pretraining module, data pruning module, model fine-tuning module and tobacco leaf recognition module are connected in sequence, and the tobacco leaf recognition base model W is adjusted by the intelligent tobacco leaf recognition model fine-tuning training method based on data pruning as described above. t Training is performed to take tobacco leaf images as input and obtain a tobacco leaf recognition model W with predictions of tobacco leaf image samples as output t ”.
[0052] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0053] (1) The present invention uses the pre-trained tobacco leaf recognition base model W t Prune the new tobacco leaf sample x in the tobacco leaf image training set S, and use the pruned tobacco leaf sample dataset Perform subsequent model fine-tuning training; use dataset pruning to enable the model to learn from a smaller and more representative subset of the entire dataset, thereby reducing the size of the training dataset to improve training efficiency.
[0054] (2) For the tobacco leaf recognition model deployed offline on the end system, when adding a new batch of tobacco leaf samples, it is difficult to fine-tune the model based on large-scale tobacco data due to the limitations of computing power, storage and annotation costs. The method of the present invention can solve this problem and achieve efficient tobacco leaf recognition model training by pruning the data set. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a flow chart of the fine-tuning training method of the intelligent tobacco leaf recognition model based on data pruning of the present invention;
[0056] Figure 2 This is a block diagram of the fine-tuning training system of the intelligent tobacco leaf recognition model based on data pruning of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be described in more detail below in conjunction with the drawings in the preferred embodiments of the present application. In the drawings, the same or similar reference numerals throughout represent the same or similar parts or parts with the same or similar functions. The described embodiments are part of the embodiments of the present application, not all of the embodiments. The embodiments described below with reference to the drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limitations on the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0058] The following will be combined Figure 1-2, the data pruning-based intelligent tobacco leaf recognition model fine-tuning training method and system involved in the embodiments of the present application are described in detail. It is worth noting that the following embodiments are only used to explain the present application and do not constitute a limitation on the present application.
[0059] Embodiment 1:
[0060] Combined with Figure 1 As shown, for the tobacco leaf recognition model deployed on the terminal device, the present invention proposes a fine-tuning training method for an intelligent tobacco leaf recognition model based on data pruning, and the specific steps include:
[0061] Step A: Collect the video dataset to be pruned:
[0062] The data acquisition module is used to collect the video data set to be pruned, including obtaining video samples, video annotation information, etc.
[0063] Step B: preprocess the collected video data set to obtain a training set S, a validation set Y, and a test set C;
[0064] In this embodiment, in step B, the data in the video data set from the data acquisition module, i.e., the tobacco leaf data recognized by the camera, is preprocessed by the data preprocessing module, and divided into a training set S, a validation set Y, and a test set C. The specific method is:
[0065] B2.1. Decode the video stream captured by the camera to decode the video file into a series of images so that it can be processed by the model.
[0066] Preferably, the video stream captured by the camera can be decoded by using the ffmpeg tool library, thereby choosing to retain all frames or sample the video at a fixed frame rate to decode the video file into a series of images.
[0067] B2.2. Crop the image as needed to remove unnecessary parts.
[0068] B2.3. Scale the image to a uniform resolution to meet the model input requirements.
[0069] B2.4. We also use a variety of data enhancement techniques to perform data enhancement operations such as rotating and flipping images to increase the diversity of training data.
[0070] B2.5. Normalize the image pixel values, i.e., perform minimum-maximum normalization, to map the pixel values to a specific range.
[0071] The normalization process refers to mapping the decoded image frame m to between 0 and 1 through the following formula to avoid increasing the difficulty of model training due to large differences in data ranges.
[0072]
[0073] In the above formula, m i Represented as the i-th image frame in the video dataset, represents the minimum pixel value of the i-th decoded image frame, represents the maximum pixel value of the i-th decoded image frame, x i Represents the standard value of the i-th decoded image frame after normalization.
[0074] Then, the video dataset after the final normalization is expressed as X = [x1, x2, ..., x n ], n means that the video dataset contains a total of n frames.
[0075] B2.6. Combine the processed images into sequence data in chronological order, and divide the processed sequence data into a training set S, a validation set Y, and a test set C, usually in a specific ratio of 7:1:2.
[0076] The preprocessed video dataset is then input into subsequent modules for training.
[0077] C. Input the preprocessed tobacco leaf image training set S into the tobacco leaf recognition base model W t Pre-training is performed to obtain a universal and robust tobacco leaf feature representation. This process is implemented through the model pre-training module.
[0078] The accuracy and robustness of the classifier C are improved by training and optimizing with a large amount of sample data in the tobacco leaf image training set S.
[0079] In this embodiment, in step C, the pre-processed tobacco leaf image training set S is input into the tobacco leaf recognition base model W t Pre-training, the specific methods include:
[0080] C3.1. Tobacco leaf recognition model W t Including the backbone and classifier C, through the tobacco leaf recognition base model W t The classifier C classifies the tobacco leaf images in the tobacco leaf image training set S and obtains the classification label predicted by the model
[0081] The preprocessed video dataset is also processed into video labels, which are classified into [0, 1, ..., M-1] labels Y, Y i∈Y, as the label for subsequent model training and testing, where the classification label Y is the set of all tobacco grade labels in the preprocessed video dataset, where 0 means that the video belongs to category 0, 1 means that the video belongs to category 1, and so on; M represents the total number of categories in the video dataset.
[0082] C3.2, use the cross entropy function as the loss function for model training; cross entropy function 1 is represented as follows:
[0083]
[0084] In the above formula, Y i represents the true classification label of the i-th tobacco leaf sample, Represents the model predicted classification label of the i-th tobacco leaf sample.
[0085] C3.3, through the L1 regularization loss function to limit the size of the model parameters, so that the model to learn sparse features. The expression of the L1 regularization loss function is as follows:
[0086] L = ∑λ|w| (Formula 3);
[0087] λ is a regularization parameter used to balance the importance of task loss and regularization loss; w is the corresponding model parameter.
[0088] Through the L1 regularization loss function, the features learned by the model can be made as sparse as possible, so that a wider feature space can be covered during subsequent pruning.
[0089] D. Using the pre-trained tobacco leaf recognition model W t Prune the new tobacco leaf samples x in the tobacco leaf image training set S to form a pruned tobacco leaf sample dataset For subsequent model fine-tuning training;
[0090] In this embodiment, in step D, the pre-trained tobacco leaf recognition base model W is used. t Prune the tobacco leaf samples x in the tobacco leaf image training set S to form a pruned tobacco leaf sample dataset This is achieved through the data pruning module to process new varieties or batches of tobacco leaf samples. The specific methods include:
[0091] D4.1. Using the pre-trained tobacco leaf recognition base model W t The backbone of extracts features F from new tobacco leaf samples x in the tobacco leaf image training set S, hoping that these features F can be as discriminative as possible; and uses the features F to input the tobacco leaf recognition base model W tThe classifier C calculates the metric function L(x,y) to measure the confidence of the tobacco leaf sample x through the metric function L(x,y).
[0092] Specifically, a sample is randomly selected from tobacco leaf samples x in the tobacco leaf image training set S, i.e., tobacco leaf samples of a new variety or batch, to extract the feature F of the sample. The tobacco leaf sample x is input into the tobacco leaf recognition base model W using the feature F. t , through the tobacco leaf recognition base model W t The classifier C calculates the metric function L(x,y) and the obtained metric function L(x,y) can measure the confidence of the tobacco leaf sample x.
[0093] Among them, the measurement function of the tobacco leaf sample x is as follows:
[0094] L(x,y)=p(W t ,x) (Formula 4);
[0095] The metric function L(x,y) represents the tobacco leaf recognition base model W for the input training tobacco leaf sample x. t The prediction confidence is p(W t ,x); p(·) is the distance function, which represents the prediction confidence of the model prediction value after passing through the softmax function and before entering the classifier C.
[0096] D4.2. Store the extracted features F in the feature dictionary, and prune the tobacco leaf samples x of the tobacco leaf image training set S by the dimension n of the feature dictionary to form a pruned tobacco leaf sample dataset.
[0097] Specifically, by sorting the prediction confidence of the current batch of samples, the top n samples with the highest confidence are saved as the pruning results of the current batch of tobacco leaf samples x, forming a pruned tobacco leaf sample data set expressed as This makes fine-tuning the tobacco leaf recognition model more efficient.
[0098] E. The pruned tobacco leaf sample dataset The tobacco leaf sample x' in is input into the tobacco leaf recognition base model W t , for tobacco leaf recognition model W t Perform fine-tuning training to obtain the tobacco leaf test model W t "; This process is achieved through the model fine-tuning module.
[0099] The model fine-tuning module is an important part used to optimize the model pre-training module in the intelligent tobacco leaf recognition process. It loads the model pre-training module, uses the streamlined data set processed by the data pruning module, adjusts the hyperparameters, and conducts further training on these data to update the model parameters, so as to improve the performance and accuracy of the model in specific application scenarios.
[0100] In this embodiment, in step E, based on the tobacco leaf sample data set after pruning, By inputting the pruned tobacco leaf sample x' into the tobacco leaf recognition base model W t The corresponding prediction result is obtained, and the predicted label of the pruned tobacco leaf sample x' is obtained through the metric function calculation
[0101] And use the cross entropy function as the loss function for model training. The cross entropy function 2 is represented as follows:
[0102]
[0103] This is used to train the video understanding model until the expected model accuracy is achieved or the preset maximum number of iterations is reached. This step E does not include limiting the size of the model parameters through the L1 regularization loss function during the pre-training process.
[0104] F. Input the preprocessed tobacco leaf image test set C into the tobacco leaf test model W t "Testing was carried out to make the tobacco leaf test model W t "The label of a new batch of tobacco leaves to be tested can be output; this process is achieved through the tobacco leaf identification module.
[0105] In addition, in the fine-tuning training method, during the pre-training process and the fine-tuning training process, the most efficient model in the training process is extracted based on the recognition accuracy on the validation set Y to ensure the recognition accuracy and efficiency of the model.
[0106] Embodiment 2:
[0107] Combined with Figure 2 As shown, the present invention proposes an intelligent tobacco leaf recognition model fine-tuning training system based on data pruning, comprising:
[0108] The data acquisition module, the data preprocessing module, the model pretraining module, the data pruning module, the model fine-tuning module and the tobacco leaf recognition module are connected in sequence, and the tobacco leaf recognition model W is trained by the intelligent tobacco leaf recognition model fine-tuning training method based on data pruning as described in Example 1. t " is trained to take tobacco leaf images as input and pass the tobacco leaf recognition model W t ” The prediction for the tobacco leaf image sample is given as output.
[0109] Although the present invention is described herein with reference to the illustrative embodiments of the present invention, the above embodiments are only preferred embodiments of the present invention, and the embodiments of the present invention are not limited to the above embodiments. It should be understood that those skilled in the art can design many other modifications and embodiments, which will fall within the scope and spirit of the principles disclosed in this application.
Claims
1. A fine-tuning training method for an intelligent tobacco leaf recognition model based on data pruning, characterized in that: include: Step A: Collect the video data set to be pruned; Step B, preprocessing the collected video data set to obtain a training set S, a validation set Y and a test set C; Step C: Input the preprocessed tobacco leaf image training set S into the tobacco leaf recognition base model W t Pre-training is performed to obtain a universal and robust tobacco leaf feature representation; Step D: Using the pre-trained tobacco leaf recognition base model W t Prune the new tobacco leaf samples x in the tobacco leaf image training set S to form a pruned tobacco leaf sample dataset For subsequent model fine-tuning training; Step E: Collect the pruned tobacco leaf sample data set The tobacco leaf sample x' in the input is input into the pre-trained tobacco leaf recognition base model W t , for tobacco leaf recognition base model W t Perform fine-tuning training to obtain the tobacco leaf test model W t ”; Step F: Input the preprocessed tobacco leaf image test set C into the tobacco leaf test model W t ” for testing.
2. The fine-tuning training method for the intelligent tobacco leaf recognition model based on data pruning according to claim 1 is characterized in that: In step B, the collected video data set is preprocessed, and the specific method is as follows: B2.
1. Decode the video stream captured by the camera to decode the video file into a series of images; B2.
2. Crop the image according to the requirements; B2.3, scale the image to a uniform resolution; B2.
4. Use data enhancement technology to rotate and flip images to increase the diversity of training data; B2.
5. Normalize the image pixel values to map the pixel values to a specific range. B2.
6. Combine the processed images into sequence data in chronological order, and divide the processed sequence data into a training set S, a validation set Y, and a test set C.
3. The fine-tuning training method for the intelligent tobacco leaf recognition model based on data pruning according to claim 2 is characterized in that: The decoding of the video stream captured by the camera is achieved through the ffmpeg tool library.
4. The fine-tuning training method for the intelligent tobacco leaf recognition model based on data pruning according to claim 2 is characterized in that: The normalization process includes: mapping the decoded image frame m to between 0 and 1 by the following formula: Among them, m i Represented as the i-th image frame in the video dataset, represents the minimum pixel value of the i-th decoded image frame, represents the maximum pixel value of the i-th decoded image frame, x i Represents the standard value of the i-th decoded image frame after normalization; The video dataset after the final normalization is represented as X = [x1, x2, ..., x n ], n means that the video dataset contains a total of n frames.
5. The fine-tuning training method for the intelligent tobacco leaf recognition model based on data pruning according to claim 1 is characterized in that: In step C, the pre-processed tobacco leaf image training set S is input into the tobacco leaf recognition base model W t Pre-training, the specific methods include: C3.
1. Tobacco leaf recognition model W t Including the backbone and classifier C, through the tobacco leaf recognition base model W t The classifier C classifies the tobacco leaf images in the tobacco leaf image training set S and obtains the classification label predicted by the model C3.2, use the cross entropy function as the loss function for model training; cross entropy function The representation is as follows: Among them, Y i represents the true classification label of the i-th tobacco leaf sample, represents the model predicted classification label of the i-th tobacco leaf sample; C3.3, the size of the model parameters is limited by the L1 regularization loss function, which enables the model to learn sparse features; the expression of the L1 regularization loss function is as follows: L = ∑λ|w| (Formula 3); λ is a regularization parameter used to balance the importance of task loss and regularization loss; w is the corresponding model parameter.
6. The fine-tuning training method for the intelligent tobacco leaf recognition model based on data pruning according to claim 5 is characterized in that: The step C also includes: Before C3.1, the preprocessed video dataset is processed into video labels and processed into classification labels Y, Y i ∈Y, as the label for subsequent model training and testing, where the classification label Y is the set of all tobacco grade labels in the preprocessed video dataset, and M represents the total number of categories in the video dataset.
7. The fine-tuning training method for the intelligent tobacco leaf recognition model based on data pruning according to claim 1 is characterized in that: In step D, the pre-trained tobacco leaf recognition base model W is used. t Prune the new tobacco leaf samples x in the tobacco leaf image training set S to form a pruned tobacco leaf sample dataset For subsequent model fine-tuning training; specific methods include: D4.
1. Using the pre-trained tobacco leaf recognition base model W t The backbone of extracts feature F from the new tobacco leaf sample x in the tobacco leaf image training set S, in the expectation that feature F is discriminative; and uses feature F to input the pre-trained tobacco leaf recognition base model W t The classifier C calculates the metric function L(x,y) to measure the confidence of the tobacco leaf sample x through the metric function L(x,y); D4.
2. Store the extracted features F in the feature dictionary, and prune the new tobacco leaf samples x in the tobacco leaf image training set S by the dimension n of the feature dictionary to form a pruned tobacco leaf sample dataset.
8. The method for fine-tuning the intelligent tobacco leaf recognition model based on data pruning according to claim 7 is characterized in that: In step D, the calculation formula of the metric function L(x, y) is: L(x,y)=p(W t ,x) (Formula 4); The metric function L(x,y) represents the tobacco leaf recognition base model W for the input training tobacco leaf sample x t The prediction confidence of tobacco leaf sample x is p(W t ,x); p(·) is the distance function, which represents the prediction confidence of the model prediction value after passing through the softmax function and before entering the classifier C.
9. The fine-tuning training method for the intelligent tobacco leaf recognition model based on data pruning according to claim 1 is characterized in that: In the step E, the pre-trained tobacco leaf recognition base model W t Perform fine-tuning training to obtain the tobacco leaf test model W t ”, the specific methods include: The predicted label of the pruned tobacco leaf sample x' is obtained by calculating the metric function And use the cross entropy function as the loss function for model training. The cross entropy function The representation is as follows: Among them, Y i represents the true classification label of the i-th tobacco leaf sample, Represents the model predicted classification label of the i-th tobacco leaf sample after pruning.
10. The intelligent tobacco leaf recognition model fine-tuning training system based on data pruning is characterized by: include: The data acquisition module, the data preprocessing module, the model pretraining module, the data pruning module, the model fine-tuning module and the tobacco leaf recognition module are connected in sequence, and the tobacco leaf recognition base model W is adjusted by the intelligent tobacco leaf recognition model fine-tuning training method based on data pruning according to any one of claims 1 to 9. t Training is performed to take tobacco leaf images as input and obtain a tobacco leaf recognition model W with predictions of tobacco leaf image samples as output t ”.
