Packaging machine empty head detection point detection behavior judgment method based on neural network algorithm
Through the convolutional neural network model based on neural network, the problem of low efficiency and poor accuracy in the existing technology is solved, and the online real-time monitoring and early warning functions with high accuracy are realized.
Patent Information
- Application Number
- CN202411636984.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-01-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the judgment of the empty inspection and inspection behavior of packaging machines is inefficient and not real-time. The accuracy is affected by factors such as the locomotive operation, temporary maintenance and product defects, making it difficult to make accurate judgments effectively.
A convolutional neural network model based on neural network algorithm is used to predict whether the current shift is checked by constructing real-time production records, a convolutional neural network model (CheckCNN) is used to make judgments, and an early warning is given within the specified time.
It improves the accuracy of judging inspection behaviors, realizes online real-time monitoring and early warning functions, reduces the labor intensity of operators, and improves detection efficiency.
Smart Images

Figure CN119296040A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of cigarette equipment detection, and in particular relates to a method for judging the empty head detection and inspection behavior of a packaging machine based on a neural network algorithm. Background Art
[0002] In order to ensure that the empty cigarette detection of the packaging machine can judge the quality defects normally, the workshop stipulates that the operator must complete the artificial simulation test of the corresponding detection within one hour after the normal production starts. This inspection requires manual removal of about 3mm of the top tobacco of a cigarette, inserting it into the cigarette discharge channel, and observing the cigarette passing the inspection (inspection at three cigarette dischargers respectively). If it can be detected normally, the empty cigarette will be rejected at the rejection station (the corresponding trademark paper, bracket paper, and aluminum paper will be rejected). If it cannot be detected normally, the operator must contact the electrical maintenance personnel for maintenance in time.
[0003] This type of inspection behavior can be judged by watching the video on-site, but this method is inefficient and has poor real-time performance. If simple software programming rules are used for judgment, the accuracy of this method will be limited because the judgment of the inspection behavior is affected by factors such as the real-time operation of the locomotive, temporary maintenance, and defects in the product itself.
[0004] Therefore, it is necessary to study a more suitable machine learning algorithm to improve the accuracy of inspection behavior judgment. Summary of the invention
[0005] In order to overcome the above problems, the present invention provides a method for judging the empty head detection and inspection behavior of packaging machines based on a neural network algorithm. This method constructs a convolutional neural network model based on real-time production records to predict whether the current shift will perform corresponding inspections. When the model predicts that the current shift is "not inspected normally" at a specified time, an early warning can be given to remind the operator to perform inspections in a timely manner.
[0006] The technical solution adopted by the present invention to solve the technical problem is: The method for judging the empty head detection and inspection behavior of packaging machines based on neural network algorithm includes: S1 Data Collection Get the production records corresponding to each minute of each shift; The fields corresponding to the production record include: Time X1, cumulative number of shorts X2, cumulative output of strip machines X3, cumulative output of small machines X4, cumulative number of missing branches X5, cumulative number of elastic wall blockage X6, cumulative number of missing branches in mold boxes X7, cumulative number of mold box rejections X8, whether short inspection has been carried out (manual marking results) Y1; Among them: whether the empty inspection was carried out Y1 is used as the true label of each shift. If the value of this field is "normal inspection", it is mapped to 0, that is, a negative sample. If the value is "not normal inspection", it is mapped to 1, that is, a positive sample. S2 Data Preprocessing Find the samples in each shift data where the value of the "Cumulative Number of Short Positions X2" field changes (different from the adjacent sample field value), delete the non-changing data samples, and obtain the changing data samples of each shift, which include positive shift samples (shifts that are not inspected normally) and negative shift samples (shifts that are inspected normally); Each production record whose value in the field "Small Charter Machine Cumulative Output X4" is less than 20,000 is given a flag "number_flag=1", otherwise it is marked "number_flag=0"; Thus, a data set and the fields corresponding to each production record are obtained, and the data of each field is normalized to between 0 and 1 using the MinMaxScaler function; Finally, we get a data set matrix of shape [data_len, feature_dim], denoted as x, where data_len is the number of jumps for each shift, and feature_dim is the number of columns for each shift, which can also be called the number of feature columns; S3 builds a convolutional neural network model Establish a CheckCNN model based on convolutional neural network, which includes two convolutional layers and one maximum pooling layer; The first convolution layer includes 32 convolution kernels, the second convolution layer includes 64 convolution kernels, the kernel size of the pooling layer is 2, the convolution layer and the pooling layer are followed by two fully connected layers for classification, and the output of the convolution layer is flattened and then input into the fully connected layer; S4 model training The entire data set is divided into 70% training set and 30% test set through stratified sampling, which are used for model training and testing respectively; The Adam optimizer was used for model training, with the learning rate set to 0.001. The data set was randomly divided into five parts for five rounds of experiments. This allowed the model to learn the rules of “spot check behavior” in each shift sample data through the data in the training set, adjust its own parameters, and then verify its ability to judge the “spot check behavior” of the shift sample data through the data in the test set. S5 Inspection behavior judgment and prediction The processed production data of the current shift is input as samples into the trained convolutional neural network model, and the model processes and outputs the judgment result y of the shift: whether short inspection has been carried out.
[0007] The beneficial effects brought by the present invention are: The present invention uses the CheckCNN model of the neural network algorithm to achieve a high prediction accuracy in judging the empty inspection behavior of the packaging machine. Through the intelligent analysis of the deep learning algorithm, it can provide basic data analysis functions for management personnel and provide analysis and early warning functions for online real-time monitoring of inspections in the production process.
[0008] While realizing intelligent and rapid identification of the spot inspection behavior of short detection occurring in production, for some inspection tasks, there is an unbalanced ratio of the number of positive and negative samples of "normal spot inspection" and "abnormal spot inspection". The present invention adopts a synthetic minority oversampling method to solve this problem and improve the prediction performance of the model.
[0009] Since the model predicts whether the current shift has performed corresponding inspections based on real-time production records, when the model predicts that the current shift is "not inspected normally" within the specified time (for example, within 1 hour after starting), an early warning can be given to remind the operator to perform inspections in a timely manner, and at the same time notify the manager to urge their behavior. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments: Figure 1 This is a schematic diagram of the convolutional neural network model architecture of Example 1; Figure 2 The distribution diagram of the number of jump records for each shift in Example 1; Figure 3 This is a schematic diagram of the visualization analysis results of positive and negative sample embedding in Example 2; Figure 4 This is a schematic diagram showing the comparison of average accuracy of different models in multiple tests in Example 3; Figure 5 , Figure 6 Schematic diagram of the comparison of ROC curves and PR curves of different models in multiple tests in Example 3. DETAILED DESCRIPTION
[0011] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0012] Example 1 This embodiment is a method for determining the empty head detection and inspection behavior of a packaging machine based on a neural network algorithm, comprising: S1 Data Collection Call the production system data to obtain the production records corresponding to each shift and every minute; The fields corresponding to the production record include: Time X1, cumulative number of shorts X2, cumulative output of strip machines X3, cumulative output of small machines X4, cumulative number of missing branches X5, cumulative number of elastic wall blockage X6, cumulative number of missing branches in mold boxes X7, cumulative number of mold box rejections X8, whether short inspection has been carried out (manual marking results) Y1; Among them, whether the empty inspection was performed Y1 is used as the true label of each shift. If the value of this field is "normal inspection", it is mapped to 0, that is, a negative sample. If the value is "not normal inspection", it is mapped to 1, that is, a positive sample. S2 Data Preprocessing After obtaining the raw data, a series of preprocessing is required for these data: Find the samples in each shift data where the value of the "Cumulative Number of Short Sales X2" field changes (different from the adjacent sample field value). Since the inspection behavior only occurs on production records with change values, delete the non-change production records. The distribution of the number of change records in each shift is as follows: Figure 2 As shown, a total of 147 samples of jump data were obtained for each shift, including 5 positive shift samples (shifts that were not inspected normally) and 142 negative shift samples (shifts that were inspected normally). The number of jump records for the longest shift was 238. Each production record whose value in the field "Small Charter Machine Cumulative Output X4" is less than 20,000 is given a flag "number_flag=1", otherwise it is marked "number_flag=0"; Thus, a data set and the fields corresponding to each production record are obtained, as shown in Table 1: Table 1 Dataset fields
[0013] In addition, the range of some field values in the data is very large, so it is necessary to normalize these data, scale the data by the maximum and minimum values of each field, and unify them to the same scale to facilitate the processing of subsequent models; finally, a data set matrix of shape [data_len, feature_dim] is obtained, denoted as x, where data_len is the number of jumps for each shift, and feature_dim is the number of columns for each shift, which can also be called the number of feature columns; S3 builds a convolutional neural network model Establish a CheckCNN model based on convolutional neural network, refer to Figure 1, which includes two convolutional layers and one maximum pooling layer; since the data of each shift is of different lengths, in order to facilitate model processing, this embodiment also pads the data.
[0014] The first convolution layer includes 32 convolution kernels, the second convolution layer includes 64 convolution kernels, the kernel size of the pooling layer is 2, the convolution layer and the pooling layer are followed by two fully connected layers for classification, and the output of the convolution layer is flattened and then input into the fully connected layer; For the input sample x, the formula of this model is: ; ; ; ; ; Among them, x' represents the input sample data after padding, the activation function is ReLU, W1 and W2 are weight matrices, b1 and b2 are bias vectors; S4 model training After the initial data processing, due to the imbalance of the ratio of positive and negative samples (abnormal spot inspection and normal spot inspection) in the data set, in order to allow the model to better learn the difference between the two, this embodiment uses the SMOTE sampling method to increase the number of positive samples (abnormal spot inspection). The principle is to synthesize some new and similar samples around the samples of the minority class (normal spot inspection in this embodiment) in the data, rather than simply copying the existing samples. This is like creating some new samples "between" the existing samples based on the original samples, which can increase the number of minority class samples, make the data more balanced, and help the model better identify and learn the characteristics of the minority class.
[0015] The embodiment divides the entire data set into 70% training set and 30% test set by stratified sampling, which are used for model training and testing respectively; that is, 147 shifts, of which 102 shifts are used for model training and the other 45 shifts are used for model testing.
[0016] The Adam optimizer was used for model training, with the learning rate set to 0.001. The data set was randomly divided into five parts for five rounds of experiments. The model learned the rules that were strongly related to the generation of "point inspection behavior" in each shift sample data through the data in the training set, adjusted its own parameters, and then used the data in the test set to verify its ability to judge the "point inspection behavior" of the shift sample data. In order to comprehensively evaluate the model performance, this embodiment uses the following classification task evaluation indicators: Accuracy: It indicates the ratio of the number of samples correctly predicted by the model (true positives and true negatives) to the total number of samples, that is, the ratio of the number of correctly classified classes to the total number of classes. TP represents true positives (the number of classes correctly predicted by the model as not having been inspected), TN represents true negatives (the number of classes correctly predicted by the model as having been inspected), FP represents false positives (the number of classes incorrectly predicted by the model as not having been inspected), and FN represents false negatives (the number of classes incorrectly predicted by the model as having been inspected). Accuracy measures the overall ability of the model to make correct predictions. When the distribution of categories in a data set is relatively balanced, accuracy is an intuitive and commonly used performance indicator.
[0017]
[0018] Recall: It indicates the ratio of the number of samples correctly predicted as positive by the model (true positive examples) to the total number of samples actually positive (true positive examples + false negative examples), that is, the ratio of the number of correctly identified unchecked classes to the number of all unchecked classes. It measures the ability of the model to identify positive classes, especially when the data set is unbalanced. Recall is an important indicator because it focuses on the model's ability to identify minority classes.
[0019]
[0020] Precision: Indicates the ratio of the number of samples correctly predicted as positive by the model (true positives) to the total number of samples predicted as positive by the model (true positives + false positives), that is, the ratio of the number of correctly identified uninspected classes to the total number of classes predicted as uninspected classes. It measures the proportion of samples predicted as positive by the model that are actually positive. Precision is a key indicator when the cost of positive prediction is high.
[0021]
[0022] F1 Score: It is the harmonic mean of precision and recall, and is a balance indicator between the two. It is suitable for scenarios that have high requirements for both precision and recall.
[0023]
[0024] Area under the curve (AUC-ROC): The ROC curve is a graph with the false positive rate (FPR) as the horizontal axis and the true positive rate (TPR) as the vertical axis. AUC (Area Under Curve) is the area under the ROC curve, which is used to measure the ability of the classification model to distinguish between positive and negative samples. Among them, FPR is the ratio of false positives (FP) to the total number of samples that are actually negative (false positives + true negatives, FP+TN), and TPR is the ratio of true positives (TP) to the total number of samples that are actually positive (true positives + false negatives, TP+FN).
[0025]
[0026] The closer the mean of the above indicators is to 1, the better the model performance is.
[0027] According to the test results of the embodiment, the average accuracy of the CheckCNN model in five tests reached 0.96, that is, the CheckCNN model correctly predicted 43 of the 45 shifts in the test set; it performed well in the area under the curve (AUC-ROC) indicator, reaching 0.94; at the same time, the values of the CheckCNN model in the three indicators of recall rate, precision rate, and F1 score all reached 0.95, proving its ability to accurately identify shifts that were not inspected normally.
[0028] S5 Inspection behavior judgment and prediction The processed production data of the current shift is input as samples into the trained convolutional neural network model, and the model processes and outputs the judgment result y of the shift: whether short inspection has been carried out.
[0029] By installing and using the 73#ZB45 packaging machine unit in the wrapping workshop, it is verified that the packaging machine empty head detection inspection behavior judgment method based on the neural network algorithm in this embodiment can effectively control the operator's inspection behavior, improve the operator's inspection awareness, and reduce the labor intensity of the traditional video inspection method.
[0030] Example 2 In order to better understand how the model in Example 1 extracts features from data, that is, how the model finds out the rules hidden in the data and related to the behavior of "whether to perform spot inspection", this example will use the trained CheckCNN model to analyze all samples.
[0031] Specifically, we extract the output of the model in the convolutional layer (called embedding), and use t-SNE technology to reduce the dimensionality of these high-dimensional data for easy visualization. t-SNE will project these embeddings to different positions in space, and data of the same category will be closer in space. In this way, we can more intuitively understand the learning ability of the model.
[0032] Figure 3 The result of this visualization is shown in Figure 1. Different colors are used to represent positive samples (Label 0) and negative samples (Label 1). Positive samples represent shifts that have not been inspected, and negative samples represent shifts that have been inspected normally. It can be seen that the distribution of positive samples and negative samples in the figure is very clearly separated. This shows that the CheckCNN model can effectively map different categories of data to different spatial regions, that is, the model can effectively distinguish which shifts have been inspected and which have not been inspected.
[0033] This visualization method not only proves the excellent feature extraction ability of the CheckCNN model again, but also provides a more intuitive way to understand how the model processes and distinguishes different types of shifts. This is of great significance for the subsequent optimization and improvement of the model.
[0034] Example 3 This embodiment will build four deep learning models: CheckDNN, CheckCNN, CheckRNN and CheckLSTM. By comparing the performance of these four models, the processing model that best suits the needs of this application is selected, and the accuracy of shift inspection behavior recognition is improved through multi-model attempts.
[0035] pass Figure 4 The comparison of the average accuracy of the four models after five tests can intuitively show the difference in accuracy of each model. From the comparison results of average accuracy, the CheckCNN model performed best, with an average accuracy of 0.96, that is, of the 45 shifts in the test set, the CheckCNN model correctly predicted the categories of 43 shifts, which was significantly higher than other models. The CheckDNN model was second, with an average accuracy of 0.92, and the average accuracy of the CheckRNN and CheckLSTM models were 0.41 and 0.60 respectively.
[0036] The horizontal axis of the ROC curve is the false positive rate (FPR), and the vertical axis is the true positive rate (TPR). The closer the curve is to the upper left corner, the better the model performance. Ideally, the curve will pass through the point (0,1). AUC-ROC is the area under the ROC curve. The larger the AUC-ROC value, the better the model performance. The horizontal axis of the PR curve is the recall rate (Recall), and the vertical axis is the precision rate (Precision). The more convex the curve is to the upper right corner, the better the model performance. In an unbalanced data set, the PR curve can better reflect the performance of the model for the minority class than the ROC curve. AUPR (Area Under the Precision-Recall Curve) is the area under the PR curve. The higher the AUPR value, the better the model performance.
[0037] This example further analyzes the ROC curve and PR curve ( Figure 5 Figure 6 ), it can be observed that CheckCNN performs well in the area under the curve (AUC-ROC) indicator, reaching 0.94, but performs poorly in the AUPR indicator, reaching only 0.48. This may be because the number of shifts that have not been inspected normally in this dataset is too small, resulting in the model's relatively weak recognition ability for this type of shift. The AUC-ROC and AUPR indicators of the other three models are relatively low.
[0038] Table 2 summarizes the specific values of each model on other evaluation indicators. It can be clearly seen that the CheckCNN model performs best in all indicators, indicating that it has strong adaptability in the shift data classification task.
[0039] Table 2 Comparison of average performance of different models on the test set
[0040] Based on the inventive concept of Example 1, the present invention can also carry out the following exemplary inspection behavior judgment.
[0041] Example 4 In order to ensure that the packaging machine's mold box missing detection can properly judge quality defects, the workshop stipulates that operators must complete the manual simulation test of the corresponding detection within one hour after the start of normal production. This inspection requires manual extraction of a cigarette filter, inserting it into the cigarette discharge channel, and observing the cigarette passing the inspection (inspection at three cigarette dischargers respectively). If it can be detected normally, the missing cigarette will be rejected at the cigarette rejection position (stop corresponding trademark paper, bracket paper, and reject aluminum paper). If it cannot be detected normally, the operator must contact the electrical maintenance personnel for maintenance in time.
[0042] To this end, this embodiment provides a method for determining the behavior of a packaging machine mold box missing support point inspection based on a neural network algorithm. The difference between this embodiment and Embodiment 1 is mainly in the different data collection ranges. The remaining steps can refer to Embodiment 1, which is mainly reflected in: Call the production system data to obtain the production records corresponding to each shift and the opening and closing time of the guard door; The fields corresponding to the production record include: Time X1, cumulative number of missing branches in mold boxes X2, cumulative output of strip packages X3, cumulative output of small packages X4, cumulative number of missing branches X5, cumulative number of elastic ratio blockages X6, cumulative number of empty ends X7, cumulative number of mold box rejections X8, whether mold box missing branch inspection has been carried out (manual marking results) Y1.
[0043] Experimental verification shows that for the inspection behavior judgment of mold box missing branch detection, the CheckCNN model correctly predicted 40 shifts out of 45 test shifts in this task, verifying the superior performance of CheckCNN over other models in the shift data classification task and demonstrating its potential in processing complex data.
[0044] Example 5 In order to ensure that the inner frame paper splicing detection of the packaging machine can properly judge quality defects, the workshop stipulates that operators must complete the artificial simulation test of the corresponding detection within one hour after the start of normal production. This inspection point needs to use a piece of black paper to cover the inner frame paper splicing detection point for a few seconds. If it can be detected normally, the packaging machine will stop and display "Too many inner frame paper splicing heads" and remove them at the eighth wheel position. If it cannot be detected normally, the operator must contact the electrical maintenance personnel for maintenance in time.
[0045] To this end, this embodiment provides a method for judging the splicing inspection behavior of inner frame paper of a packaging machine based on a neural network algorithm. The difference between this embodiment and embodiment 1 mainly lies in the difference in the data collection range. The remaining steps can refer to embodiment 1, which is mainly reflected in: Call the production system data to obtain the production records corresponding to each shift and the opening and closing time of the guard door; The fields corresponding to the production record include: Time X1, cumulative number of inner frame paper splicing X2, cumulative output of strip packaging machine X3, cumulative output of small packaging machine X4, cumulative number of paper without inner frame X5, cumulative number of paper without aluminum paper X6, cumulative number of empty ends X7, cumulative number of missing ends X8, whether inner frame paper splicing inspection has been carried out (manual marking results) Y1.
[0046] The experiment verified that for the inspection behavior judgment of the inner frame paper splicing, the CheckCNN model based on this method correctly predicted 44 shifts out of 45 test shifts in this task, with an accuracy rate of 0.96.
[0047] It should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for judging the empty head detection and inspection behavior of a packaging machine based on a neural network algorithm, characterized in that: include S1 Data Collection Get the production records corresponding to each minute of each shift; The fields corresponding to the production record include: Time X1, cumulative number of shorts X2, cumulative output of strip machines X3, cumulative output of small machines X4, cumulative number of missing branches X5, cumulative number of elastic wall blockage X6, cumulative number of missing branches in mold boxes X7, cumulative number of mold box rejections X8, whether short inspection has been carried out Y1; Among them: Whether the empty inspection was carried out Y1 is used as the true label of each shift. If the value of this field is "normal inspection", it is mapped to 0, that is, a negative sample. If the value is "not normal inspection", it is mapped to 1, that is, a positive sample. S2 Data Preprocessing Find samples in each shift data where the value of the "Cumulative Number of Short Positions Generated X2" field changes, delete the non-changing data samples, and obtain the changing data samples of each shift, which include positive shift samples and negative shift samples; Each production record with a value less than 20,000 in the field "Small Charter Machine Cumulative Output X4" is given a flag "number_flag=1", otherwise it is marked "number_flag=0"; Thus, a data set and the fields corresponding to each production record are obtained, and the data of each field is normalized to between 0 and 1; Finally, we get a data set matrix of shape [data_len, feature_dim], denoted as x, where data_len is the number of jumps for each shift, and feature_dim is the number of columns for each shift, which can also be called the number of feature columns; S3 builds a convolutional neural network model Establish a CheckCNN model based on convolutional neural network, which includes two convolutional layers and one maximum pooling layer; The first convolution layer includes 32 convolution kernels, the second convolution layer includes 64 convolution kernels, the kernel size of the pooling layer is 2, the convolution layer and the pooling layer are followed by two fully connected layers for classification, and the output of the convolution layer is flattened and then input into the fully connected layer; S4 model training The Adam optimizer is used for model training, and the learning rate is set to 0.
001. The data set is randomly divided for multiple experiments, so that the model can learn the generation rules of "spot inspection behavior" in each shift sample data through the data in the training set, adjust its own parameters, and then verify its ability to judge the "spot inspection behavior" of the shift sample data through the data in the test set; S5 Inspection behavior judgment and prediction The processed production data of the current shift is input as samples into the trained convolutional neural network model, and the model processes and outputs the judgment result y of the shift: whether short inspection has been carried out.
2. The method for determining the empty packaging machine inspection behavior according to claim 1, characterized in that: For the input sample x, the formula of the CheckCNN model is: ; ; ; ; ; Among them, x' represents the input sample data after padding, the activation function is ReLU, W1 and W2 are weight matrices, and b1 and b2 are bias vectors.
3. The method for determining the empty packaging machine inspection behavior according to claim 1, characterized in that: The training of the CheckCNN model divides the entire data set into 70% training set and 30% test set through stratified sampling, which are used for model training and testing respectively.