CN114998323B - Deformed steel bar abnormity determination method based on attention mechanism - Google Patents

Deformed steel bar abnormity determination method based on attention mechanism Download PDF

Info

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
Application number
CN202210844509.9A
Other languages
Chinese (zh)
Other versions
CN114998323A (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.)
Nantong Feixuan Intelligent Technology Co ltd
Original Assignee
Nantong Feixuan Intelligent 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 Nantong Feixuan Intelligent Technology Co ltd filed Critical Nantong Feixuan Intelligent Technology Co ltd
Priority to CN202210844509.9A priority Critical patent/CN114998323B/en
Publication of CN114998323A publication Critical patent/CN114998323A/en
Application granted granted Critical
Publication of CN114998323B publication Critical patent/CN114998323B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial 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

Deformed steel bar abnormity determination method based on attention mechanism
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:
Figure DEST_PATH_IMAGE001
Figure 862554DEST_PATH_IMAGE002
Figure DEST_PATH_IMAGE003
wherein,
Figure 245999DEST_PATH_IMAGE004
representing coordinates in a gray scale image as
Figure DEST_PATH_IMAGE005
The texture gradient value corresponding to the pixel point of (a);
Figure 217366DEST_PATH_IMAGE006
representing coordinates in a gray scale image as
Figure 83691DEST_PATH_IMAGE005
The texture response characteristic value corresponding to the pixel point of (1);
Figure 94504DEST_PATH_IMAGE007
represents a reference angle;
Figure 970056DEST_PATH_IMAGE008
representing the corresponding angle of the corresponding characteristic diagram of the texture;
Figure 999192DEST_PATH_IMAGE009
representing a scale;
Figure 285685DEST_PATH_IMAGE010
representing a cosine function;
Figure 33062DEST_PATH_IMAGE011
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:
Figure 446725DEST_PATH_IMAGE012
wherein,
Figure 595947DEST_PATH_IMAGE013
is shown as
Figure 85965DEST_PATH_IMAGE008
Average energy entropy of texture response maps corresponding to the angles;
Figure 55058DEST_PATH_IMAGE014
is shown in
Figure 272413DEST_PATH_IMAGE008
Texture response map corresponding to each angle
Figure 525409DEST_PATH_IMAGE015
Go to the first
Figure 904437DEST_PATH_IMAGE016
The elements corresponding to the columns;
Figure 360827DEST_PATH_IMAGE017
a size representing the texture response map;
Figure 132605DEST_PATH_IMAGE018
representing the angular calibration coefficients.
Preferably, the angle calibration coefficient is:
Figure 990839DEST_PATH_IMAGE019
wherein,
Figure 71928DEST_PATH_IMAGE018
representing an angle calibration coefficient;
Figure 15613DEST_PATH_IMAGE007
represents a reference angle;
Figure 558459DEST_PATH_IMAGE008
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
Figure 271200DEST_PATH_IMAGE020
Figure 523189DEST_PATH_IMAGE021
Figure 704903DEST_PATH_IMAGE022
(ii) a Calculating the correspondence of the initial image to the L channel
Figure 67751DEST_PATH_IMAGE020
Corresponding to channel A
Figure 634999DEST_PATH_IMAGE021
And B channel corresponds
Figure 792311DEST_PATH_IMAGE022
The 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:
Figure 959856DEST_PATH_IMAGE023
wherein,
Figure 595237DEST_PATH_IMAGE007
represents a reference angle;
Figure 282570DEST_PATH_IMAGE024
representing the slope of the corresponding straight line of the deformed steel bar cross rib;
Figure 627095DEST_PATH_IMAGE025
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
Figure 767089DEST_PATH_IMAGE026
Figure 737319DEST_PATH_IMAGE027
Figure 279159DEST_PATH_IMAGE028
And
Figure 39260DEST_PATH_IMAGE029
are respectively
Figure 666550DEST_PATH_IMAGE030
Figure 909312DEST_PATH_IMAGE031
Figure 321970DEST_PATH_IMAGE032
And
Figure 991986DEST_PATH_IMAGE033
the 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:
Figure 106573DEST_PATH_IMAGE034
wherein,
Figure 153026DEST_PATH_IMAGE035
a texture response characteristic diagram representing any scale at the angle;
Figure 918726DEST_PATH_IMAGE036
a Gabor kernel function representing an arbitrary scale at the angle;
Figure 25222DEST_PATH_IMAGE037
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
Figure 627105DEST_PATH_IMAGE038
Figure 962402DEST_PATH_IMAGE039
Figure 598920DEST_PATH_IMAGE040
And
Figure 610738DEST_PATH_IMAGE041
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:
Figure 434338DEST_PATH_IMAGE001
Figure 337440DEST_PATH_IMAGE042
Figure 562885DEST_PATH_IMAGE003
wherein,
Figure 745605DEST_PATH_IMAGE004
representing coordinates in a gray scale image as
Figure 72812DEST_PATH_IMAGE005
The texture gradient value corresponding to the pixel point of (a);
Figure 999180DEST_PATH_IMAGE006
representing coordinates in a gray scale image as
Figure 79132DEST_PATH_IMAGE005
Corresponding texture response characteristic value of the pixel point of (1);
Figure 698332DEST_PATH_IMAGE007
represents a reference angle;
Figure 11370DEST_PATH_IMAGE008
representing the corresponding angle of the corresponding characteristic diagram of the texture;
Figure 475850DEST_PATH_IMAGE009
representing a scale;
Figure 675887DEST_PATH_IMAGE010
representing a cosine function;
Figure 200409DEST_PATH_IMAGE011
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
Figure 971050DEST_PATH_IMAGE043
Figure 770379DEST_PATH_IMAGE044
Figure 824923DEST_PATH_IMAGE045
And
Figure 520346DEST_PATH_IMAGE046
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
Figure 542398DEST_PATH_IMAGE047
Figure 879838DEST_PATH_IMAGE048
Figure 788888DEST_PATH_IMAGE049
And
Figure 671525DEST_PATH_IMAGE050
(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
Figure 666025DEST_PATH_IMAGE051
Figure 541578DEST_PATH_IMAGE052
Figure 836293DEST_PATH_IMAGE053
And
Figure 122786DEST_PATH_IMAGE054
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:
Figure 870163DEST_PATH_IMAGE055
wherein,
Figure 283826DEST_PATH_IMAGE056
is shown at an angle
Figure 183780DEST_PATH_IMAGE008
A lower corresponding texture response map;
Figure 391908DEST_PATH_IMAGE057
is shown as
Figure 361001DEST_PATH_IMAGE015
Weights corresponding to the scale texture response characteristic graphs;
Figure 578356DEST_PATH_IMAGE058
is shown at an angle
Figure 565772DEST_PATH_IMAGE008
First to
Figure 210380DEST_PATH_IMAGE015
And (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:
Figure 666769DEST_PATH_IMAGE059
Figure 687815DEST_PATH_IMAGE060
Figure 296782DEST_PATH_IMAGE061
and
Figure 112291DEST_PATH_IMAGE062
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:
Figure 55976DEST_PATH_IMAGE063
wherein,
Figure 864401DEST_PATH_IMAGE013
is shown as
Figure 577142DEST_PATH_IMAGE008
Average energy entropy of texture response maps corresponding to the angles;
Figure 563553DEST_PATH_IMAGE014
is shown in
Figure 994534DEST_PATH_IMAGE008
Texture response map corresponding to each angle
Figure 842535DEST_PATH_IMAGE015
Go to the first
Figure 409783DEST_PATH_IMAGE016
The elements corresponding to the columns;
Figure 567095DEST_PATH_IMAGE017
the size of the texture response graph is largeSmall;
Figure 219793DEST_PATH_IMAGE018
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:
Figure 381739DEST_PATH_IMAGE064
wherein,
Figure 69073DEST_PATH_IMAGE018
representing an angle calibration coefficient;
Figure 662865DEST_PATH_IMAGE007
represents a reference angle;
Figure 802859DEST_PATH_IMAGE008
indicating an angle.
By analogy, the average energy entropy corresponding to the texture response graphs under 4 angles is obtained as
Figure 992663DEST_PATH_IMAGE065
Figure 800082DEST_PATH_IMAGE066
Figure 299197DEST_PATH_IMAGE067
And
Figure 441334DEST_PATH_IMAGE068
normalizing the obtained 4 average energy entropies to obtain a weight value of each angle
Figure 684097DEST_PATH_IMAGE069
Figure 611601DEST_PATH_IMAGE070
Figure 32349DEST_PATH_IMAGE071
And
Figure 146936DEST_PATH_IMAGE072
. 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 image
Figure 193389DEST_PATH_IMAGE005
And a point at a distance from the point
Figure 224668DEST_PATH_IMAGE073
As a set of point pairs, the gray value corresponding to each point of the point pair is formed into a point pair
Figure 65585DEST_PATH_IMAGE074
(2) The number of gray levels appearing in the gray image is counted as
Figure 401889DEST_PATH_IMAGE075
Point pairs that can be formed in the gray scale image
Figure 252033DEST_PATH_IMAGE074
Is combined with
Figure 373704DEST_PATH_IMAGE076
I.e. can be given a size of
Figure 651101DEST_PATH_IMAGE077
The gray level co-occurrence matrix of (2);
(3) For any size of sliding window, counting each point pair
Figure 740280DEST_PATH_IMAGE074
The number of times of appearance in the sliding window is used for obtaining the gray level co-occurrence matrix
Figure 112225DEST_PATH_IMAGE077
Assigning 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 be
Figure 603249DEST_PATH_IMAGE078
Template angular orientation of gray level co-occurrence matrix
Figure 51548DEST_PATH_IMAGE030
Figure 362443DEST_PATH_IMAGE031
Figure 39543DEST_PATH_IMAGE032
And
Figure 385074DEST_PATH_IMAGE033
4 angles of (a).
It should be noted that, in the following description,
Figure 738695DEST_PATH_IMAGE079
and
Figure 51734DEST_PATH_IMAGE080
the relative size of the template determines the orientation of the template when
Figure 781792DEST_PATH_IMAGE081
Figure 981829DEST_PATH_IMAGE082
When the direction of the template is
Figure 771931DEST_PATH_IMAGE030
Direction of when
Figure 808151DEST_PATH_IMAGE081
Figure 341901DEST_PATH_IMAGE083
When the direction of the template is
Figure 662023DEST_PATH_IMAGE031
Direction when
Figure 606715DEST_PATH_IMAGE084
Figure 379499DEST_PATH_IMAGE083
When the direction of the template is
Figure 451360DEST_PATH_IMAGE032
Direction of when
Figure 625989DEST_PATH_IMAGE085
Figure 508626DEST_PATH_IMAGE083
When the direction of the template is
Figure 503126DEST_PATH_IMAGE033
And (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:
Figure 378679DEST_PATH_IMAGE086
wherein,
Figure 657082DEST_PATH_IMAGE087
representing a complete gray level co-occurrence matrix;
Figure 959887DEST_PATH_IMAGE018
correction of angle of representationQuasi-coefficient;
Figure 707264DEST_PATH_IMAGE088
is shown as
Figure 120927DEST_PATH_IMAGE015
Weight corresponding to angle
A value;
Figure 755302DEST_PATH_IMAGE089
denotes the first
Figure 494588DEST_PATH_IMAGE015
And (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:
Figure 463681DEST_PATH_IMAGE090
wherein,
Figure 195883DEST_PATH_IMAGE091
representing the moment of the adverse difference;
Figure 934031DEST_PATH_IMAGE092
representing the first in a grey scale image
Figure 844219DEST_PATH_IMAGE015
And row and column
Figure 51340DEST_PATH_IMAGE016
Gray level co-occurrence matrixes corresponding to the column pixel points;
Figure 806807DEST_PATH_IMAGE075
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:
Figure 742929DEST_PATH_IMAGE001
Figure 712022DEST_PATH_IMAGE002
Figure 663797DEST_PATH_IMAGE003
wherein,
Figure 667525DEST_PATH_IMAGE004
representing coordinates in a gray scale image as
Figure 328445DEST_PATH_IMAGE005
The texture gradient value corresponding to the pixel point of (a);
Figure 784834DEST_PATH_IMAGE006
representing coordinates in a gray scale image as
Figure 274721DEST_PATH_IMAGE005
Corresponding texture response characteristic value of the pixel point of (1);
Figure 132956DEST_PATH_IMAGE007
represents a reference angle;
Figure 197733DEST_PATH_IMAGE008
representing the corresponding angle of the corresponding characteristic diagram of the texture;
Figure 141418DEST_PATH_IMAGE009
representing a scale;
Figure 700575DEST_PATH_IMAGE010
representing a cosine function;
Figure 413316DEST_PATH_IMAGE011
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:
Figure 884880DEST_PATH_IMAGE012
wherein,
Figure 315861DEST_PATH_IMAGE013
denotes the first
Figure 413130DEST_PATH_IMAGE008
Average energy entropy of the texture response map corresponding to each angle;
Figure 449219DEST_PATH_IMAGE014
is shown in
Figure 340952DEST_PATH_IMAGE008
Texture response map corresponding to each angle
Figure 508497DEST_PATH_IMAGE015
Go to the first
Figure 409457DEST_PATH_IMAGE016
The elements corresponding to the columns;
Figure 831211DEST_PATH_IMAGE017
representing the size of the texture response map;
Figure 159424DEST_PATH_IMAGE018
representing angular calibration coefficients。
7. The method of claim 6, wherein the angular calibration coefficients are:
Figure 50151DEST_PATH_IMAGE019
wherein,
Figure 20381DEST_PATH_IMAGE018
representing an angle calibration coefficient;
Figure 562221DEST_PATH_IMAGE007
represents a reference angle;
Figure 61335DEST_PATH_IMAGE008
indicating an angle.
CN202210844509.9A 2022-07-19 2022-07-19 Deformed steel bar abnormity determination method based on attention mechanism Active CN114998323B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

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