CN116958739B - Attention mechanism-based carbon fiber channel real-time dynamic numbering method - Google Patents

Attention mechanism-based carbon fiber channel real-time dynamic numbering method Download PDF

Info

Publication number
CN116958739B
CN116958739B CN202310752546.1A CN202310752546A CN116958739B CN 116958739 B CN116958739 B CN 116958739B CN 202310752546 A CN202310752546 A CN 202310752546A CN 116958739 B CN116958739 B CN 116958739B
Authority
CN
China
Prior art keywords
network
carbon fiber
image
channel
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310752546.1A
Other languages
Chinese (zh)
Other versions
CN116958739A (en
Inventor
古玲
武继杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Jushi Technology Co ltd
Original Assignee
Nanjing Jushi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Jushi Technology Co ltd filed Critical Nanjing Jushi Technology Co ltd
Priority to CN202310752546.1A priority Critical patent/CN116958739B/en
Publication of CN116958739A publication Critical patent/CN116958739A/en
Application granted granted Critical
Publication of CN116958739B publication Critical patent/CN116958739B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/70Labelling scene content, e.g. deriving syntactic or semantic representations
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Image Processing (AREA)

Abstract

A carbon fiber channel real-time dynamic numbering method based on an attention mechanism relates to the technical field of image processing. Obtaining sampling data by using an industrial camera; preprocessing the sampling data, wherein the preprocessing comprises training a channel prediction network and marking carbon fiber channel numbers in actual scenes; and outputting the processing result to obtain the marking number of the carbon fiber yarn channel. The invention adopts a visual transducer network to process carbon fiber images acquired by a linear array industrial camera, and sequentially carries out real-time dynamic numbering on carbon fiber yarns from top to bottom on image data. And under the condition of no obvious distinguishing characteristics, better processing is carried out on the data such as doubling or broken yarn and the like.

Description

Attention mechanism-based carbon fiber channel real-time dynamic numbering method
Technical Field
The invention relates to the technical field of image processing, in particular to a carbon fiber yarn channel real-time dynamic numbering method based on an attention mechanism.
Background
In the production process of the carbon fiber yarn, the problem of surface defects (broken yarn, joint and the like) is prominent, and the quality of carbon fiber yarn products (such as manufacturing carbon fiber composite materials, reinforced carbon fiber concrete structures and the like) is seriously threatened. The surface defects are generated because of the fact that the carbon fiber defects are difficult to locate and trace due to the fact that certain viscosity exists on the surface of the yarn with low solidification speed or the yarn is mixed due to uneven impregnation of an oiling agent in the production of the carbon fiber, and the quality and the service life of a carbon fiber product are seriously influenced by the defects.
Because of the complex and diversified production environments, the quality level of the carbon fiber yarn images acquired by the industrial linear camera is uneven, and the characteristic of distinguishing yarn paths is not obvious. In addition, the carbon fiber yarn in the actual environment has various changes, and is easy to break, shift in the position of the carbon yarn and the like. The traditional image processing algorithm cannot cope with the complex data, so that the accuracy of the screw channel prediction cannot be guaranteed.
Due to the problems of doubling, broken filaments and the like, the algorithm based on the traditional image processing on the market is not applicable at present. That is, there are a plurality of carbon filaments in the image data that overlap together or that appear intermediate discontinuous, and these carbon filaments are collected by an industrial camera and often have no distinguishing property in the visual sense, nor have obvious distinguishing features in the image. Conventional algorithms have difficulty processing such data. Therefore, how to number the doubling or breakage and other conditions more accurately without obvious distinguishing characteristics is a worth discussing problem.
Disclosure of Invention
The invention provides a real-time carbon fiber yarn channel numbering algorithm based on an attention mechanism, which utilizes a transducer to process carbon fiber images acquired by a linear array industrial camera, outputs the prediction results of carbon fiber yarns and backgrounds in the images, and realizes the determination and numbering of carbon fiber yarn channels.
A carbon fiber channel real-time dynamic numbering method based on an attention mechanism comprises the following steps:
step S1: obtaining sampling data by using an industrial camera;
step S2: preprocessing the sampled data;
Step S3: and outputting the processing result to obtain the marking number of the carbon fiber yarn channel.
Preferably, the preprocessing of the sampled data in step S2 of the present invention includes the step S21 of training the silk channel prediction network, which specifically includes the following steps:
Step S211: preprocessing data; specific:
Will sample the data Divided into training sets/>And test set/>Two parts; wherein x i is a carbon fiber yarn original image of 3 Xh Xw, y i is a yarn path label of 1 Xw, the value of the yarn path position is 1, and the value of the background position is 0;
For the training set, each original image of the carbon fiber yarn is respectively subjected to the preprocessing operations of Resize, normalization, random enhancement of color brightness and saturation, and random vertical overturning, and each yarn path label is required to be adjusted according to the width of the original image of the carbon fiber yarn after Resize; the method comprises the steps that a bilinear interpolation algorithm is selected for the Resize operation of an original image of the carbon fiber yarn, and a bicubic interpolation algorithm is selected for the adjustment of a label;
for the verification set, only the pretreatment operation of Resize and normalization is needed for each original image of the carbon fiber yarn, and each yarn path label is needed to be adjusted according to the width of the image after Resize;
The sizes of images after the training set and the verification set are the same;
Step S212: outputting a classification predicted value and a position predicted value;
Step S213: calculating loss;
Step S214: optimizing and predicting network parameters;
step S215: and outputting the optimal prediction model.
Preferably, the output classification predicted value and the position predicted value of step S212 of the present invention; the specific process is as follows:
initializing parameters, including Linear mapping layer Linear, transducer coding network, classification network and wire numbering network; an optimizer Adam; marking the carbon wire data set;
Taking an image of [3, i, w ] as an input sample, starting from the i-th position, i.e. taking images from [3, i, w ] to [3, f+h, w ];
then dividing the input sample of [3, h, w ] by using a grid with the size of [ h, w p ] to obtain An image block; compressing the first 3 dimensions to obtain/>Is input to the computer; let 3×h×w p =d,/>Obtaining input sample/>, of the i-th layer
Linear mapping of input samples: Splice-on position embedding vector Input/>, to get a transducer network
Inputting x i into a transducer coding network to obtain a coding output o i=Transformer(xi)∈R(d+1)×k;
O i is respectively sent into a classification network f cls and a lane numbering network f loc to obtain classification prediction of k input blocks And position prediction/>
Preferably, the calculation loss of step S213 of the present invention; the specific process is as follows:
Calculating classification prediction losses Wherein MSELoss is mean square error loss, y cls∈R1×k is k real categories, and the value is 0 or 1; when the area occupied by the carbon wire in the corresponding kth input image is larger than a certain threshold value (0.5), the value is 1, otherwise, the value is 0;
Calculating position prediction losses Wherein y loc∈R1×k is the real label corresponding to the channel number;
Wherein, J=1, …, N is the number of all the tracks for the true value corresponding to the kth image block;
Total loss = l cls+lloc is calculated and network parameters are updated using Adam optimizer, including Linear mapping layer Linear, transform coding network, classification network f cls, lane numbering network f loc.
Preferably, the output optimal prediction model of step S215 of the present invention comprises the following specific processes:
Optimizing the whole network parameters by using an Adam optimizer;
Adding 1 to the value of i, and repeating the whole process from the step 1; until i=w-w p, the i value is 0, changing the next picture, and repeating the whole process from the 1 st step;
Calculating loss under the verification set by using the verification set, selecting a model with minimum loss as an optimal prediction network, and outputting a final silk channel prediction network
Preferably, the preprocessing of the sampled data in the step S2 of the present invention further includes labeling the carbon fiber channel number in the actual scene, and the specific process is as follows:
for test data Carrying out the operations of restoration and normalization on each original picture;
inputting the processed test image into the final screw channel prediction network obtained in step S215 Obtain the output predictive vector/>The carbon fiber channel numbers are numbered.
The method comprises the steps of training a visual transducer by utilizing images and labeling data of carbon fiber filaments in the early stage, and predicting the channel numbers in the carbon fiber filament images. The model has the advantages of less parameter, quick and efficient calculation, less operation needed by post-treatment, realization of real-time dynamic numbering of the filament tracks of the carbon fiber filaments, and certain generalization capability and stability.
Drawings
FIG. 1 is a flow chart of the real-time dynamic numbering method of the present invention.
FIG. 2 is a flow chart of the training phase of the present invention;
FIG. 3 is a flow chart of the prediction phase of the present invention;
Fig. 4 is a network configuration diagram of the present invention.
Detailed Description
The technical scheme of the invention is described in detail below with reference to the accompanying drawings:
as shown in fig. 1, a method for dynamically numbering carbon fiber channels in real time based on an attention mechanism comprises the following steps:
step S1: obtaining sampling data by using an industrial camera;
step S2: preprocessing the sampled data;
Step S3: and outputting the processing result to obtain the marking number of the carbon fiber yarn channel.
As shown in fig. 2, the preprocessing of the sampled data in step S2 of the present invention includes step S21 of training a silk channel prediction network, which specifically includes the following steps:
Step S211: preprocessing data; specific:
Will sample the data Divided into training sets/>And validation set/>Two parts; wherein x i is a carbon fiber yarn original image of 3 Xh Xw, y i is a carbon fiber yarn channel label of 1 Xw, the value of the carbon fiber yarn channel position is 1, the value of the background position is 0, and N train、Nval is the total number of samples of the training set and the validation set respectively;
For the training set, preprocessing operations of Resize, normalization, color disturbance and random vertical overturning are respectively carried out on each carbon fiber yarn original image, and each yarn channel label is required to be adjusted according to the width of the carbon fiber yarn original image after Resize; the method comprises the steps that a bilinear interpolation algorithm is selected for the Resize operation of an original image of the carbon fiber yarn, and a bicubic interpolation algorithm is selected for the adjustment of a label;
the specific operation of normalization is as follows: Mu is the mean of the sample and sigma is the variance.
The specific operation of the color disturbance is as follows: for one pixel (r, g, b), it is assumed that the value of each channel is between [0,1 ]. ColorJitter will do the following for each channel:
Where C i is the value of the current channel, For the new value after processing, α is the adjustment intensity, typically the fraction between [0,1], and rand (-1, 1) is a random number uniformly distributed between [ -1,1 ]. After the above operation, the new color isWherein:
where trunc () is a rounding function, rounds the calculation to an integer, and converts it to a pixel value on the image.
Random vertical flip: the current image sample x i is randomly flipped vertically with a certain probability p, p being set to 0.5.
Resize: let us assume that we want to compute the size m×n of the image Resize as m×n (M < M, N < N), first, the corresponding position of each pixel after scaling down in the original image, and let us say that the position of the (x, y) th pixel in the original image after scaling down is (i, j), then: x=i×m/M, y=j×n/N. The bilinear interpolation algorithm and the bicubic interpolation algorithm in the Resize are respectively:
(1) Bilinear interpolation algorithm:
1. Calculating coordinates of four nearest neighbor pixels of each position (i, j) of the image after Resize at the corresponding position (x, y) in the original image: (x 1,y1),(x1,y2),(x2,y1) and (x 2,y2), wherein x 1 and y 1 are the largest integers satisfying x 1.ltoreq.i and y 1.ltoreq.j, and x 2 and y 2 are the smallest integers satisfying x 2.gtoreq.i and y 2.gtoreq.j.
2. For each coordinate position (i, j) in the Resize image, the pixel value is f (i, j), which is calculated as follows:
f(i,j)=(1-w)(1-h)f(x1,y1)+w(1-h)f(x2,y1)+(1-w)hf(x1,y2)+whf(x2,y2),
Where w= (i-x 1)/(x2-x1) and h= (j-y 1)/(y2-y1) are weight coefficients.
(2) Bicubic interpolation algorithm:
We need to calculate the pixel value f (i, j) of the scaled down image from the value of (x, y). Specifically, for the (i, j) th pixel, its pixel value can be calculated by the following formula:
Wherein the method comprises the steps of The position of the upper left corner pixel of the 16 pixels adjacent to (i, j) is indicated. g (k, l) represents the kth row and first column pixel values on the original image, w k-a,l-b is the weighting factor, which is calculated from (x, y). Specifically, the weighting coefficient can be calculated from the following formula:
wk-a,i-b=w(s)·w(t)
Where s=k-x+1, t=l-y+1, w(s) and w (t) represent weighting coefficients in s, t directions, respectively, which can be calculated by the following formula:
The w (z) coefficient in the above formula is called a bicubic interpolation weight function, and its function is to control the smoothness of interpolation, when z is 0, the value of w (z) is the largest, the gray value of the corresponding pixel has the largest influence on the interpolation result, and when z is far away from 0, the value of w (z) gradually decreases, and the influence on the interpolation result is smaller and smaller.
For verification set dataThe original image of each carbon fiber wire only needs to do the preprocessing operation of Resize (bilinear interpolation algorithm, the same as above) and normalization, and each wire label needs to adjust Resize (bicubic interpolation algorithm, the same as above) according to the width of the image Resize;
The sizes of images after the training set and the verification set are the same;
Step S212: outputting a classification predicted value and a position predicted value; the specific process is as follows:
Initializing parameters, including Linear mapping layer Linear, transducer coding network, classification network and wire numbering network; an optimizer Adam; an original image of carbon fiber yarn and a yarn path label corresponding to the original image; as shown in figure 4 of the drawings,
Taking an image of [3, i, w ] as an input sample, starting from the i-th position, i.e. taking images from [3, i, w ] to [3, i+h, w ];
then dividing the input sample of [3, h, w ] by using a grid with the size of [ h, w p ] to obtain An image block; compressing the first 3 dimensions to obtain/>Is input to the computer; let 3×h×w p =d,/>Obtain input sample/>, of the i-th positionK is the total number of the image blocks divided, and d is the dimension of each image block after compression. R real set vector space, R { d x k }, represents vector space of d by k dimensions; if the width w p of each image block is set to 5, a picture is marked, and the/>The number of training samples can realize that the labeling quantity of the total picture is controlled within 100.
Linear mapping of input samples: Splice-on position embedding vector Input/>, to get a transducer network
Inputting x i into a transducer coding network to obtain a coding output o i=Transformer(xi)∈R(d+1)×k;
The coded output o i is respectively sent into a classification network f cls and a lane numbering network f loc to obtain classification prediction of k input blocks And position prediction/>Specifically calculated as/>Wherein W cls and b cls are respectively the weight parameter and bias of the classification network f cls, σ (x) is a ReLU activation function, and the calculation formula is σ (x) =max (0, x); Where W loc and b loc are the weight parameters and bias, respectively, of the lane numbering network f loc.
Step S213: calculating loss; the specific process is as follows:
Calculating classification prediction losses Wherein MSELoss is mean square error loss, y cls∈R1×k is the true category of the corresponding k image blocks, and the value is 0 or 1; when the occupied area of the carbon fiber channels in the corresponding kth input image block is larger than a certain threshold value (0.5), the value is 1, otherwise, the value is 0;
Calculating position prediction losses Wherein y loc∈R1×k is the real label corresponding to the channel number;
Wherein, J=1, …, N are all the number of tracks, j is the index of the track from left to right; total loss = l cls+lloc is calculated and network parameters are updated using Adam optimizer, including Linear mapping layer Linear, transform coding network, classification network f cls, lane numbering network f loc. The purpose of the classification network is to assist learning, and only the lane numbering network is used for lane prediction in the test stage.
Step S214: optimizing and predicting network parameters;
step S215: the optimal prediction model is output, and the specific process is as follows:
Optimizing the whole network parameters by using an Adam optimizer;
Adding 1 to the value of i, and repeating the whole process from the step 1; until i=w-w p, the i value is 0, changing the next picture, and repeating the whole process from the 1 st step;
Calculating loss under the verification set by using the verification set, selecting a model with minimum loss as an optimal prediction network, and outputting a final silk channel prediction network
As shown in fig. 3, the preprocessing of the sampled data in step S2 of the present invention further includes labeling of carbon fiber channel numbers in actual scenes, and the specific process is as follows:
for test data Carrying out the operations of restoration and normalization on each original picture;
inputting the processed test image into the final screw channel prediction network obtained in step S215 Obtain the output predictive vector/>Specifically calculated as/>When one or more values greater than the threshold value (0.5) appear, the current position or continuous area is judged to be a new carbon fiber, and the number of the carbon fiber is added with 1 (initial 0). The carbon fiber channel numbers are numbered accordingly.
The invention utilizes a linear array industrial camera, and utilizes images and labeling data of carbon fiber filaments in the early stage to train a visual transducer to predict the number of the channel in the carbon fiber filament images. The model has the advantages of less parameter, quick and efficient calculation, less operation needed by post-treatment, realization of real-time dynamic numbering of the filament tracks of the carbon fiber filaments, and certain generalization capability and stability. The invention can directly number the silk channels of the image by only a shallow visual transducer structure, has less overall model parameters, less hardware cost and high calculation efficiency, and can number the carbon fiber silk channels in real time.

Claims (1)

1. A carbon fiber channel real-time dynamic numbering method based on an attention mechanism is characterized by comprising the following steps:
step S1: obtaining sampling data by using an industrial camera;
step S2: preprocessing the sampled data;
The method comprises the following steps of S21 training a silk channel prediction network, wherein the specific process is as follows:
Step S211: preprocessing data; specific:
Will sample the data Divided into training sets/>And a verification setTwo parts; wherein x i is a carbon fiber yarn original image of 3 Xh x w, y i is a yarn path label of 1 Xw, the value of the yarn path position is 1, the value of the background position is 0, and N train、Nval is the total number of samples of the training set and the verification set respectively;
For the training set, preprocessing operations of Resize, normalization, color disturbance and random vertical overturning are respectively carried out on each carbon fiber yarn original image, and each yarn channel label is required to be adjusted according to the width of the carbon fiber yarn original image after Resize; the method comprises the steps that a bilinear interpolation algorithm is selected for the Resize operation of an original image of the carbon fiber yarn, and a bicubic interpolation algorithm is selected for the adjustment of a label;
the specific operation of normalization is as follows: μ is the mean of the sample, σ is the variance;
the specific operation of the color disturbance is as follows: for one pixel (r, g, b), assume that the value of each channel is between [0,1 ]; color Jitter will do the following for each channel:
Where C i is the value of the current channel, For the new value after processing, α is the adjustment intensity, usually the fraction between [0,1], and rand (-1, 1) is a random number uniformly distributed between [ -1,1 ]; after the above operation, the new color isWherein:
Wherein trunc () is a rounding function, rounding the calculation result to an integer, and converting it to a pixel value on the image;
Random vertical flip: randomly vertically overturning the current image sample x i according to a certain probability p, wherein p is set to be 0.5;
Resize, namely, an image Resize with the size of M multiplied by N is M multiplied by N, wherein M is smaller than M, N and smaller than N, firstly, the corresponding position of each pixel after reduction in the original image needs to be calculated, and the position of the pixel at the (k, l) th position in the original image in the reduced image is (c, d), then: k=c×m/M, l=d×n/N; the bilinear interpolation algorithm and the bicubic interpolation algorithm in the Resize are respectively:
(1) Bilinear interpolation algorithm:
1. Calculating coordinates of four nearest neighbor pixels of each position (c, d) of the image after Resize in the corresponding position (k, l) in the original image: (k 1,l1),(k1,l2),(k2,l1) and (k 2,l2), wherein k 1 and l 1 are the largest integers satisfying k 1.ltoreq.c and l 1.ltoreq.d, and k 2 and l 2 are the smallest integers satisfying k 2.gtoreq.c and l 2.gtoreq.d;
2. For each position (c, d) in the Resize image, the pixel value is f (c, d), which is calculated as follows:
f(c,d)=(1-w/)(1-h/)f(k1,l1)+w/(1-h/)f(k2,l1)+(1-w/)h/f(k1,l2)+w/h/f(k2,l2)
Wherein w /=(c-k1)/(k2-k1) and h /=(d-l1)/(l2-l1) are weight coefficients;
(2) Bicubic interpolation algorithm:
The pixel value f (c, d) of the reduced image needs to be calculated according to the value of (k, l); for the pixel at the (c, d) th position, its pixel value is calculated by the following formula:
Wherein the method comprises the steps of Representing the position of the upper left corner pixel of the 16 pixels adjacent to the (c, d) position; g (k, l) represents the kth row, the first column pixel value on the original image,/>Is a weighting coefficient calculated from (k, l);
for verification set data The original image of each carbon fiber yarn only needs to do the preprocessing operation of Resize and normalization, and each yarn path label needs to carry out Resize adjustment according to the width of the image after Resize;
The sizes of images after the training set and the verification set are the same;
step S212: the prediction network outputs a prediction vector; specific:
Initializing parameters, including Linear mapping layer Linear, transducer coding network, classification network and wire numbering network; an optimizer Adam; corresponding silk channel labels in the original image of the carbon fiber silk;
Dividing the input samples of [3, h, w ] by using a grid with the size of [ h, w p ] to obtain An image block; compressing the first 3 dimensions to obtain/>Is input to the computer; let 3 Xh Xw p=d/,/>Obtain input sample of the q-th position/>The value of q is 1..k /;k/ is the total number of the divided image blocks, and d / is the dimension of each compressed image block;
respectively carrying out linear mapping on k / image blocks obtained after segmentation, and splicing position embedding vectors Obtaining input of a transducer network, and obtaining a coding output o i;
the coded output o i is respectively sent into a classification network f cls and a lane numbering network f loc to obtain classification prediction of k / input blocks And position prediction/>Specifically calculated as/>Wherein W cls and b cls are the weight parameters and bias, respectively, of the classification network f cls, σ / (x) is the ReLU activation function; /(I)Wherein W loc and b loc are the weight parameter and bias, respectively, of the lane numbering network f loc;
step S213: calculating loss; the specific process is as follows:
Calculating classification prediction losses Wherein MSELoss is the mean square error loss,/>The value of the real category corresponding to k / image blocks is 0 or 1; when the occupied area of the carbon fiber yarn channel in the corresponding q-th input image block is larger than a certain threshold value, the value is 1, otherwise, the value is 0;
Calculating position prediction losses Wherein/>Is a real label corresponding to the channel number;
Wherein, For the true value corresponding to the q-th image block, J / =1, …, J is the number of all tracks, J / is the index of the track from left to right; calculate total loss = l cls+lloc;
Step S214: optimizing and predicting network parameters; updating network parameters by using an Adam optimizer, wherein the network parameters comprise a Linear mapping layer Linear coding network, a Transformer coding network, a classification network f cls and a lane numbering network f loc; the classification network aims at assisting learning, and only a silk channel numbering network is used for silk channel prediction in the test stage;
step S215: the optimal prediction model is output, and the specific process is as follows:
Repeating the whole process from step S212 until all images in the training set are traversed;
Calculating loss under the verification set by using the verification set, selecting a channel number network model with the minimum loss as an optimal prediction network, and outputting a final channel prediction network
For the test data, carrying out the operations of Resize and normalization on each original picture;
inputting the processed test image into the final screw channel prediction network obtained in step S215 Obtain the output predictive vector/>Specifically calculated as/> When one or more continuous values larger than a threshold value appear, judging the current position or continuous area as a new carbon fiber wire, and adding 1 to the number of the carbon fiber wire;
Step S3: and outputting the processing result to obtain the marking number of the carbon fiber yarn channel.
CN202310752546.1A 2023-06-25 2023-06-25 Attention mechanism-based carbon fiber channel real-time dynamic numbering method Active CN116958739B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310752546.1A CN116958739B (en) 2023-06-25 2023-06-25 Attention mechanism-based carbon fiber channel real-time dynamic numbering method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310752546.1A CN116958739B (en) 2023-06-25 2023-06-25 Attention mechanism-based carbon fiber channel real-time dynamic numbering method

Publications (2)

Publication Number Publication Date
CN116958739A CN116958739A (en) 2023-10-27
CN116958739B true CN116958739B (en) 2024-06-21

Family

ID=88445312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310752546.1A Active CN116958739B (en) 2023-06-25 2023-06-25 Attention mechanism-based carbon fiber channel real-time dynamic numbering method

Country Status (1)

Country Link
CN (1) CN116958739B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175985A (en) * 2019-04-22 2019-08-27 国网江苏省电力有限公司电力科学研究院 Carbon fiber composite core wire damage detecting method, device and computer storage medium

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6375875B1 (en) * 2000-01-27 2002-04-23 Ut-Battelle, Llc Diagnostic monitor for carbon fiber processing
CN109345449B (en) * 2018-07-17 2020-11-10 西安交通大学 Image super-resolution and non-uniform blur removing method based on fusion network
CN110781729B (en) * 2019-09-16 2023-04-07 长安大学 Evaluation model and evaluation method for fiber dispersibility of carbon fiber reinforced cement-based material
JP2023120457A (en) * 2020-07-08 2023-08-30 国立大学法人愛媛大学 Device for inspecting composite material, method for inspecting composite material, and program for inspecting composite material
JP2022155690A (en) * 2021-03-31 2022-10-14 キヤノン株式会社 Image processing device, image processing method, and program
CN113673489B (en) * 2021-10-21 2022-04-08 之江实验室 Video group behavior identification method based on cascade Transformer
CN114140687A (en) * 2021-11-22 2022-03-04 浙江省轻工业品质量检验研究院 Wool and cashmere fiber identification method based on improved Mask R-CNN neural network
CN114140353B (en) * 2021-11-25 2023-04-07 苏州大学 Swin-Transformer image denoising method and system based on channel attention
CN114387269B (en) * 2022-03-22 2022-06-03 南京矩视科技有限公司 Fiber yarn defect detection method based on laser
CN115294077A (en) * 2022-08-10 2022-11-04 东华大学 Textile fiber nondestructive testing method, device and storage medium
CN115358977A (en) * 2022-08-11 2022-11-18 南京耘瞳科技有限公司 Carbon filament surface defect detection method based on deep learning
CN115830323A (en) * 2022-12-08 2023-03-21 浙江理工大学 Deep learning segmentation method for carbon fiber composite material data set
CN116189139A (en) * 2022-12-16 2023-05-30 重庆邮电大学 Traffic sign detection method based on Transformer
CN115984215A (en) * 2022-12-29 2023-04-18 南京矩视科技有限公司 Fiber bundle defect detection method based on twin network
CN116051410A (en) * 2023-01-18 2023-05-02 内蒙古工业大学 Wool cashmere fiber surface morphology structure diagram identification method based on image enhancement
CN116012344B (en) * 2023-01-29 2023-10-20 东北林业大学 Cardiac magnetic resonance image registration method based on mask self-encoder CNN-transducer
CN116091830A (en) * 2023-02-07 2023-05-09 广东技术师范大学 Multi-view image classification method based on global filtering module

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175985A (en) * 2019-04-22 2019-08-27 国网江苏省电力有限公司电力科学研究院 Carbon fiber composite core wire damage detecting method, device and computer storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Alexey Dosovitskiy, et.al.An image is worth 16*16 words: transformers for image recognition at scale.《arXiv:2010.11929v2,20210603》.2021,第1-22页. *

Also Published As

Publication number Publication date
CN116958739A (en) 2023-10-27

Similar Documents

Publication Publication Date Title
CN112329658B (en) Detection algorithm improvement method for YOLOV3 network
CN111968150B (en) Weak surveillance video target segmentation method based on full convolution neural network
CN110517329A (en) A kind of deep learning method for compressing image based on semantic analysis
CN110569875A (en) deep neural network target detection method based on feature multiplexing
CN112291562B (en) Fast CU partition and intra mode decision method for H.266/VVC
CN112669324B (en) Rapid video target segmentation method based on time sequence feature aggregation and conditional convolution
CN109740563A (en) A kind of moving target detecting method of facing video monitoring
CN112215859B (en) Texture boundary detection method based on deep learning and adjacency constraint
CN112270691A (en) Monocular video structure and motion prediction method based on dynamic filter network
Kamble et al. Modified three-step search block matching motion estimation and weighted finite automata based fractal video compression
CN116030361A (en) CIM-T architecture-based high-resolution image change detection method
CN117409431B (en) Multi-mode large language model training method, electronic equipment and storage medium
CN116958739B (en) Attention mechanism-based carbon fiber channel real-time dynamic numbering method
CN114373109B (en) Natural image matting method and matting device based on deep learning
CN112446245A (en) Efficient motion characterization method and device based on small displacement of motion boundary
CN112070851B (en) Index map prediction method based on genetic algorithm and BP neural network
CN113709483B (en) Interpolation filter coefficient self-adaptive generation method and device
CN111432208B (en) Method for determining intra-frame prediction mode by using neural network
CN111294596B (en) Screen content index map prediction method based on 2D Markov and edge direction characteristics
CN113298714B (en) Image cross-scale super-resolution method based on deep learning
CN114596433A (en) Insulator identification method
JP2007067552A (en) Method, apparatus and program for inter-layer prediction processing and recording medium thereof
CN113988154A (en) Unsupervised decoupling image generation method based on invariant information distillation
CN115086663B (en) Multi-camera real-time video transmission method based on deep reinforcement learning
CN116503615B (en) Convolutional neural network-based carbon fiber channel identification and numbering method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant