High-speed embroidery machine remote embroidery method and system
By using remote embroidery methods to collect and process embroidery images in real time, identify abnormal situations and adjust parameters, the problem of traditional embroidery machines relying on manual operation is solved, achieving efficient, accurate control and quality assurance of the embroidery machine.
Patent Information
- Application Number
- CN202310758661.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2043-06-26
AI Technical Summary
The existing high-speed embroidery machines rely on manual operation for monitoring and adjusting the embroidery process, resulting in low production efficiency and difficulty in guaranteeing quality. It is also difficult to comprehensively and accurately capture key information and status changes during the embroidery process.
The remote embroidery method is adopted. By acquiring embroidery patterns and positioning information, images are collected in real time and preprocessed. The embroidery area is located, downsampling and feature extraction are performed, a recognition model is built, and abnormal situations are identified in real time and the embroidery machine parameters are adjusted.
It enables remote control of the accuracy and quality of embroidery machines, captures key information and subtle changes, improves production efficiency, and reduces labor costs.
Smart Images

Figure CN116778149B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of embroidery machines, and particularly relates to a remote embroidery method and system for a high-speed embroidery machine. BACKGROUND
[0002] Embroidery technology has a wide range of applications in the clothing, home textile and other industries, and its quality directly affects the appearance and performance of the products. With the development of science and technology, high-speed embroidery machines have become the main equipment for realizing batch production and high-quality embroidery. However, in the traditional embroidery process of high-speed embroidery machines, the monitoring and adjustment of the embroidery process are mostly dependent on manual operation, which not only leads to low production efficiency, but also is prone to quality problems.
[0003] In recent years, remote monitoring technology and intelligent recognition technology have been widely developed, which provides a new way to solve the above problems. However, the existing technical solutions still have certain deficiencies in the following aspects: for example, the real-time monitoring and adjustment of the embroidery process of high-speed embroidery machines are still limited, and it is difficult to comprehensively and accurately capture the key information and state changes in the process.
[0004] Therefore, the present application is proposed. SUMMARY
[0005] In order to solve the above technical defects of the prior art, the present application provides a remote embroidery method and system for a high-speed embroidery machine, which can effectively solve the problems in the background art.
[0006] In order to solve the above technical problems, the technical solution provided by the present application is as follows:
[0007] The embodiment of the present application discloses a remote embroidery method for a high-speed embroidery machine, comprising the following steps:
[0008] Obtaining an embroidery pattern and positioning information, importing the embroidery pattern into the high-speed embroidery machine and positioning the embroidery pattern according to the positioning information;
[0009] Real-time collection of embroidery process images of the high-speed embroidery machine, and pre-processing of the collected images;
[0010] Positioning the embroidery area in the pre-processed image, and real-time capture of a continuous image sequence of the embroidery area;
[0011] Down-sampling the embroidery area image, and feature extraction of the embroidery area image at different resolutions;
[0012] Calculating the similarity of the embroidery area image at different resolutions and the original embroidery pattern;
[0013] Constructing a recognition model to realize real-time abnormal situation recognition of the embroidery area image;
[0014] construct a prediction model based on the similarity calculation result and the abnormal situation, and predict the embroidery process of the high-speed embroidery machine in real time;
[0015] adjust the operation parameters of the high-speed embroidery machine according to the prediction result.
[0016] In any of the above schemes, preferably, the embroidery process image of the high-speed embroidery machine is collected in real time, and the collected image is preprocessed, including the following steps:
[0017] The collected image is subjected to a grayscale operation through the formula: Y = 0.299R + 0.587G + 0.114B, wherein R, G and B are the values of the red, green and blue channels in the color image, and Y is the brightness in the grayscale image.
[0018] The formula is: The pixel points in the grayscale image are subjected to histogram equalization, wherein s k is the equalized pixel value, T(r k ) is the new pixel value to which the pixel with a pixel value of r k is mapped after equalization, p r (r j ) is the probability of the pixel value of r j appearing in the original image, G is the number of gray levels of the image, L and R are the maximum and minimum values of the pixel value, and k is the index value of the pixel gray level.
[0019] In any of the above schemes, preferably, the embroidery area in the preprocessed image is located, and a continuous image sequence of the embroidery area is captured in real time, including the following steps:
[0020] The preprocessed image is convolved through the convolution template of the Sobel operator: The convolution of the preprocessed image is performed to obtain the gradient of each pixel point in the image in the x and y directions;
[0021] The formula is: The gradient amplitude G and the gradient direction θ of each pixel point are calculated, wherein G x and G y are the gradients of the image in the x and y directions, respectively.
[0022] An edge threshold is set, all pixel points in the image with a gradient amplitude greater than the edge threshold are grouped according to the gradient direction, and pixel points with similar gradient directions are classified into the same group, each group of pixel points is connected to obtain a complete embroidery area contour;
[0023] According to the change of the position of the pixel points in the embroidery area contour between adjacent frames, the motion speed and direction of each pixel point in the embroidery area contour on the image plane are calculated.
[0024] In any of the above solutions, preferably, the motion speed and direction of each pixel point in the embroidery region contour on the image plane are calculated according to the change of the pixel point position in the embroidery region contour between adjacent frames, comprising the following steps:
[0025] The difference calculation is performed on the adjacent frame images in the embroidery region contour to obtain the gradients I x ,I y and the derivative I t of the gray value with respect to time t in the x and y directions;
[0026] The motion speed u and direction v of the pixel point (x, y) on the image plane are calculated by the formula:
[0027] I x is the gradient of the image in the x direction, I y is the gradient of the image in the y direction, I t is the gradient of the image in the time dimension, and w(x, y) is a weight coefficient.
[0028] In any of the above solutions, preferably, the embroidery region image is down-sampled, and feature extraction is performed on the embroidery region image at different resolutions, comprising the following steps:
[0029] The Gaussian filtering is performed on the embroidery region image I0(x, y) to obtain the Gaussian blurred image I1(x, y) by the formula: I0(i, j) is the pixel value of the embroidery region image I0(x, y) at position (i, j), and G(x-i, y-j) is the value of the Gaussian kernel at position (x-i, y-j);
[0030] The down-sampling is performed on the Gaussian blurred image I1(x, y) to obtain the image I2(x, y) with a resolution of half of I1(x, y) by the formula: I2(x, y) = I1(2x, 2y), wherein I2(x, y) is the pixel value of the down-sampled image at position (x, y), and I1(2x, 2y) is the pixel value at position (2x, 2y) in the I1(x, y) image;
[0031] The Gaussian filtering is performed on I2(x, y) to obtain the Gaussian blurred image I3(x, y) by the formula:
[0032] The images I n (x, y) at different resolutions are repeatedly obtained, wherein n is the number of layers of the pyramid;
[0033] At each pyramid level, the directional gradient histogram of the image at each local extremum point is calculated, and the gradient direction and magnitude of adjacent pixels, i.e. the angle between them and the keypoint direction, are statistically analyzed to obtain a 128-dimensional feature vector.
[0034] In any of the above schemes, it is preferred that the repetition process yields images I at different resolutions. n (x, y), where n is the number of layers in the pyramid, including:
[0035] For the k-th layer (k = 1, 2, ..., n), calculate the corresponding Gaussian blurred image I. k (x,y) and sampling factor s k ;
[0036] Through the formula: To calculate the image of the layer above the k-th layer, in this formula, For the floor operation, I k-1 (x,y) represents the pixel value at position (x,y) in the image of the next higher level of the pyramid. Position in the current layer of the pyramid The pixel value at position (xi,yj), G(xi,yj) is the value of the Gaussian kernel at position (xi,yj), s k This is the sampling factor for the current layer of the pyramid, i.e., how many pixels apart are sampled once.
[0037] In any of the above schemes, it is preferred that the calculation of the similarity between the embroidery area image at different resolutions and the original embroidery pattern includes the following steps:
[0038] For the original embroidery pattern and the real-time embroidery area image at each scale, the squared difference of the grayscale value of each pixel is performed.
[0039] Through the formula: To obtain the MSE value, in this formula, the total number of N-dimensional pixels, I i K represents the grayscale value of the i-th pixel in the original embroidery pattern. i Let be the grayscale value of the i-th pixel in the embroidery area image;
[0040] Through the formula: Calculate the similarity metric;
[0041] Through the formula:
[0042] weighted_similarity=w1×similarity1+w2×similarity2+...+w n ×similarity n ,calculate
[0043] The similarity index weighted_similarity of the original embroidery pattern and the embroidery area image, in the formula, n is the number of scales, similarity i is the similarity index at the i th scale, w i is the weight at the corresponding scale.
[0044] A similarity threshold is set, and the similarity index of the original embroidery pattern and the embroidery area image is compared with the similarity threshold to obtain a similarity calculation result.
[0045] In any of the above schemes, preferably, the recognition model is constructed, and the embroidery area image is identified in real time for abnormal conditions, including the following steps:
[0046] The CNN model is constructed, and the real-time embroidery area image is input into the CNN model;
[0047] The convolution layer of the CNN model performs convolution operation on the real-time embroidery area image through the formula: h i = σ(w i *x+b i ), to obtain the output feature map h i , in the formula, * is the convolution operation, σ is the activation function, x is the input feature map, w i is the weight of the i th convolution kernel, and b i is the bias term.
[0048] The size of the output feature map is reduced by the pooling layer of the CNN model, and the data amount is reduced, to obtain the feature map after the pooling operation.
[0049] The fully connected layer of the CNN model outputs the abnormal condition category through the formula: y = Wx+b, in the formula, W is the weight matrix of the fully connected layer, b is the bias term, x is the feature vector, and y is the abnormal condition category output by the fully connected layer.
[0050] In any of the above schemes, preferably, the prediction model is constructed based on the similarity calculation result and the abnormal condition, and the embroidery process of the high-speed embroidery machine is predicted in real time, including the following steps:
[0051] The similarity calculation result and the abnormal condition are integrated into a feature vector X t =[SIM t ,A t ], in the formula, SIM t is the similarity index at time t, and A t is the abnormal type at time t.
[0052] The prediction model structure and parameters are defined as: LSTM: W f ,Wi ,W c ,W o ,b f ,b i ,b c ,b o wherein, W f is a forget gate weight matrix, used to calculate a forget gate f t , controlling the influence degree of the cell state C t-1 at the previous moment on the current moment t; W i is an input gate weight matrix, used to calculate an input gate i t , controlling the influence degree of the current input information X t at the current moment t; W c is a candidate cell state weight matrix, used to calculate a candidate cell state C t ilde t ; W o is an output gate weight matrix, used to calculate an output gate o t , controlling the output H t of the cell state C t at the current moment t; b f is a forget gate bias vector, b i is an input gate bias vector, b c is a candidate cell state bias vector, b o is an output gate bias vector;
[0053] The input feature vector X t =[SIM t ,A t ] is input into the LSTM, and forward propagation calculation is performed through the LSTM;
[0054] The prediction result at the t moment is output from the last layer of the LSTM through the formula: Y t =softmax(W o ut*H L +b o ut), wherein, W o ut and b o ut are the weight and bias parameters of the LSTM output layer, and softmax is used to convert the network output into a probability distribution.
[0055] In a second aspect, a high-speed embroidery machine remote embroidery system, the system comprises:
[0056] An acquisition module is configured to acquire an embroidery pattern and positioning information, import the embroidery pattern into the high-speed embroidery machine, and position the embroidery pattern according to the positioning information;
[0057] The acquisition module is used for acquiring the embroidery process image of the high-speed embroidery machine in real time, and pre-processing the acquired image;
[0058] The capture module is used for positioning the embroidery area in the pre-processed image, and capturing a continuous image sequence of the embroidery area in real time;
[0059] The extraction module is used for down-sampling the embroidery area image, and extracting features of the embroidery area image under different resolutions;
[0060] The calculation module is used for calculating the similarity of the embroidery area image under different resolutions and the original embroidery pattern;
[0061] The recognition module is used for constructing a recognition model, and recognizing the abnormal situation of the embroidery area image in real time;
[0062] The prediction module is used for constructing a prediction model based on the similarity calculation result and the abnormal situation, and predicting the embroidery process of the high-speed embroidery machine in real time;
[0063] The adjustment module is used for adjusting the operation parameters of the high-speed embroidery machine according to the prediction result.
[0064] Compared with the prior art, the present application has the following beneficial effects:
[0065] The high-speed embroidery machine remote embroidery method and system provided by the present application can remotely control the operation parameters of the high-speed embroidery machine to perform embroidery operation according to the embroidery pattern, can ensure the accuracy and quality of the remote control of the high-speed embroidery machine embroidery, can effectively capture key information and detail changes in the embroidery process, can evaluate the embroidery quality in real time and find potential problems in time, is beneficial to improve production efficiency and reduce labor cost. BRIEF DESCRIPTION OF DRAWINGS
[0066] The accompanying drawings are used to further understand the present application, together with the embodiments of the present application, to explain the present application, and do not constitute a limitation on the present application.
[0067] Figure 1 is a flowchart of the high-speed embroidery machine remote embroidery method of the present application;
[0068] Figure 2 is a module schematic diagram of the high-speed embroidery machine remote embroidery system of the present application. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and do not limit the present application.
[0070] It is to be noted that when an element is referred to as being "fixed" or "set" on another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or indirectly connected to the other element.
[0071] In the description of the present application, it should be understood that the terms "length", "width", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the purpose of facilitating the description of the present application and simplifying the description, and therefore cannot be understood as indicating or implying that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application.
[0072] In addition, the terms "first", "second" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise explicitly specified.
[0073] In order to better understand the above technical solutions, the technical solutions of the present application will be described in detail below in conjunction with the drawings and specific embodiments of the present application.
[0074] As shown in Figure 1 The present application provides a high-speed embroidery machine remote embroidery method, comprising the following steps:
[0075] Step 1, obtaining embroidery pattern and positioning information, importing the embroidery pattern into the high-speed embroidery machine and positioning the embroidery pattern according to the positioning information;
[0076] Step 2, real-time collection of embroidery process images of the high-speed embroidery machine, and pre-processing of the collected images;
[0077] Step 3, positioning the embroidery area in the pre-processed image, and real-time capturing of the continuous image sequence of the embroidery area;
[0078] Step 4, down-sampling the embroidery area image, and feature extraction of the embroidery area image under different resolutions;
[0079] Step 5, calculating the similarity of the embroidery area image under different resolutions and the original embroidery pattern;
[0080] Step 6, constructing an identification model to identify abnormal conditions in real time;
[0081] Step 7: Based on the similarity calculation results and anomalies, construct a prediction model to predict the embroidery process of the high-speed embroidery machine in real time;
[0082] Step 8: Adjust the operating parameters of the high-speed embroidery machine based on the prediction results.
[0083] In the remote embroidery method for high-speed embroidery machines described in this embodiment of the invention, in order to remotely control the embroidery process of the high-speed embroidery machine, it is first necessary to ensure that the connection and communication between the control device, such as a smartphone or computer, and the sweatshirt machine are normal, which can be achieved through Wi-Fi, Bluetooth, or other wireless communication technologies; furthermore, in order to ensure that only authorized users can remotely control the sweatshirt machine, it is necessary to verify the user's identity.
[0084] Specifically, user identity is verified through the following methods:
[0085] Step 11: The password entered by the user is hashed using the SHA-256 hash algorithm by the client.
[0086] Step 12: Generate a random number using the Fortuna algorithm as a salt to enhance the complexity of the password;
[0087] Step 13: The client connects the username, hashed password, and salt value entered by the user, and uses the formula: MAC v alue = HMAC(shared) k e y Username||H p (assword||salt) calculates the MAC (Message Authentication Code) value. v alue, in this formula, shared k e y HMAC is a message authentication code algorithm based on a hash function, used as a shared key between the client and server. p The assword is the hashed password, salt is the salt value, and || is the concatenation operation;
[0088] Step 14, the client sends the username, salt value, and MAC address. v The message is sent to the server. After receiving the data, the server looks up the corresponding salted hash password in the database based on the username and then recalculates the corresponding message authentication code value, serverMAC. v alue;
[0089] Step 15, compare the received MAC addresses. v alue and serverMAC vIf the values are consistent, the user identity authentication is passed, and if the values are inconsistent, the user request is rejected.
[0090] Specifically, the step 2, the embroidery process image of the high-speed embroidery machine is collected in real time, and the collected image is preprocessed, including the following steps.
[0091] Step 21, the collected image is subjected to a gray-scale operation through a formula: Y=0.299R+0.587G+0.114B, wherein R, G and B are values of red, green and blue three channels in a color image, and Y is brightness in a gray-scale image;
[0092] Step 22, the pixel points in the gray-scale image are subjected to histogram equalization through a formula: k s is a pixel value after equalization, T(r k ) is a new pixel value to which a pixel with a pixel value r k is mapped after equalization, p r (r j ) is a probability that a pixel with a pixel value r j occurs in an original image, G is a gray-scale level of the image, L and R are maximum and minimum values of the pixel value, and k is an index value of the pixel gray-scale level.
[0093] In the high-speed embroidery machine remote embroidery method, the equalization of each pixel in the original image can be calculated, so that the histogram equalization of the image is realized. The probability value of each pixel in the original image is calculated, then the equalization of each pixel is calculated according to the probability value, and finally the processed image is obtained, the histogram equalization of the image can reduce the noise points in the image and enhance the details of the image.
[0094] The step 3, the embroidery area in the preprocessed image is positioned, and a continuous image sequence of the embroidery area is captured in real time, including the following steps.
[0095] Step 31, the preprocessed image is subjected to convolution through a convolution template of a Sobel operator: The convolution of the preprocessed image is performed to obtain the gradient of each pixel point in the image in x and y directions;
[0096] Step 32, the gradient amplitude G and the gradient direction theta of each pixel point are calculated through a formula: x G and G y are gradients of the image in x and y directions, respectively;
[0097] Step 33, set an edge threshold, group all pixel points with gradient amplitude greater than the edge threshold in the image according to the gradient direction, and classify pixel points with similar gradient directions into the same group, and connect each group of pixel points to obtain a complete embroidery region contour;
[0098] Step 34, according to the change of the position of the pixel point in the embroidery region contour between adjacent frames, the motion speed and direction of each pixel point in the embroidery region contour on the image plane are calculated.
[0099] Further, the step 34, according to the change of the position of the pixel point in the embroidery region contour between adjacent frames, the motion speed and direction of each pixel point in the embroidery region contour on the image plane are calculated, including the following steps:
[0100] Step 341, difference calculation is performed on the adjacent frame images in the embroidery region contour to obtain the gradients I x , I y and the derivative I t of the gray value with respect to time t in x and y directions;
[0101] Step 342, the motion speed u and direction v of the pixel point (x, y) on the image plane are calculated by the formula:
[0102] I is the image gray value, in the formula, I x is the gradient of the image in x direction, I y is the gradient of the image in y direction, I t is the gradient of the image in time dimension, and w(x, y) is a weight coefficient.
[0103] In the high-speed embroidery machine remote embroidery method described in the embodiment of the application, the weight coefficient w(x, y) is usually calculated by using a Gaussian window function to eliminate the influence of noise and motion blur, and then through the above formula, the motion speed and direction of each pixel point on the image plane can be obtained, so that the monitoring and tracking of the thread motion trajectory and other information in the embroidery process can be realized.
[0104] The step 4 includes the following steps:
[0105] Step 41, the embroidery region image I0(x, y) is filtered by the formula: to obtain a Gaussian blurred image I1(x, y), in the formula, I0(i, j) is the pixel value of the embroidery region image I0(x, y) at position (i, j), and G(x-i, y-j) is the value of the Gaussian kernel at position (x-i, y-j);
[0106] In step 41, G(x, y) is the value of the Gaussian function at position (x, y), specifically: In the formula, σ is the standard deviation of the Gaussian kernel, the larger the standard deviation, the wider the Gaussian kernel, the more obvious the blurring effect, and vice versa.
[0107] Step 42, downsample the Gaussian blurred image I1(x, y) by the formula: I2(x, y) = I1(2x, 2y), to get an image I2(x, y) with half the resolution of I1(x, y), in the formula, I2(x, y) is the pixel value of the downsampled image at position (x, y), I1(2x, 2y) is the pixel value at position (2x, 2y) in the I1(x, y) image;
[0108] Step 43, Gaussian filter I2(x, y) to get the Gaussian blurred image I3(x, y);
[0109] Step 44, repeat steps 42 and 43 to get images I n (x, y) at different resolutions, where n is the number of pyramid layers;
[0110] Step 45, on each pyramid level, calculate the direction gradient histogram of each local extreme point of the image, and count the angle between the gradient direction and size of the adjacent pixels and the direction of the key point to get a 128-dimensional feature vector.
[0111] Further, the above step 44, repeat steps 42 and 43 to get images I n (x, y) at different resolutions, where n is the number of pyramid layers, including:
[0112] Step 441, for the k-th layer (k = 1, 2,..., n), calculate the corresponding Gaussian blurred image I k (x, y) and the sampling factor s k ;
[0113] Step 442, calculate the image of the previous layer on the k-th layer by the formula: In the formula, is the floor operation, I k-1 (x, y) is the pixel value of the image in the previous layer pyramid at position (x, y), is the pixel value of the current layer pyramid at position , G(x-i, y-j) is the value of the Gaussian kernel at position (x-i, y-j), s k is the sampling factor of the current layer pyramid, that is, how many grid pixel points are sampled once.
[0114] In the high-speed embroidery machine remote embroidery method described in the embodiment of the application, in step 4, the feature extraction of the embroidery image under different resolutions is to obtain the structural information of the image at different scales and extract more comprehensive and rich features, so as to obtain more accurate and robust results. Specifically, the multi-scale image processing method can solve the following two problems:
[0115] Scale invariance: different image sizes will affect the features of the image, because the shape and texture features of the object change at different scales. By scaling the image to different scales, the feature information of the object at different scales can be obtained, so that the feature has certain invariance to the change of the scale;
[0116] Robustness: there may be noise, occlusion, deformation and other interference factors in the image, which will have a negative impact on feature extraction and matching. When using the multi-scale processing method, the feature information at multiple scales can be used for matching and verification, thereby increasing the robustness and accuracy of the algorithm,
[0117] For embroidery images, the multi-scale image processing method can extract texture features at different scales, thereby better describing the structure and morphology of the embroidery pattern. At the same time, multi-scale processing can compare and match patterns at different scales in different parts, thereby realizing more accurate pattern recognition and classification.
[0118] Specifically, the step 5 of calculating the similarity of the embroidery area image under different resolutions and the original embroidery pattern includes the following steps:
[0119] Step 51, for each scale of the original embroidery pattern and the real-time embroidery area image, the squared difference value of the gray value of each pixel point is calculated,
[0120] Step 52, the MSE value is obtained by the formula: In the formula, N is the total number of pixel points, I i is the gray value of the i-th pixel point in the original embroidery pattern, K i is the gray value of the i-th pixel point in the embroidery area image;
[0121] Step 53, the similarity index similarity is calculated by the formula:
[0122] Step 54, the weighted similarity is calculated by the formula:
[0123] weighted_similarity=w1×similarity1+w2×similarity2+...+w n ×similarityn , calculate
[0124] The similarity index weighted_similarity of the original embroidery pattern and the embroidery region image, in the formula, n is the number of scales, similarity i is the similarity index under the i th scale, w i is the weight under the corresponding scale.
[0125] Step 55, set a similarity threshold, and compare the similarity index of the original embroidery pattern and the embroidery region image with the similarity threshold, to obtain a similarity calculation result.
[0126] Specifically, the step 6, constructing an identification model, real-time abnormal situation identification of the embroidery region image, includes the following steps:
[0127] Step 61, constructing a CNN model, inputting the real-time embroidery region image into the CNN model;
[0128] Step 62, the convolution layer of the CNN model performs convolution operation on the real-time embroidery region image through the formula: h i =σ(w i *x+b i ), to obtain the output feature map h i , in the formula, * is convolution operation, sigma is activation function, x is input feature map, w i is the weight of the i th convolution kernel, b i is the bias term.
[0129] Step 63, the pooling layer of the CNN model reduces the size of the output feature map and reduces the data volume, to obtain the feature map after the pooling operation.
[0130] Step 64, the fully connected layer of the CNN model outputs the abnormal situation category through the formula: y=Wx+b, in the formula, W is the weight matrix of the fully connected layer, b is the bias term, x is the feature vector, and y is the abnormal situation category output by the fully connected layer.
[0131] In the high-speed embroidery machine remote embroidery method described in the embodiment of the application, in the step 6 of constructing the identification model and identifying the abnormal situation of the embroidery area image in real time, the CNN model is trained to identify the abnormal situation in the embroidery, and the training data set with the abnormal situation label is prepared in advance, specifically, the embroidery samples containing various abnormal situations are manually made, and they are combined with the normal embroidery samples to form the training data set; then, the training data is preprocessed and normalized, so that the model can better learn and understand these data, and then a CNN model is constructed, and the data set is trained, in the training process, different optimizers, loss functions and evaluation indexes are used to optimize the model, finally, the validation set data is used to evaluate and select the best model; after the training is completed, the model is used to identify the abnormal situation in the embroidery, specifically, in the process of embroidery, the abnormal situation includes but is not limited to the following:
[0132] Yarn breakage: this situation is usually caused by insufficient twist or insufficient strength of the yarn, when the yarn breaks, the thread end may fly up or leave a clear joint;
[0133] Yarn entanglement: this situation is usually caused by the fact that the thread end is not cut short in time during the embroidery process, the thread wheel does not rotate smoothly or the thread path is not properly positioned, when the thread end is crossed or entangled, it is easy to appear knotting or hooking;
[0134] Yarn shedding: this situation is usually caused by the fact that the yarn is not firmly fixed on the embroidery cloth, or the hole through which the yarn passes is too large, when the yarn sheds, it is easy to appear missing embroidery;
[0135] Embroidery deformation: this situation is usually caused by the fact that the embroidery cloth is pulled, rubbed or wet during the embroidery process, when the embroidery cloth deforms, it will cause the embroidery pattern to be distorted or deformed;
[0136] Needle threading problem: this situation is usually caused by improper needle threading, excessive force or improper thread path positioning, when the needle threading problem occurs, it is easy to damage the integrity of the embroidery pattern;
[0137] Then the real-time photographed embroidery picture can be input into the CNN model, and then the judgment result of the abnormal situation is obtained through the output of the model.
[0138] Specifically, the step 7 of constructing a prediction model based on the similarity calculation result and the abnormal situation to predict the embroidery process of the high-speed embroidery machine in real time comprises the following steps:
[0139] Step 71, integrate the similarity calculation result and the abnormal situation into a feature vector X t =[SIM t ,At ], in the formula, SIM t is the similarity index at time t, A t is the abnormal type at time t;
[0140] Step 72, define the prediction model structure and parameters as: LSTM: W f ,W i ,W c ,W o ,b f ,b i ,b c ,b o , wherein W f is a forgetting gate weight matrix, used to calculate the forgetting gate f t , which controls the cell state C t-1 at the previous time t; W i is an input gate weight matrix, used to calculate the input gate i t , which controls the current input information X t at the current time t; W c is a candidate cell state weight matrix, used to calculate the candidate cell state C t ilde t to be updated; W o is an output gate weight matrix, used to calculate the output gate o t , which controls the output H t of the cell state C t at the current time t; b f is a forgetting gate bias vector, b i is an input gate bias vector, b c is a candidate cell state bias vector, and b o is an output gate bias vector.
[0141] Step 73, input the input feature vector X t = [SIM t , A t ] into the LSTM, and perform forward propagation calculation through the LSTM;
[0142] Step 74, output the prediction result at time t from the last layer of the LSTM through the formula: Y t = softmax(W o ut*H L +b o ut), in which W o ut and b o ut are the weight and bias parameters of the LSTM output layer, and softmax is used to convert the network output into a probability distribution.
[0143] In the high-speed embroidery machine remote embroidery method described in the embodiment of the application, in step 72, f t = σ(W f *[H t-1 ,X t ]+b f ); i t = σ(W i *[H t-1 ,X t ]+b i ); C t ilde t = tanh(W c *[H t-1 ,X t ]+b c ); C t = f t *C t-1 +i t *C t ilde t ; o t = σ(W o *[H t-1 ,X t ]+b o ); H t = o t *tanh(C t ) in the formula, σ is a sigmoid activation function, f is a ReLU activation function, H t is the hidden state at time t, [H t-1 ,X t ] is the splicing of the hidden state H t-1 of the previous moment and the current input X t , and tanh is a hyperbolic tangent activation function.
[0144] Specifically, the step 8 of adjusting the running parameters of the high-speed embroidery machine according to the prediction result comprises the following steps:
[0145] Step 81, according to the prediction result at the tth moment and the actual result at the tth moment, the error of the prediction model is calculated through the formula: E t =Y t arget-Y t , in the formula, E t is the error of the model, Y t arget is the actual result at the tth moment, and Y t is the prediction result at the tth moment;
[0146] Step 82, through the formula: ΔP t =K p *Et +K i *∑(E i )+K d *(E t -E t-1 ), calculate the adjustment value ΔP of the PID controller operating parameter t , in the formula, K p , K i and K d are proportional, integral and differential coefficients respectively, E i is a historical error, ∑(E i ) is an integral term, (E t -E t-1 ) is a differential term;
[0147] Step 83, update the PID controller operating parameter according to the adjustment value ΔP t , and through the formula: P t =P t-1 +ΔP t , P t is the PID controller operating parameter at time t, and P t-1 is the PID controller operating parameter at time t-1.
[0148] As shown in Figure 2 , the application further provides a high-speed embroidery machine remote embroidery system, which comprises:
[0149] An acquisition module, which is used for acquiring an embroidery pattern and positioning information, importing the embroidery pattern into the high-speed embroidery machine, and positioning the embroidery pattern according to the positioning information;
[0150] A collection module, which is used for collecting embroidery process images of the high-speed embroidery machine in real time, and pre-processing the collected images;
[0151] A capture module, which is used for positioning an embroidery area in the pre-processed images, and capturing a continuous image sequence of the embroidery area in real time;
[0152] An extraction module, which is used for down-sampling the embroidery area images, and extracting features of the embroidery area images at different resolutions;
[0153] A calculation module, which is used for calculating the similarity between the embroidery area images at different resolutions and the original embroidery pattern;
[0154] An identification module, which is used for constructing an identification model, and identifying abnormal conditions of the embroidery area images in real time;
[0155] A prediction module, which is used for constructing a prediction model based on the similarity calculation results and the abnormal conditions, and predicting the embroidery process of the high-speed embroidery machine in real time;
[0156] An adjusting module is configured to adjust the operation parameters of the high-speed embroidery machine according to the prediction result.
[0157] Compared with the prior art, the present application has the following advantages:
[0158] The high-speed embroidery machine remote embroidery method and system provided by the present application can remotely control the operation parameters of the high-speed embroidery machine for embroidery operation according to the embroidery pattern, can ensure the accuracy and quality of the remote control of the high-speed embroidery machine for embroidery, can effectively capture key information and detail changes in the embroidery process, can evaluate the embroidery quality in real time and find potential problems in time, is beneficial to improve production efficiency and reduce labor cost.
[0159] The above is only the preferred embodiment of the present application and is not used to limit the present application, although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing embodiments or make equivalent replacement for some technical features. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method of remote embroidering on a high-speed embroidery machine, characterized in that: The method comprises the following steps: acquiring embroidery patterns and positioning information, importing the embroidery patterns into a high-speed embroidery machine and positioning the embroidery patterns according to the positioning information; real-time collection of embroidery process images of the high-speed embroidery machine and pre-processing of the collected images; positioning of the embroidery area in the pre-processed images and real-time capture of a continuous image sequence of the embroidery area; down-sampling of the embroidery area images and feature extraction of the embroidery area images at different resolutions; calculation of the similarity between the embroidery area images at different resolutions and the original embroidery patterns; construction of a recognition model for real-time identification of abnormal conditions of the embroidery area images; construction of a prediction model based on the similarity calculation results and abnormal conditions for real-time prediction of the embroidery process of the high-speed embroidery machine; wherein the construction of the prediction model based on the similarity calculation results and abnormal conditions for real-time prediction of the embroidery process of the high-speed embroidery machine comprises the following steps: Integrating the similarity calculation result and the abnormal situation into a feature vector In the present formula, is the similarity index of time t, is the abnormal type of time t; The definition of the prediction model structure and parameters are as follows: , wherein, is a forget gate weight matrix used for calculating a forget gate , which controls the cell state at the previous moment in the influence degree at the current moment t; is an input gate weight matrix used for calculating an input gate , which controls the current input information at the current moment t in the influence degree; is a candidate cell state weight matrix used for calculating a candidate cell state to be updated; is an output gate weight matrix used for calculating an output gate , which controls the output of the cell state at the current moment t; ; is a forget gate bias vector, is an input gate bias vector, is a candidate cell state bias vector, is an output gate bias vector; The input feature vector is inputted into and a forward propagation calculation is performed through ; By the formula: From The last layer outputs the prediction result at time t, in the formula, And For The weight and bias parameters of the output layer, For converting the network output into a probability distribution; adjustment of the operating parameters of the high-speed embroidery machine according to the prediction results; wherein the adjustment of the operating parameters of the high-speed embroidery machine according to the prediction results comprises the following steps: Step 81, according to the prediction result of the t time combined with the actual result of the t time, the error of the prediction model is calculated by formula: , in the formula, is the error of the model, is the actual result of the t time, is the prediction result of the t time; Step 82, the adjustment value of the PID controller operating parameter is calculated by the formula: In the formula, , and are the proportional, integral and differential coefficients, respectively, is the historical error, is the integral term, is the differential term; Step 83, updating the PID controller operating parameters according to the adjustment value and by the formula: , updating the PID controller operating parameters, PID controller operating parameters at time t, PID controller operating parameters at time t-1.
2. The remote embroidering method of the high-speed embroidery machine according to claim 1, characterized in that: the real-time collection of embroidery process images of the high-speed embroidery machine and the pre-processing of the collected images comprises the following steps: The collected image is subjected to a grayscale operation through a formula: In the formula, R, G, and B are values of red, green, and blue channels in a color image, and Y is brightness in a grayscale image. By formula: , the pixel points in the grayed image are histogram equalized, in the formula, is the pixel value after equalization, is the new pixel value to which the pixel with the pixel value is mapped after equalization, is the new pixel value to which the pixel with the pixel value appears in the original image, G is the number of gray levels of the image, and k is the index value of the pixel gray level.
3. The remote embroidering method of the high-speed embroidery machine according to claim 2, characterized in that: the positioning of the embroidery area in the pre-processed images and the real-time capture of a continuous image sequence of the embroidery area comprises the following steps: Through the convolution template of Sobel operator: The preprocessed image is convolved to obtain the gradient of each pixel point in the image in the x and y directions; Through the formula: Calculate the gradient magnitude of each pixel. and gradient direction , in this formula, and These are the gradients of the image in the x and y directions, respectively; setting an edge threshold, grouping all pixel points in the image with a gradient amplitude greater than the edge threshold according to the gradient direction, classifying pixel points with similar gradient directions into the same group, and connecting each group of pixel points to obtain a complete embroidery area contour; calculating the motion speed and direction of each pixel point in the embroidery area contour on the image plane according to the change in the position of the pixel points in the embroidery area contour between adjacent frames.
4. The remote embroidering method of the high-speed embroidery machine according to claim 3, characterized in that: the calculation of the motion speed and direction of each pixel point in the embroidery area contour on the image plane according to the change in the position of the pixel points in the embroidery area contour between adjacent frames comprises the following steps: Difference calculation is performed on adjacent frame images within the outline of the embroidery region to obtain gradients in the x and y directions , and derivatives of the gray value over time t ; through the formula: , the motion velocity of the pixel point (x, y) on the image plane is calculated and the direction , I is the image gray value, in the formula, is the gradient of the image in the x direction, is the gradient of the image in the y direction, is the gradient of the image in the time dimension, is a weight coefficient.
5. The remote embroidering method of the high-speed embroidery machine according to claim 4, characterized in that: the down-sampling of the embroidery area images and the feature extraction of the embroidery area images at different resolutions comprises the following steps: By the formula: , the embroidered region image is subjected to Gaussian filtering to obtain a Gaussian-blurred image In the formula, is the embroidered region image The pixel value at position (i, j) is is the value of the Gaussian kernel at position (x-i, y-j); By the formula: down-sampling the Gaussian-blurred image results in an image with half the resolution of the original image In this formula, is the pixel value of the down-sampled image at position (x, y), is the pixel value in the original image at position (2x, 2y); By formula: , Gaussian filtering is performed on to obtain a Gaussian blurred image ; The images at different resolutions are obtained by repeating where n is the number of layers of the pyramid; at each pyramid level, calculating the direction gradient histogram of the image at each local extreme point, and counting the included angle between the gradient direction and size of adjacent pixels and the key point direction to obtain a 128-dimensional feature vector.
6. The remote embroidering method of the high-speed embroidery machine according to claim 5, characterized in that: The repeating obtains the images under different resolutions where n is the number of layers of the pyramid, comprising: For the k-th layer (k = 1, 2,..., n), calculate the corresponding image after Gaussian blur and a sampling factor ; The image of the previous layer on the kth layer is computed by the formula: wherein is a floor operation, is the pixel value of the image in the previous layer pyramid at position , is the pixel value of the image in the current layer pyramid at position , is the value of the Gaussian kernel at position , is the sampling factor of the current layer pyramid, i.e. how many grid points are skipped before sampling.
7. The remote embroidering method for the high-speed embroidery machine according to claim 6, characterized in that: the calculation of the similarity between the embroidery area images at different resolutions and the original embroidery patterns comprises the following steps: for each scale of the original embroidery patterns and the real-time embroidery area images, the square difference value of the gray value of each pixel point is calculated, The MSE value is obtained by the formula: , wherein N is the total number of pixel points, is the gray value of the i-th pixel point in the original embroidery pattern, is the gray value of the i-th pixel point in the embroidery region image. The similarity index is calculated by the formula: ; through the formula: , calculating a similarity index of the original embroidery pattern and the embroidery region image , in the formula, n is the number of scales, is the similarity index under the i-th scale, is the weight under the corresponding scale; setting a similarity threshold and comparing the similarity index of the original embroidery patterns and the embroidery area images with the similarity threshold to obtain the similarity calculation results.
8. The remote embroidering method of a high-speed embroidery machine according to claim 7, characterized in that: the construction of the recognition model for real-time identification of abnormal conditions of the embroidery area images comprises the following steps: construction of a CNN model, input of the real-time embroidery area images into the CNN model; The convolutional layer of the CNN model is operated by the formula: , to obtain the output feature map In the formula, is the convolution operation, is the activation function, x is the input feature map, is the weight of the i-th convolution kernel, is the bias term; reduction of the size of the output feature map through the pooling layer of the CNN model and reduction of the data volume to obtain the feature map after the pooling operation; The fully connected layer of the CNN model outputs the abnormal condition class by the formula: , where W is the weight matrix of the fully connected layer, b is the bias term, x is the feature vector, and y is the abnormal condition class output by the fully connected layer.
9. A high speed embroidery machine remote embroidering system for implementing the method of claim 1, characterized in that: the system comprises: The acquisition module is configured to acquire the embroidery pattern and the positioning information, import the embroidery pattern into the high-speed embroidery machine, and position the embroidery pattern according to the positioning information. The acquisition module is configured to acquire the embroidery pattern and the positioning information, import the embroidery pattern into the high-speed embroidery machine, and position the embroidery pattern according to the positioning information. The acquisition module is configured to acquire the embroidery pattern and the positioning information, import the embroidery pattern into the high-speed embroidery machine, and position the embroidery pattern according to the positioning information. The acquisition module is configured to acquire the embroidery pattern and the positioning information, import the embroidery pattern into the high-speed embroidery machine, and position the embroidery pattern according to the positioning information. The acquisition module is configured to acquire the embroidery pattern and the positioning information, import the embroidery pattern into the high-speed embroidery machine, and position the embroidery pattern according to the positioning information. The acquisition module is configured to acquire the embroidery pattern and the positioning information, import the embroidery pattern into the high-speed embroidery machine, and position the embroidery pattern according to the positioning information. The acquisition module is configured to acquire the embroidery pattern and the positioning information, import the embroidery pattern into the high-speed embroidery machine, and position the embroidery pattern according to the positioning information. The acquisition module is configured to acquire the embroidery pattern and the positioning information, import the embroidery pattern into the high-speed embroidery machine, and position the embroidery pattern according to the positioning information.
Citation Information
Patent Citations
Precise positioning method for target needle eye of embroidery machine based on binocular camera parallax
CN108898634A
Embroidery machine laser control device and method
CN112411041A