CN114998323B - Deformed steel bar abnormity determination method based on attention mechanism - Google Patents
Deformed steel bar abnormity determination method based on attention mechanism Download PDFInfo
- Publication number
- CN114998323B CN114998323B CN202210844509.9A CN202210844509A CN114998323B CN 114998323 B CN114998323 B CN 114998323B CN 202210844509 A CN202210844509 A CN 202210844509A CN 114998323 B CN114998323 B CN 114998323B
- Authority
- CN
- China
- Prior art keywords
- image
- texture
- angle
- map
- gray level
- 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
Links
- 229910000831 Steel Inorganic materials 0.000 title claims abstract description 59
- 239000010959 steel Substances 0.000 title claims abstract description 59
- 238000000034 method Methods 0.000 title claims abstract description 32
- 230000007246 mechanism Effects 0.000 title claims abstract description 10
- 230000004044 response Effects 0.000 claims abstract description 75
- 230000002159 abnormal effect Effects 0.000 claims abstract description 51
- 239000011159 matrix material Substances 0.000 claims abstract description 47
- 238000013527 convolutional neural network Methods 0.000 claims abstract description 11
- 238000010586 diagram Methods 0.000 claims description 7
- 238000012545 processing Methods 0.000 abstract description 5
- 238000000605 extraction Methods 0.000 abstract description 3
- 238000004364 calculation method Methods 0.000 description 9
- 230000005856 abnormality Effects 0.000 description 7
- 238000004458 analytical method Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 206010039509 Scab Diseases 0.000 description 3
- 230000002411 adverse Effects 0.000 description 3
- 238000012937 correction Methods 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 208000032544 Cicatrix Diseases 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 231100000241 scar Toxicity 0.000 description 2
- 230000037387 scars Effects 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 241001584785 Anavitrinella pampinaria Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000011179 visual inspection Methods 0.000 description 1
- 238000005303 weighing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Geometry (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to the technical field of data processing, in particular to a deformed steel bar abnormity determination method based on an attention mechanism. The method comprises the steps of obtaining an initial image of the surface of the deformed steel bar to obtain a suspected abnormal area; acquiring a gray image of a suspected abnormal area, and acquiring an angle of the deformed steel bar transverse rib on the gray image as a reference angle; acquiring a texture response image of the gray level image at any angle according to the filter; distributing a weight value for each angle according to the average energy entropy of the texture response graph of each angle; carrying out weighted summation based on the weight, the reference angle and the gray level co-occurrence matrix of each angle to obtain a complete gray level co-occurrence matrix; and calculating an inverse difference moment image according to the complete gray level co-occurrence matrix, and inputting the inverse difference moment image and the initial image into a convolutional neural network to obtain the abnormal category of the surface of the deformed steel bar. The influence of abnormal directionality on the extraction of abnormal texture information is avoided, and the accuracy of abnormal category judgment is improved.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a deformed steel bar abnormity determination method based on an attention mechanism.
Background
The deformed steel bar is a steel bar with ribs on the surface, can bear larger external force, and is widely applied to the field of building industry, such as houses, roads, dams, tunnels and other various building structures. The surface abnormalities of the deformed steel bar, such as pits, scabs, cracks, scratches and pitted surfaces, not only affect the aesthetic property of the deformed steel bar, but also even have great influence on the structural performance of the deformed steel bar, thereby bringing about potential safety hazards.
The detection of traditional deformed steel bar surface anomaly relies on artifical visual inspection, needs the inspector to carry out unusual mark to the deformed steel bar surface, and the accuracy and the stability of mark may receive the detection ring border and inspector state influence itself. Therefore, the application of detecting the abnormity of the surface of the deformed steel bar based on computer vision is more and more extensive, and when the common gray level co-occurrence matrix is used for analysis, the gray level co-occurrence matrix is easily influenced when the texture features are extracted according to a fixed angle due to the shooting angle, so that the extracted texture features are influenced, and the accuracy of subsequent abnormity analysis is reduced.
Disclosure of Invention
In order to solve the above technical problems, an object of the present invention is to provide a method for determining an abnormality of a deformed steel bar based on an attention mechanism, the method including the steps of:
acquiring an initial image of the surface of the deformed steel bar, and calculating a saliency map corresponding to the initial image; obtaining a suspected abnormal area in the initial image according to the saliency map;
acquiring a gray image of the suspected abnormal area, and acquiring an angle of the deformed steel bar transverse rib on the gray image as a reference angle; acquiring texture response characteristic maps of the gray level image under multiple scales at any angle according to a filter;
calculating the weight corresponding to each texture response characteristic image under any angle based on the reference angle, and obtaining the texture response image of any angle by weighting and summing the weight and the texture response characteristic images of each scale;
calculating the average energy entropy of the texture response graph of each angle, and distributing a weight to each angle according to the average energy entropy; calculating a gray level co-occurrence matrix of the gray level image at each angle, and performing weighted summation based on the weight, the reference angle and each gray level co-occurrence matrix to obtain a complete gray level co-occurrence matrix;
and calculating an inverse difference matrix image according to the complete gray level co-occurrence matrix, and inputting the inverse difference matrix image and the initial image into a convolutional neural network to obtain the abnormal category of the surface of the deformed steel bar.
Preferably, the step of calculating the saliency map corresponding to the initial image includes:
converting the initial image from an RGB color space to an LAB color space to obtain an LAB image; obtaining the LAB
And obtaining the saliency map according to the pixel mean values of the initial image and each channel, wherein the pixel mean values of the pixels in the image correspond to an L channel, an A channel and a B channel respectively.
Preferably, the step of obtaining the suspected abnormal region in the initial image according to the saliency map includes:
and acquiring a classification threshold value based on the significance value of each pixel point in the significance map, wherein the pixel points with the significance values larger than the classification threshold value in the significance map are suspected abnormal pixel points, and all the suspected abnormal pixel points form the suspected abnormal area.
Preferably, the step of calculating a weight corresponding to each of the texture response feature maps at any of the angles based on the reference angle includes:
calculating the texture gradient value of each pixel point in the texture response characteristic graph under the angle as follows:
wherein,representing coordinates in a gray scale image asThe texture gradient value corresponding to the pixel point of (a);representing coordinates in a gray scale image asThe texture response characteristic value corresponding to the pixel point of (1);represents a reference angle;representing the corresponding angle of the corresponding characteristic diagram of the texture;representing a scale;representing a cosine function;representing a sine function;
and forming a texture gradient map according to the texture gradient value of each pixel point, and obtaining the weight corresponding to each texture response characteristic map according to the texture gradient map.
Preferably, the step of obtaining the weight corresponding to each texture response feature map according to the texture gradient map includes:
obtaining the mean value of the pixels of each texture gradient image under the angle, and obtaining a corresponding texture saliency map according to the mean value of the gray level image and any texture gradient image;
and acquiring a texture significant mean value corresponding to each texture significant image, and normalizing the texture significant mean value to obtain a weight corresponding to each texture response characteristic image.
Preferably, the step of calculating the average energy entropy of the texture response map for each angle includes:
the average energy entropy is calculated as:
wherein,is shown asAverage energy entropy of texture response maps corresponding to the angles;is shown inTexture response map corresponding to each angleGo to the firstThe elements corresponding to the columns;a size representing the texture response map;representing the angular calibration coefficients.
Preferably, the angle calibration coefficient is:
wherein,representing an angle calibration coefficient;represents a reference angle;indicating an angle.
The invention has the following beneficial effects: according to the embodiment of the invention, the direction of the transverse rib on the surface of the deformed steel bar is obtained as the reference direction, the angles of the deformed steel bar surface initial image extracted with the texture information by the gray level co-occurrence matrix are corrected, the correction of each angle is obtained based on the texture response images of multiple scales under each angle, the accuracy of data analysis is improved, the deviation of the gray level co-occurrence matrix in extracting the abnormal texture characteristic information is avoided, the inverse difference moment image is further obtained, the judgment of the deformed steel bar surface abnormal category is completed through the neural network by combining the initial image, and the reliability of the judgment result is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a method for determining an abnormality of a deformed steel bar based on an attention mechanism according to an embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention for achieving the predetermined objects, the following detailed description of the method for determining deformed steel bar based on attention mechanism, its specific implementation, structure, features and effects will be made in conjunction with the accompanying drawings and preferred embodiments. In the following description, the different references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The method is suitable for identifying and judging the abnormal type of the surface of the deformed steel bar, the initial image on the surface of the deformed steel bar is preliminarily classified to obtain the gray level image corresponding to the suspected abnormal area, the angle when the gray level image is subjected to gray level co-occurrence matrix calculation is corrected for multiple times to obtain the final complete gray level co-occurrence matrix, the corresponding inverse difference moment image is obtained based on the complete gray level co-occurrence matrix, the inverse difference moment image and the initial image are input into a convolutional neural network to obtain the abnormal type, the influence of the abnormal direction on the extraction of the texture of the gray level co-occurrence matrix is avoided, and the identification accuracy is improved.
The following specifically describes a specific scheme of the deformed steel bar abnormality determination method based on the attention mechanism, which is provided by the invention, with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a method for determining an anomaly of a deformed steel bar based on an attention mechanism according to an embodiment of the present invention is shown, where the method includes the following steps:
s100, acquiring an initial image of the surface of the deformed steel bar, and calculating a saliency map corresponding to the initial image; and obtaining a suspected abnormal area in the initial image according to the saliency map.
Specifically, an implementer arranges an industrial camera for carrying out image acquisition on the surface of the deformed steel bar according to actual conditions to obtain an image of the surface of the deformed steel bar. In order to ensure the accuracy of the subsequent analysis image, the embodiment of the invention carries out Gaussian filtering processing on the image of the surface of the deformed steel bar to obtain an initial image of the surface of the deformed steel bar; and analyzing the characteristics of each pixel point in the initial image.
Converting the initial image from RGB color space to LAB color space to obtain an LAB image; and obtaining pixel mean values of pixel points in the LAB image respectively corresponding to an L channel, an A channel and a B channel, and obtaining a saliency map according to the initial image and the pixel mean value of each channel.
The specific method for acquiring the saliency map comprises the following steps: converting the RGB color space of the obtained initial image into an LAB color space to obtain an LAB image, and respectively calculating the pixel mean values of the LAB image in an L channel, an A channel and a B channel to be,,(ii) a Calculating the correspondence of the initial image to the L channelCorresponding to channel AAnd B channel correspondsThe sum of the euclidean distances between them yields a saliency map, which is an image used to show the uniqueness of each pixel.
In order to reduce the subsequent calculation amount, a normal area in the initial image is preliminarily excluded; and acquiring a classification threshold value based on the significance value of each pixel point in the significance map, wherein the pixel points with the significance values larger than the classification threshold value in the significance map are suspected abnormal pixel points, and all the suspected abnormal pixel points form a suspected abnormal area.
Specifically, the maximum significant value in the significant map is obtained, each significant value in the significant map is normalized, and a significant value histogram corresponding to the normalized significant map is calculated. Because a certain difference exists between the actual deformed steel bar surface abnormal region and the normal region, the maximum inter-class variance method is adopted in the embodiment of the invention to obtain the optimal classification threshold according to the significant value histogram, the maximum inter-class variance method is a common method for obtaining the threshold, and the specific process is not repeated. Dividing the saliency values in the saliency map into two categories based on the obtained optimal classification threshold; i.e. one category with a significance value greater than the classification threshold and another category with a significance value less than the classification threshold.
Because the color and brightness difference between the abnormal area and the surrounding normal pixels is large, and the corresponding significant value is also large, the pixel points corresponding to the categories with the significant values larger than the classification threshold are marked as suspected abnormal pixel points, and the areas formed by all the suspected abnormal pixel points are suspected abnormal areas; for the convenience of subsequent analysis, the suspected abnormal area is a minimum circumscribed rectangular area of all the suspected abnormal pixel point forming areas.
Step S200, acquiring a gray image of a suspected abnormal area, and acquiring an angle of the deformed steel bar transverse rib on the gray image as a reference angle; and acquiring texture response characteristic maps of the gray level images at multiple scales under any angle according to the filter.
In step S100, the suspected abnormal area corresponding to the initial image of the surface of the deformed steel bar is obtained, and the suspected abnormal area is grayed to obtain a corresponding grayscale image, and a specific graying method implementer can select the grayscale image. In the actual acquisition process of the threaded nail surface image by using an industrial camera, abnormal features may be different due to the angle direction, the distribution of partial abnormal in a certain specific direction in space is considered to be more, and in order to avoid the influence of the angle on the image analysis processing, in the embodiment of the invention, the transverse rib angle direction of the threaded steel surface is taken as a reference angle, a straight line is fitted in the area where the threaded steel transverse rib is located in the gray scale image by adopting a least square method, and the reference angle of the transverse rib of the threaded steel on the gray scale image is obtained by the slope of the straight line and is:
wherein,represents a reference angle;representing the slope of the corresponding straight line of the deformed steel bar cross rib;representing the arctan function.
Further, when the gray level co-occurrence matrix is calculated for the gray level image, the fixed calculation direction may cause the loss of texture information in the gray level image, so the calculation direction of the gray level co-occurrence matrix needs to be analyzed. In the embodiment of the invention, the direction of the abnormal texture is estimated through the Gabor filter, and the Gabor filters at a plurality of angles and a plurality of scales are selected to process the gray level image in order to increase the accuracy of analysis.
Preferably, in the embodiment of the invention, 4 Gabor filters with different angles and 4 different scales are selected; 4 degree angle,,Andare respectively,,Andthe 4 dimensions are 0,4,8, 32, respectively.
Taking any one angle as an example, performing convolution operation on the gray level image by using Gabor filters with different scales to obtain a corresponding texture response characteristic diagram:
wherein,a texture response characteristic diagram representing any scale at the angle;a Gabor kernel function representing an arbitrary scale at the angle;representing a grayscale image.
By parity of reasoning, obtaining a texture response characteristic diagram corresponding to each scale at the angle, and dividing the texture response characteristic diagrams intoIs otherwise noted as,,And。
and step S300, calculating the weight corresponding to each texture response characteristic image under any angle based on the reference angle, and performing weighted summation on the weight and the texture response characteristic image of each scale to obtain the texture response image of any angle.
Specifically, in step S200, texture response feature maps corresponding to 4 scales at an angle are obtained, and visual saliency detection is performed on the texture response feature maps to determine the intensity of texture response at different scales, in the embodiment of the present invention, a visual saliency algorithm of gray scale gradients is used, and a texture gradient value calculation is performed on each pixel point in a gray scale image based on the reference direction of the cross rib obtained in step S200, where the texture gradient value calculation is as follows:
wherein,representing coordinates in a gray scale image asThe texture gradient value corresponding to the pixel point of (a);representing coordinates in a gray scale image asCorresponding texture response characteristic value of the pixel point of (1);represents a reference angle;representing the corresponding angle of the corresponding characteristic diagram of the texture;representing a scale;representing a cosine function;representing a sinusoidal function.
By analogy, obtaining texture gradient values corresponding to each pixel point in the texture response characteristic graph to form a texture gradient graph; similarly, the texture gradient maps of 4 different scales at the angle obtained based on the correction of the reference angle are respectively recorded as、、And。
further, obtaining the mean value of the pixels of each texture gradient image under the angle, and obtaining a corresponding texture saliency image according to the mean value of the gray level image and any texture gradient image; and acquiring a texture significant mean value corresponding to each texture significant image, and normalizing the texture significant mean value to obtain a weight corresponding to each texture response characteristic image.
Specifically, a gradient mean value corresponding to each texture gradient map, that is, a mean value of all pixel values in each texture gradient map, is obtained and recorded as、、And(ii) a And obtaining corresponding 4 texture saliency maps with different scales according to the sum of Euclidean distances between the gray level image and the mean value corresponding to each texture gradient map. Respectively calculating the mean value of the texture significant image as the strength degree of the texture response characteristic under the scale, and normalizing the texture significant mean value of the texture significant image under each scale to obtain the weight of the texture response characteristic respectively、、And。
weighting and summing the obtained weights and the corresponding texture response characteristic graphs to obtain the corresponding texture response graphs under the angle as follows:
wherein,is shown at an angleA lower corresponding texture response map;is shown asWeights corresponding to the scale texture response characteristic graphs;is shown at an angleFirst toAnd (4) texture response characteristic maps corresponding to the scales.
Thereby obtaining a corresponding texture response map under the angle; correspondingly, based on the same method for obtaining the texture response maps, the texture response maps respectively corresponding to the 4 angles are obtained and recorded as: 、 、 and。
step S400, calculating the average energy entropy of the texture response graph of each angle, and distributing a weight value for each angle according to the average energy entropy; and calculating a gray level co-occurrence matrix of the gray level image at each angle, and performing weighted summation based on the weight, the reference angle and each gray level co-occurrence matrix to obtain a complete gray level co-occurrence matrix.
In step S300, the texture response maps corresponding to different angles are obtained, and the 4 textures are determined for abnormal texture judgment
And (3) solving the average energy entropy of each obtained texture response image as follows according to the strength of the texture response degree under the angle:
wherein,is shown asAverage energy entropy of texture response maps corresponding to the angles;is shown inTexture response map corresponding to each angleGo to the firstThe elements corresponding to the columns;the size of the texture response graph is largeSmall;an angle calibration coefficient is represented that characterizes the response component of the texture response map for that angle at the reference angle.
The calculation method of the angle calibration coefficient in the embodiment of the invention comprises the following steps:
wherein,representing an angle calibration coefficient;represents a reference angle;indicating an angle.
By analogy, the average energy entropy corresponding to the texture response graphs under 4 angles is obtained as、、Andnormalizing the obtained 4 average energy entropies to obtain a weight value of each angle,,And. The larger the average energy entropy is, the more texture information contained in the texture response map at the angle is, the larger the corresponding weight value should be.
Further, calculating a gray level co-occurrence matrix for the gray level image acquired in step S200, specifically:
(1) Selecting a sliding window with any size, and taking a certain point on the gray imageAnd a point at a distance from the pointAs a set of point pairs, the gray value corresponding to each point of the point pair is formed into a point pair;
(2) The number of gray levels appearing in the gray image is counted asPoint pairs that can be formed in the gray scale imageIs combined withI.e. can be given a size ofThe gray level co-occurrence matrix of (2);
(3) For any size of sliding window, counting each point pairThe number of times of appearance in the sliding window is used for obtaining the gray level co-occurrence matrixAssigning a center point within the sliding window; that is, each pixel point in the gray image corresponds to a gray co-occurrence matrix.
Preferably, in the embodiment of the present invention, the size of the sliding window is set to beTemplate angular orientation of gray level co-occurrence matrix、、And4 angles of (a).
It should be noted that, in the following description,andthe relative size of the template determines the orientation of the template when,When the direction of the template isDirection of when,When the direction of the template isDirection when,When the direction of the template isDirection of when,When the direction of the template isAnd (4) direction.
Correspondingly, the final complete gray level co-occurrence matrix obtained by considering the reference angle of the cross rib on the surface of the deformed steel bar and the calibration coefficient of the gray level co-occurrence matrix template angle relative to the reference angle is as follows:
wherein,representing a complete gray level co-occurrence matrix;correction of angle of representationQuasi-coefficient;is shown asWeight corresponding to angle
A value;denotes the firstAnd (5) gray level co-occurrence matrix corresponding to the gray level image under the angle.
And S500, calculating an inverse difference matrix image according to the complete gray level co-occurrence matrix, and inputting the inverse difference matrix image and the initial image into a convolutional neural network to obtain the abnormal category of the surface of the deformed steel bar.
Specifically, the complete gray level co-occurrence matrix corresponding to the gray level image is obtained in step S400, and the inverse difference moment of the complete gray level co-occurrence matrix is selected as the measure of the significant value, where the inverse difference moment may reflect the homogeneity of the image texture, that is, the local variation value of the image texture is measured; if the inverse difference moment is larger, the local image texture distribution is more uniform, and the defects of scabbing, cracks, scratches and the like are possible; if the inverse difference moment is smaller, the local image texture distribution is non-uniform and can be abnormal such as pitted surface and pits; therefore, different abnormal features can be characterized according to the magnitude of the adverse difference moment. The calculation of the moment of the adverse difference is specifically as follows:
wherein,representing the moment of the adverse difference;representing the first in a grey scale imageAnd row and columnGray level co-occurrence matrixes corresponding to the column pixel points;representing the number of pixel gray levels in a gray scale image.
In the embodiment of the invention, the abnormity of the surface of the deformed steel bar is divided into five types of pits, scars, cracks, scratches and pittings, in order to realize accurate classification of different abnormity of the surface of the deformed steel bar, the abnormal type of the surface of the deformed steel bar is identified by adopting a convolutional neural network, a training set of the convolutional neural network is an initial image of the surface of the deformed steel bar collected historically, and the specific training process is as follows:
(1) The input of the convolution neural network is an initial image of the surface of the deformed steel bar and an inverse difference moment image corresponding to the initial image;
(2) Marking the abnormity of the surface of the deformed steel bar by a professional, marking the abnormity of the pit as 0 and marking the abnormity of the scab as 1; the crack anomaly is labeled 2; the scratch anomaly is marked as 3; the pitted surface anomaly is marked as 4; the normal area is labeled 5;
(3) The output of the convolutional neural network is a different anomaly class of the surface of the deformed steel bar.
The recognition of five abnormal categories of pits, scars, cracks, scratches, pittings and the like on the surface of the deformed steel bar can be completed based on the trained convolutional neural network.
In summary, in the embodiment of the present invention, an initial image of the surface of the deformed steel bar is collected, a saliency map corresponding to the initial image is calculated, a suspected abnormal area is obtained through preliminary classification, a grayscale image corresponding to the suspected abnormal area is obtained, and an angle of a transverse rib on the surface of the deformed steel bar is obtained according to the grayscale image and is used as a reference angle; the gray level image is further processed according to a plurality of angles and a plurality of scales of filters to obtain corresponding feature maps of textures corresponding to different scales at each angle, a texture gradient map corresponding to each texture response feature map is calculated, a weight is distributed to each texture response feature map based on the texture gradient map, finally the weight and the corresponding texture response feature map are subjected to weighted summation to obtain the texture response map corresponding to the angle, correspondingly, the texture response map corresponding to each angle is obtained, the average energy entropy of each texture response map is calculated, and the size of the average energy entropy is used as a weighing index of the texture response map, so that the weight corresponding to each angle is obtained. When gray level co-occurrence matrix calculation is actually carried out on a gray level image, the template angle of the gray level co-occurrence matrix is corrected by considering the reference angle of the transverse rib, a complete gray level co-occurrence matrix corresponding to the gray level image is obtained by combining the weight corresponding to each angle, the inverse difference moment corresponding to the complete gray level co-occurrence matrix is calculated to obtain an inverse difference moment image, the inverse difference moment image and the initial image are input into a convolutional neural network to identify the type of thread steel surface abnormality, the influence of the gray level co-occurrence matrix on texture information extraction caused by the direction of the thread steel surface abnormality is avoided, and the accuracy of thread steel surface abnormality type identification is improved by combining the convolutional neural network.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (7)
1. A deformed steel bar abnormity judgment method based on an attention mechanism is characterized by comprising the following steps:
acquiring an initial image of the surface of the deformed steel bar, and calculating a saliency map corresponding to the initial image; obtaining a suspected abnormal area in the initial image according to the saliency map;
acquiring a gray image of the suspected abnormal area, and acquiring an angle of the deformed steel bar transverse rib on the gray image as a reference angle; acquiring texture response characteristic maps of the gray level image under multiple scales at any angle according to a filter;
calculating the weight corresponding to each texture response characteristic image under any angle based on the reference angle, and obtaining the texture response image of any angle by weighting and summing the weight and the texture response characteristic images of each scale;
calculating the average energy entropy of the texture response graph of each angle, and distributing a weight to each angle according to the average energy entropy; calculating a gray level co-occurrence matrix of the gray level image at each angle, and performing weighted summation based on the weight, the reference angle and each gray level co-occurrence matrix to obtain a complete gray level co-occurrence matrix;
and calculating an inverse difference matrix image according to the complete gray level co-occurrence matrix, and inputting the inverse difference matrix image and the initial image into a convolutional neural network to obtain the abnormal category of the surface of the deformed steel bar.
2. The method according to claim 1, wherein the step of calculating the saliency map corresponding to the initial image comprises:
converting the initial image from an RGB color space to an LAB color space to obtain an LAB image; and obtaining pixel mean values of pixel points in the LAB image respectively corresponding to an L channel, an A channel and a B channel, and obtaining the saliency map according to the initial image and the pixel mean value of each channel.
3. The method of claim 1, wherein the step of obtaining the suspected abnormal region in the initial image according to the saliency map comprises:
and acquiring a classification threshold value based on the significance value of each pixel point in the significance map, wherein the pixel points with the significance values larger than the classification threshold value in the significance map are suspected abnormal pixel points, and all the suspected abnormal pixel points form the suspected abnormal area.
4. The method according to claim 1, wherein the step of calculating the weight corresponding to each of the texture response feature maps at any of the angles based on the reference angle comprises:
calculating the texture gradient value of each pixel point in the texture response characteristic graph under the angle as follows:
wherein,representing coordinates in a gray scale image asThe texture gradient value corresponding to the pixel point of (a);representing coordinates in a gray scale image asCorresponding texture response characteristic value of the pixel point of (1);represents a reference angle;representing the corresponding angle of the corresponding characteristic diagram of the texture;representing a scale;representing a cosine function;representing a sine function;
and forming a texture gradient map according to the texture gradient value of each pixel point, and obtaining the weight corresponding to each texture response characteristic map according to the texture gradient map.
5. The method of claim 4, wherein the step of obtaining the weight corresponding to each texture response feature map according to the texture gradient map comprises:
obtaining the mean value of the pixels of each texture gradient image under the angle, and obtaining a corresponding texture saliency map according to the mean value of the gray level image and any texture gradient image;
and acquiring a texture significant mean value corresponding to each texture significant image, and normalizing the texture significant mean value to obtain a weight corresponding to each texture response characteristic image.
6. The method of claim 1, wherein the step of calculating the average energy entropy of the texture response map for each of the angles comprises:
the average energy entropy is calculated as:
wherein,denotes the firstAverage energy entropy of the texture response map corresponding to each angle;is shown inTexture response map corresponding to each angleGo to the firstThe elements corresponding to the columns;representing the size of the texture response map;representing angular calibration coefficients。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210844509.9A CN114998323B (en) | 2022-07-19 | 2022-07-19 | Deformed steel bar abnormity determination method based on attention mechanism |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210844509.9A CN114998323B (en) | 2022-07-19 | 2022-07-19 | Deformed steel bar abnormity determination method based on attention mechanism |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114998323A CN114998323A (en) | 2022-09-02 |
CN114998323B true CN114998323B (en) | 2022-10-21 |
Family
ID=83021755
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210844509.9A Active CN114998323B (en) | 2022-07-19 | 2022-07-19 | Deformed steel bar abnormity determination method based on attention mechanism |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114998323B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115345525B (en) * | 2022-10-17 | 2023-02-24 | 江苏鑫缘医疗科技有限公司 | Muscle bandage online production testing system and method based on machine vision |
CN115471505B (en) * | 2022-11-14 | 2023-07-28 | 华联机械集团有限公司 | Intelligent regulation and control method for case sealer based on visual recognition |
CN115496918B (en) * | 2022-11-16 | 2023-03-21 | 山东高速股份有限公司 | Method and system for detecting abnormal highway conditions based on computer vision |
CN116843689B (en) * | 2023-09-01 | 2023-11-21 | 山东众成菌业股份有限公司 | Method for detecting surface damage of fungus cover |
CN117173179B (en) * | 2023-11-02 | 2024-03-05 | 南通市通州兴辰机械有限公司 | Method and system for rapidly detecting production quality of sound-proof cloth |
CN117765051B (en) * | 2024-01-10 | 2024-06-07 | 济宁市市政园林养护中心 | Afforestation maintenance monitoring and early warning system and method |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101408932B (en) * | 2008-04-11 | 2012-06-20 | 浙江师范大学 | Method for matching finger print image based on finger print structure feature and veins analysis |
CN103605958A (en) * | 2013-11-12 | 2014-02-26 | 北京工业大学 | Living body human face detection method based on gray scale symbiosis matrixes and wavelet analysis |
CN111080574A (en) * | 2019-11-19 | 2020-04-28 | 天津工业大学 | Fabric defect detection method based on information entropy and visual attention mechanism |
-
2022
- 2022-07-19 CN CN202210844509.9A patent/CN114998323B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN114998323A (en) | 2022-09-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114998323B (en) | Deformed steel bar abnormity determination method based on attention mechanism | |
CN113689428B (en) | Mechanical part stress corrosion detection method and system based on image processing | |
CN115294113B (en) | Quality detection method for wood veneer | |
CN115239735B (en) | Communication cabinet surface defect detection method based on computer vision | |
CN103593670B (en) | A kind of copper plate/strip detection method of surface flaw based on online limit of sequence learning machine | |
CN114862849B (en) | Aluminum alloy plate film coating effect evaluation method based on image processing | |
CN116452598B (en) | Axle production quality rapid detection method and system based on computer vision | |
CN110210448B (en) | Intelligent face skin aging degree identification and evaluation method | |
CN110472479B (en) | Finger vein identification method based on SURF feature point extraction and local LBP coding | |
CN116645367B (en) | Steel plate cutting quality detection method for high-end manufacturing | |
CN113554629A (en) | Strip steel red rust defect detection method based on artificial intelligence | |
CN115294140A (en) | Hardware part defect detection method and system | |
CN108154498A (en) | A kind of rift defect detecting system and its implementation | |
CN117689655B (en) | Metal button surface defect detection method based on computer vision | |
CN112651968A (en) | Wood board deformation and pit detection method based on depth information | |
CN117893532B (en) | Die crack defect detection method for die forging rigging based on image processing | |
CN116542972B (en) | Wall plate surface defect rapid detection method based on artificial intelligence | |
CN115330791A (en) | Part burr detection method | |
CN110286139B (en) | Method for distinguishing big data composite characteristics of paint film of ancient lacquerware | |
CN116152242B (en) | Visual detection system of natural leather defect for basketball | |
CN115526889B (en) | Nondestructive testing method of boiler pressure pipeline based on image processing | |
CN116883408B (en) | Integrating instrument shell defect detection method based on artificial intelligence | |
CN112258444A (en) | Elevator steel wire rope detection method | |
CN116452589A (en) | Intelligent detection method for surface defects of artificial board based on image processing | |
CN111814852A (en) | Image detection method, image detection device, electronic equipment and computer-readable storage medium |
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 |