CN112465805A - Neural network training method for quality detection of steel bar stamping and bending - Google Patents

Neural network training method for quality detection of steel bar stamping and bending Download PDF

Info

Publication number
CN112465805A
CN112465805A CN202011463126.4A CN202011463126A CN112465805A CN 112465805 A CN112465805 A CN 112465805A CN 202011463126 A CN202011463126 A CN 202011463126A CN 112465805 A CN112465805 A CN 112465805A
Authority
CN
China
Prior art keywords
neural network
steel bar
convolutional neural
loss function
function value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202011463126.4A
Other languages
Chinese (zh)
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.)
Zhongshan Yiming Network Technology Co ltd
Original Assignee
Zhongshan Yiming Network 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 Zhongshan Yiming Network Technology Co ltd filed Critical Zhongshan Yiming Network Technology Co ltd
Priority to CN202011463126.4A priority Critical patent/CN112465805A/en
Publication of CN112465805A publication Critical patent/CN112465805A/en
Withdrawn legal-status Critical Current

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
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The application discloses a neural network training method for quality detection of steel bar stamping and bending, which comprises the following steps: acquiring a first training set containing an image of a punched and bent steel bar and a second training set containing an image of a steel bar which is detected to be qualified in punching and bending and an image of a steel bar which is detected to be unqualified in punching and bending; passing the first training set through a first convolutional neural network to obtain a first feature map; passing the second training set through a second convolutional neural network to obtain a second feature map, the second convolutional neural network having the same network structure as the first convolutional neural network; calculating a cosine distance loss function value between the first feature map and the second feature map; passing the first feature map through a classifier to obtain a classification loss function value; and updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value and the cosine distance loss function value.

Description

Neural network training method for quality detection of steel bar stamping and bending
Technical Field
The invention relates to the technical field of deep learning and neural networks, in particular to a neural network training method for quality detection of steel bar stamping and bending, a deep neural network-based quality detection method and system for steel bar stamping and bending and an electronic device.
Background
The reinforcing steel bar is steel for reinforced concrete and prestressed reinforced concrete, and the cross section of the reinforcing steel bar is circular or square with round corners. Comprises plain round steel bars, ribbed steel bars and twisted steel bars. Because the reinforcing bar often needs to be used after bending, consequently need to carry out the punching press to the reinforcing bar and bend, the great condition of bending error appears easily at the in-process that the reinforcing bar punching press was bent at present, consequently need carry out quality inspection to the bending error that the reinforcing bar punching press was bent in-process produced. In the existing method, a professional detector carries out manual judgment by the detector, so that the complexity of detection work is increased and an inaccurate judgment result is easily generated.
Therefore, it is desirable to be able to perform quality inspection of the press bending of the reinforcing bar by machine vision.
At present, deep learning and neural networks have been widely applied in the fields of computer vision, natural language processing, text signal processing, and the like. In addition, deep learning and neural networks also exhibit a level close to or even exceeding that of humans in the fields of image classification, object detection, semantic segmentation, text translation, and the like.
The deep learning and the development of the neural network provide a new solution for the quality detection problem of the stamping and bending of the reinforcing steel bars.
Disclosure of Invention
The present application is proposed to solve the above-mentioned technical problems. The embodiment of the application provides a neural network training method for quality detection of steel bar stamping and bending, a deep neural network-based quality detection method for steel bar stamping and bending, a system and electronic equipment.
According to one aspect of the application, a training method of a neural network for quality detection of steel bar stamping bending is provided, and comprises the following steps:
acquiring a first training set containing an image of a punched and bent steel bar and a second training set containing an image of a steel bar which is detected to be qualified in punching and bending and an image of a steel bar which is detected to be unqualified in punching and bending;
passing the first training set through a first convolutional neural network to obtain a first feature map;
passing the second training set through a second convolutional neural network to obtain a second feature map, the second convolutional neural network having the same network structure as the first convolutional neural network;
calculating a cosine distance loss function value between the first feature map and the second feature map;
passing the first feature map through a classifier to obtain a classification loss function value; and
updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value and the cosine distance loss function value.
In the above training method of the neural network for quality detection of stamping and bending of the steel bar, the step of passing the first feature map through a classifier to obtain a classification loss function value includes: passing the first feature map through a full connection layer to obtain a classification feature vector; and inputting the classification feature vector into a classification function to obtain the classification loss function value.
In the training method of the neural network for detecting the quality of the stamping and bending of the steel bars, in the second training set, the steel bars which are qualified in stamping and bending and the steel bars which are unqualified in stamping and bending are marked in each steel bar image in a label information mode, and the label information comprises parameters of the steel bars in the stamping process; the method further comprises the following steps: calculating a cross entropy loss function value between the first feature map and the label information; wherein updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value and the cosine distance loss function value comprises: updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value, the cosine distance loss function value, and the cross entropy loss function value.
In the training method of the neural network for detecting the quality of the stamping and bending of the steel bar, the parameters of the steel bar in the stamping process comprise the stamping force in the stamping process and the temperature of the steel bar after being bent.
In the above training method of a neural network for quality inspection of steel bar stamping bending, updating the first convolutional neural network, the second convolutional neural network and the classifier based on the weighted sum of the classification loss function value and the cosine distance loss function value includes: iteratively updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function values and the cosine distance loss function values; in each iteration, firstly, the parameters of the first convolutional neural network and the classifier are fixed, the parameters of the second convolutional neural network are updated, and then the parameters of the second convolutional neural network are fixed, and the parameters of the first convolutional neural network and the classifier are updated.
In the above training method of a neural network for quality inspection of steel bar stamping bending, updating the first convolutional neural network, the second convolutional neural network and the classifier based on the weighted sum of the classification loss function value and the cosine distance loss function value includes: iteratively updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value, the cosine distance loss function value, and the cross-entropy loss function value; in each iteration, firstly, the parameters of the first convolutional neural network and the classifier are fixed, the parameters of the second convolutional neural network are updated, and then the parameters of the second convolutional neural network are fixed, and the parameters of the first convolutional neural network and the classifier are updated.
According to another aspect of the application, a quality detection method for steel bar stamping and bending based on a deep neural network is provided, and the quality detection method comprises the following steps:
acquiring an image of a punched and bent steel bar to be detected;
inputting the reinforcing steel bar image into a first convolution neural network and the classifier trained according to the neural network training method for detecting the quality of the punching and bending of the reinforcing steel bar, wherein the output of the classifier is a first probability that the reinforcing steel bar is qualified after being punched and bent and a second probability that the reinforcing steel bar is unqualified after being punched and bent; and the number of the first and second groups,
and determining whether the steel bar is qualified to be punched based on the first probability and the second probability.
According to another aspect of the present application, there is provided a training system of a neural network for quality detection of steel bar stamping bending, comprising:
the training set acquisition unit is used for acquiring a first training set containing an image of the punched and bent steel bar and a second training set containing an image of the steel bar which is detected to be punched and bent and is unqualified;
a first feature map generating unit, configured to pass the first training set obtained by the training set obtaining unit through a first convolutional neural network to obtain a first feature map;
a second feature map generating unit, configured to pass the second training set obtained by the training set obtaining unit through a second convolutional neural network to obtain a second feature map, where the second convolutional neural network and the first convolutional neural network have the same network structure;
a cosine distance loss function value calculation unit configured to calculate a cosine distance loss function value between the first feature map obtained by the first feature map generation unit and the second feature map obtained by the second feature map generation unit;
a classification loss function value calculation unit configured to obtain a classification loss function value by passing the first feature map obtained by the first feature map generation unit through a classifier;
a parameter updating unit configured to update the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value obtained by the classification loss function value calculating unit and the cosine distance loss function value obtained by the cosine distance loss function value calculating unit.
In the above training system for a neural network for quality detection of stamping and bending of a steel bar, the classification loss function value calculation unit includes: the classified feature vector generation subunit is used for enabling the first feature map to pass through a full connection layer so as to obtain a classified feature vector; and a classification loss function value obtaining subunit, configured to input the classification feature vector into a classification function to obtain the classification loss function value.
In the training system of the neural network for detecting the quality of the stamping and bending of the steel bars, in the second training set, the steel bars which are qualified in stamping and bending and the steel bars which are unqualified in stamping and bending are marked in each steel bar image in a label information mode, wherein the label information comprises parameters of the steel bars in the stamping process; the training system further comprises: a cross entropy loss function value calculation unit, configured to calculate a cross entropy loss function value between the first feature map obtained by the first feature map generation unit and the label information in the second training set obtained by the training set obtaining unit; wherein the parameter updating unit is further configured to update the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value, the cosine distance loss function value, and the cross entropy loss function value.
In the training system of the neural network for detecting the quality of the stamping and bending of the steel bar, the parameters of the steel bar in the stamping process comprise the stamping force in the stamping process and the temperature of the steel bar after being bent.
In the above training system for a neural network used for quality detection of stamping and bending of a steel bar, the parameter updating unit is further configured to: iteratively updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function values and the cosine distance loss function values; in each iteration, firstly, the parameters of the first convolutional neural network and the classifier are fixed, the parameters of the second convolutional neural network are updated, and then the parameters of the second convolutional neural network are fixed, and the parameters of the first convolutional neural network and the classifier are updated.
In the above training system for a neural network used for quality detection of stamping and bending of a steel bar, the parameter updating unit is further configured to: iteratively updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value, the cosine distance loss function value, and the cross-entropy loss function value; in each iteration, firstly, the parameters of the first convolutional neural network and the classifier are fixed, the parameters of the second convolutional neural network are updated, and then the parameters of the second convolutional neural network are fixed, and the parameters of the first convolutional neural network and the classifier are updated.
According to another aspect of the application, a quality detection system for steel bar stamping and bending based on a deep neural network is provided, which includes:
the device comprises an image acquisition unit to be detected, a data acquisition unit and a data processing unit, wherein the image acquisition unit is used for acquiring an image containing a punched and bent steel bar to be detected;
the probability generation unit is used for inputting the reinforcing steel bar image obtained by the image acquisition unit to be detected into the first convolution neural network and the classifier trained by the neural network training method for quality detection of reinforcing steel bar stamping and bending, and the output of the classifier is a first probability representing that the reinforcing steel bar is qualified by stamping and bending and a second probability representing that the reinforcing steel bar is unqualified by stamping and bending; and
and the detection result generation unit is used for obtaining a detection result whether the steel bar to be detected is qualified by stamping or not based on the first probability that the steel bar is qualified by stamping and bending and the second probability that the steel bar is unqualified by stamping and bending, which are obtained by the probability generation unit.
According to still another aspect of the present application, there is provided an electronic apparatus including: a processor; and a memory in which computer program instructions are stored, which, when executed by the processor, cause the processor to execute the method of training a neural network for quality detection of steel bar press bending or the method of quality detection of steel bar press bending based on a deep neural network as described above.
According to yet another aspect of the present application, there is provided a computer readable medium having stored thereon computer program instructions which, when executed by a processor, cause the processor to execute the method of training a neural network for quality detection of steel bar punch bends or the method of quality detection of steel bar punch bends based on a deep neural network as described above.
Compared with the prior art, the training method of the neural network for quality detection of steel bar stamping and bending, the quality detection method and system for steel bar stamping and bending based on the deep neural network and the electronic equipment provided by the application have the advantages that in the training process of the neural network for quality detection of steel bar stamping and bending, the characteristic distribution extracted by the convolutional neural network is close to the connecting line direction of the characteristic distribution of the qualified image and the characteristic distribution of the unqualified image in the characteristic space through the cosine distance loss function, then the characteristic distribution extracted by aiming at the qualified sample and the unqualified sample moves towards the characteristic distribution of the qualified image and the unqualified image in the characteristic space through the training of the classification function, and therefore the classification of the images is achieved.
Drawings
The above and other objects, features and advantages of the present application will become more apparent by describing in more detail embodiments of the present application with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the principles of the application. In the drawings, like reference numbers generally represent like parts or steps.
Fig. 1 illustrates an application scenario of a neural network training method for steel bar stamping and bending quality detection and a deep neural network-based steel bar stamping and bending quality detection method according to an embodiment of the application;
FIG. 2 illustrates a flow chart of a training method of a neural network for quality detection of steel bar stamping bends according to an embodiment of the present application;
fig. 3 illustrates an architecture diagram of a training method of a neural network for quality detection of steel bar stamping bending according to an embodiment of the present application;
fig. 4 illustrates a flowchart of obtaining classification loss function values by a classifier based on the first feature map in a training method of a neural network for quality detection of steel bar stamping bending according to an embodiment of the present application;
FIG. 5 illustrates a flow chart of a deep neural network-based quality detection method for stamping and bending of steel bars according to an embodiment of the present application;
FIG. 6 illustrates a block diagram of a training system of a neural network for quality detection of rebar punch bending according to an embodiment of the present application;
fig. 7 is a block diagram illustrating a classification loss function value calculation unit in a training system of a neural network for quality detection of steel bar stamping bending according to an embodiment of the present application.
FIG. 8 illustrates a block diagram of a deep neural network based quality detection system for rebar punch bending in accordance with an embodiment of the present application;
FIG. 9 illustrates a block diagram of an electronic device in accordance with an embodiment of the present application.
Detailed Description
Hereinafter, example embodiments according to the present application will be described in detail with reference to the accompanying drawings. It should be understood that the described embodiments are only some embodiments of the present application and not all embodiments of the present application, and that the present application is not limited by the example embodiments described herein.
Overview of a scene
As described above, since the reinforcing steel bar is often used after being bent, the reinforcing steel bar needs to be stamped and bent, and a bending error is large in the process of stamping and bending the reinforcing steel bar, so that the quality of the bending error generated in the process of stamping and bending the reinforcing steel bar needs to be detected.
In recent years, deep learning and development of neural networks provide new solutions for quality detection of steel bar stamping and bending.
More specifically, in the practical application process, since the convolutional neural network can extract high-dimensional features in the image, it is conceivable to apply the convolutional neural network to the detection of the bending error of the steel bar to classify whether the bending error of the steel bar exceeds the threshold value by means of image classification. In this process, the applicant of the present application finds that if the convolutional neural network is trained only with the classification loss function, the parameter update of the convolutional neural network is not easy to converge due to too few constraints, and the training speed is slow.
In view of the above problem, the present inventors further calculate the distance between the feature map extracted by the convolutional neural network from the training image and the feature map extracted by the convolutional neural network from the real image, thereby updating the parameters of the convolutional neural network by minimizing the distance, so that the convolutional neural network can simulatively extract the features for determining the category of the image. Moreover, in the scheme of the application, the real images comprise both qualified images and unqualified images, so if the Euclidean distance reflecting the absolute distance between the feature spaces is adopted, the feature distribution of the qualified images and the unqualified images has a large Euclidean distance in the feature space, so that the convolutional neural network cannot be realized to imitate and learn the features for judging the qualified categories and the features for judging the unqualified categories. Therefore, the applicant of the present application considers that the cosine distance is used instead of the euclidean distance because of the relative difference in the direction of the cosine distance, rather than the absolute difference in the value, and thus even if there is a large euclidean distance in the feature space between the feature distributions of the qualified image and the unqualified image themselves, the extracted features can be made to approach the direction of the line connecting the two feature distributions by minimizing the cosine distance, so that when training is further performed based on the classification function, the high-dimensional feature distributions of the qualified sample and the unqualified sample can naturally be made to move toward the feature distributions of the qualified image and the unqualified image themselves.
In brief, the training process of the present application can be simply understood as that a cosine distance loss function is used to make the feature distribution extracted by the convolutional neural network approach to the direction of the connection line of the feature distribution of the qualified image and the feature distribution of the unqualified image in the feature space, and then the training of the classification function is used to make the feature distribution extracted for the qualified sample and the unqualified sample move towards the feature distribution of the qualified image and the unqualified image in the feature space, so as to realize the classification of the images.
Based on this, the application provides a training method of a neural network for quality detection of steel bar stamping bending, which includes: acquiring a first training set containing an image of a punched and bent steel bar and a second training set containing an image of a steel bar which is detected to be qualified in punching and bending and an image of a steel bar which is detected to be unqualified in punching and bending; passing the first training set through a first convolutional neural network to obtain a first feature map; passing the second training set through a second convolutional neural network to obtain a second feature map, the second convolutional neural network having the same network structure as the first convolutional neural network; calculating a cosine distance loss function value between the first feature map and the second feature map; passing the first feature map through a classifier to obtain a classification loss function value; and updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value and the cosine distance loss function value.
Based on this, the application also provides a quality detection method for steel bar stamping and bending based on the deep neural network, which comprises the following steps: acquiring an image of a punched and bent steel bar to be detected; inputting the reinforcing steel bar image into a first convolution neural network and the classifier trained by the training method of the neural network for detecting the quality of the punching and bending of the reinforcing steel bar, wherein the output of the classifier is a first probability representing that the reinforcing steel bar is qualified by punching and bending and a second probability representing that the reinforcing steel bar is unqualified by punching and bending; and determining whether the steel bar is qualified to be punched based on the first probability and the second probability.
Fig. 1 illustrates an application scenario of a training method of a neural network for quality detection of steel bar stamping bending and a deep neural network-based quality detection method for steel bar stamping bending according to an embodiment of the application.
As shown in fig. 1, in the training phase of the application scenario, a first training set including an image of a steel bar to be punched and bent and a second training set including an image of a steel bar to be detected as being qualified to be punched and bent and an image of a steel bar to be detected as being unqualified to be punched and bent are collected by a camera (e.g., C as illustrated in fig. 1); then, the first training set and the second training set are input into a server (for example, S as illustrated in fig. 1) in which a training algorithm of a neural network for quality detection of steel bar press bending is deployed, wherein the server can train a deep neural network for quality detection of steel bar press bending with the first training set and the second training set based on the training algorithm of the neural network for quality detection of steel bar press bending.
After the neural network is trained through the training algorithm of the neural network for detecting the quality of the steel bar stamping and bending, the quality of the steel bar stamping and bending can be detected based on the neural network.
Further, as shown in fig. 1, in the detection stage of the application scenario, an image containing the punched and bent steel bar is acquired by a camera (e.g., as indicated by C in fig. 1); then, the image is input into a server (for example, S as illustrated in fig. 1) deployed with a deep neural network-based steel bar stamping and bending quality detection algorithm, wherein the server is capable of processing the steel bar image based on a trained first convolution neural network and a classifier in the deep neural network-based steel bar stamping and bending quality detection algorithm, the output of the classifier is a first probability that the steel bar is qualified by stamping and bending and a second probability that the steel bar is unqualified by stamping and bending, and whether the steel bar is qualified by stamping is determined based on the first probability and the second probability.
Having described the general principles of the present application, various non-limiting embodiments of the present application will now be described with reference to the accompanying drawings.
Exemplary method
Fig. 2 illustrates a flow chart of a training method of a neural network for quality detection of steel bar press bending. As shown in fig. 2, a training method of a neural network for quality detection of steel bar stamping and bending according to an embodiment of the present application includes: s110, acquiring a first training set containing an image of the punched and bent steel bar and a second training set containing an image of the steel bar which is detected to be punched and bent to be qualified and an image of the steel bar which is detected to be punched and bent to be unqualified; s120, passing the first training set through a first convolutional neural network to obtain a first feature map; s130, passing the second training set through a second convolutional neural network to obtain a second feature map, wherein the second convolutional neural network and the first convolutional neural network have the same network structure; s140, calculating a cosine distance loss function value between the first feature map and the second feature map; s150, enabling the first feature map to pass through a classifier to obtain a classification loss function value; and S160, updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value and the cosine distance loss function value.
Fig. 3 illustrates an architecture diagram of a training method of a neural network for quality detection of steel bar stamping bending according to an embodiment of the present application. As shown IN fig. 3, IN the network architecture of the training method, first, an acquired first training set (e.g., IN1 as illustrated IN fig. 3) is passed through a first convolutional neural network (e.g., CNN1 as illustrated IN fig. 3) to obtain a first feature map (e.g., F1 as illustrated IN fig. 3); next, the obtained second training set (e.g., IN2 as illustrated IN FIG. 3) is passed through a second convolutional neural network (e.g., CNN2 as illustrated IN FIG. 3) to obtain a second feature map (e.g., as illustrated IN FIG. 3)F2 illustrated in fig. 3); then, the distance between the first feature map and the second feature map is passed through a cosine distance loss function (e.g., circle D as illustrated in fig. 3)L) Calculating to obtain a cosine distance loss function value; then, passing the first feature map through a classifier (e.g., a classifier as illustrated in fig. 3) to obtain a classification loss function value; then, the first convolutional neural network, the second convolutional neural network, and the classifier are updated based on a weighted sum of the classification loss function values and the cosine distance loss function values.
In step S110, a first training set including an image of the steel bar to be punched and bent and a second training set including an image of the steel bar to be detected as being qualified in punching and bending and an image of the steel bar to be detected as being unqualified in punching and bending are obtained.
In specific implementation, the punched and bent steel bars to be detected can be placed in a shooting range of a camera to acquire images of the steel bars through the camera, so that the images form a first training set, the steel bars to be detected are punched and bent to be qualified, and the steel bars to be detected are punched and bent to be unqualified are placed in the shooting range of the camera to acquire images of the steel bars through the camera, so that the images form a second training set. In constructing the first and second training sets, rebar can be placed on a platform (e.g., a table top) such that the rebar is completely unobstructed, enabling the first and second training sets to be constructed based on images captured by a camera.
It should be understood that in the embodiments of the present application, the purpose of constructing the first training set and the second training set is: extracting features from an image of a steel bar to be punched and bent by a convolution neural network, extracting features from an image of the steel bar to be punched and bent and qualified and an image of the steel bar to be punched and bent and unqualified by another convolution neural network, calculating a cosine distance loss function value between two feature graphs, and enabling the feature distribution extracted by the convolution neural network to be close to the connecting line direction of the feature distribution of the qualified image and the unqualified image in a feature space through a cosine distance loss function.
It should be noted that, in the embodiment of the present application, in the process of detecting the images of the steel bars that are qualified in stamping and bending and the images of the steel bars that are not qualified in stamping and bending, other auxiliary information may also be utilized to train a convolutional neural network for detecting the quality of the steel bars that are stamped and bent, for example, the stamping force during stamping, the temperature of the steel bars after being bent, and the like, and these auxiliary information may be marked in the form of tag information in each of the steel bar images.
In step S120, the first training set is passed through a first convolutional neural network to obtain a first feature map. Namely, the first convolution neural network is used for extracting the depth implicit features in the image of each punched and bent steel bar in the first training set so as to obtain the first feature map.
In step S130, the training set is input into a second convolutional neural network to obtain a second feature map, and the second convolutional neural network has the same network structure as the first convolutional neural network. Namely, the second convolutional neural network is used for extracting the depth implicit characteristics in the images which are qualified in the detected stamping bending and unqualified in the second training set so as to obtain the second characteristic diagram.
In step S140, a cosine distance loss function value between the first feature map and the second feature map is calculated. That is, the distance between the first feature map extracted by the first convolutional neural network from the images in the first training set and the feature map extracted by the second convolutional neural network from the images in the second training set is calculated, so that the parameters of the convolutional neural network are updated by minimizing the distance, thereby enabling the convolutional neural network to simulatively extract the features for determining the category of the images.
Specifically, in the embodiment of the present application, it is considered that a cosine distance is used instead of the euclidean distance, because of a relative difference in the direction of the cosine distance, rather than an absolute difference in value, even if there is a large euclidean distance between the feature distributions of the qualified image and the unqualified image in the feature space, the extracted features may be made to approach the direction of the connecting line between the two feature distributions by minimizing the cosine distance, so that when training is further performed based on the classification function, the high-dimensional feature distributions of the qualified sample and the unqualified sample may naturally move toward the feature distributions of the qualified image and the unqualified image.
In step S150, the first feature map is passed through a classifier to obtain a classification loss function value. That is, feature extraction of the pattern elements associated with the qualified and unqualified shapes of the punched and bent reinforcing steel bars by the convolutional neural network is facilitated by the loss function value output by the classifier, so that the quality detection effect of the punched and bent reinforcing steel bars in the image can be improved in the aspect of image information.
Specifically, in this embodiment of the present application, a process of passing the first feature map through a classifier to obtain a classification loss function value includes: firstly, a first feature map is passed through a full-connection layer to obtain a classification feature vector, and it is understood that information of each position in the first feature map can be fully utilized through the full-connection layer; then, the classification feature vector is input into a classification function to obtain the classification loss function value, wherein the classification function is a Softmax classification function.
Fig. 4 illustrates a flowchart of obtaining a classification loss function value by a classifier based on the first feature map in a training method of a neural network for quality detection of steel bar stamping bending according to an embodiment of the present application. As shown in fig. 4, passing the first feature map through a classifier to obtain a classification loss function value includes: s210, enabling the first feature map to pass through a full connection layer to obtain a classification feature vector; and S220, inputting the classification feature vector into a classification function to obtain the classification loss function value.
In step S160, the first convolutional neural network, the second convolutional neural network, and the classifier are updated based on a weighted sum of the classification loss function value and the cosine distance loss function value. It should be appreciated that by weighting the classification loss function values and the cosine distance loss function values, the convolutional neural network and the classifier may be trained during training by weighting the classification loss function values and the cosine distance loss function values.
Specifically, in this embodiment of the present application, updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value and the cosine distance loss function value includes: iteratively updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function values and the cosine distance loss function values; in each iteration, firstly, the parameters of the first convolutional neural network and the classifier are fixed, the parameters of the second convolutional neural network are updated, and then the parameters of the second convolutional neural network are fixed, and the parameters of the first convolutional neural network and the classifier are updated. By sequentially updating the second convolutional neural network, the first convolutional neural network and the classifier in each iteration, the condition that parameters are excessively dispersed due to the fact that the first convolutional neural network, the classifier and the second convolutional neural network are updated simultaneously can be avoided, and convergence of the parameters of the convolutional neural network and the classifier is facilitated; in addition, the second convolutional neural network is updated firstly, and then the first convolutional neural network and the classifier are updated, so that the first convolutional neural network and the classifier can be updated by more fully extracting the features which reflect that the bending of the reinforcing steel bars is qualified and unqualified, and the detection precision is improved.
It should be understood that, by the training method of the neural network for quality detection of steel bar stamping and bending disclosed in steps S110 to S160, which trains the first convolutional neural network, the second convolutional neural network and the classifier for image features of steel bar stamping and bending through weighted values of the classifier loss function value and the cosine distance loss function value, the quality detection of steel bar stamping and bending can be achieved to some extent. Further, in order to make the convolutional neural network and the classifier converge more quickly, in another example of the present application, the cross entropy loss function value may be trained, because the bending of the steel bar has a relationship with the parameters in the punching and bending process, and the cross entropy loss function value may be further calculated and trained by using the parameters, such as the punching force in the punching process and the temperature of the bent steel bar, as the label values.
Correspondingly, in another embodiment of the present application, in the second training set, the steel bars that are qualified in stamping and bending and the steel bars that are unqualified in stamping and bending are marked in each steel bar image in the form of label information, where the label information includes parameters of the steel bars in the stamping process; the training method further comprises the following steps: and calculating a cross entropy loss function value between the first feature map and the label information. That is, the convolutional neural network is supervised trained with the tag information as auxiliary information.
Specifically, in this example, the process of updating the first convolutional neural network, the second convolutional neural network, and the classifier based on the weighted sum of the classification loss function value and the cosine distance loss function value includes: updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value, the cosine distance loss function value, and the cross entropy loss function value. Particularly, the parameters of the steel bars qualified by bending are used as label information to perform supervised learning, so that the convolutional neural network and the classifier can be converged more quickly.
Further, in iteratively updating the first convolutional neural network, the second convolutional neural network, and the classifier based on the weighted sum of the classification loss function value, the cosine distance loss function value, and the cross entropy loss function value, in each iteration, first fixing parameters of the first convolutional neural network and the classifier and updating parameters of the second convolutional neural network, and then fixing parameters of the second convolutional neural network and updating parameters of the first convolutional neural network and the classifier. The benefits of such training are: by sequentially updating the second convolutional neural network, the first convolutional neural network and the classifier in each iteration, the phenomenon that parameters are excessively dispersed due to the fact that the first convolutional neural network, the classifier and the second convolutional neural network are updated simultaneously can be avoided, and convergence of the parameters of the convolutional neural network and the classifier is facilitated. Moreover, the second convolutional neural network is updated firstly, and then the first convolutional neural network and the classifier are updated, so that the first convolutional neural network and the classifier can be updated by more fully extracting the features which embody the qualification and the disqualification of the bending of the reinforcing steel bars, and the detection precision is improved; the label information is provided through the cross entropy loss function to serve as supervised learning, so that the feature distribution in the feature map extracted by the first convolution neural network can move towards the feature distribution of qualified images and unqualified images in the feature space, and the images are classified more accurately.
In conclusion, the training method of the neural network for detecting the quality of the steel bar stamping and bending based on the embodiment of the application is clarified, in the training process of training the neural network for detecting the quality of stamping and bending of the reinforcing steel bars, the problem that the characteristic distribution of qualified images and unqualified images has a large Euclidean distance in a characteristic space based on a cosine distance loss function is solved, so that the convolutional neural network cannot be implemented to mimic the problem of learning both the features used to determine qualified classes and the features used to determine unqualified classes, and the convolutional neural network is trained based on the weighted values of the classification loss function and the cosine distance loss function, so that the problems that the limiting conditions are too few, the parameter updating convergence of the convolutional neural network is not easy to cause, and the training speed is slow due to the fact that only the classification loss function is used for training the convolutional neural network are solved.
According to another aspect of the application, a quality detection method for steel bar stamping and bending based on a deep neural network is further provided.
Fig. 5 illustrates a flow chart of quality detection for steel bar stamping and bending based on a deep neural network according to an embodiment of the application. As shown in fig. 5, a quality detection method for stamping and bending a steel bar based on a deep neural network according to an embodiment of the present application includes: s310, acquiring an image of the punched and bent steel bar to be detected; s320, inputting the steel bar image into a first convolution neural network and the classifier trained according to the neural network training method for the quality detection of the steel bar stamping and bending, wherein the output of the classifier is a first probability that the steel bar is qualified after stamping and bending and a second probability that the steel bar is unqualified after stamping and bending; and S330, determining whether the steel bar is qualified to be punched based on the first probability and the second probability.
Exemplary System
Fig. 6 illustrates a block diagram of a training system of a neural network for quality detection of steel bar stamping bends according to an embodiment of the application.
As shown in fig. 6, a system 600 of a neural network for quality detection of steel bar stamping and bending according to an embodiment of the present application includes: a training set obtaining unit 610, configured to obtain a first training set including an image of a punched and bent steel bar and a second training set including an image of a steel bar that is detected to be qualified in punching and bending and an image of a steel bar that is detected to be unqualified in punching and bending; a first feature map generating unit 620, configured to pass the first training set obtained by the training set obtaining unit 610 through a first convolutional neural network to obtain a first feature map; a second feature map generating unit 630, configured to pass the second training set obtained by the training set obtaining unit 610 through a second convolutional neural network to obtain a second feature map, where the second convolutional neural network has the same network structure as the first convolutional neural network; a cosine distance loss function value calculating unit 640, configured to calculate a cosine distance loss function value between the first feature map obtained by the first feature map generating unit 620 and the second feature map obtained by the second feature map generating unit 630; a classification loss function value calculation unit 650 configured to pass the first feature map obtained by the first feature map generation unit 620 through a classifier to obtain a classification loss function value; a parameter updating unit 660 configured to update the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value obtained by the classification loss function value calculating unit 650 and the cosine distance loss function value obtained by the cosine distance loss function value calculating unit 640.
In one example, in the training system 600, as shown in fig. 7, the classification loss function value calculation unit 650 includes: a classification feature vector generation subunit 651, configured to pass the first feature map obtained by the first feature map generation unit 620 through a full connection layer to obtain a classification feature vector; and a classification loss function value obtaining subunit 652 configured to input the classification feature vector obtained by the classification feature vector generation subunit 651 into a classification function to obtain the classification loss function value.
In an example, in the training system 600, in the second training set, the steel bars that are qualified for the detected stamping bending and the steel bars that are not qualified for the detected stamping bending are marked in each of the steel bar images in the form of label information, where the label information includes parameters of the steel bars in the stamping process.
In one example, as shown in fig. 6, the training system 600 further comprises: a cross entropy loss function value calculating unit 670, configured to calculate a cross entropy loss function value between the first feature map obtained by the first feature map generating unit 620 and the label information in the second training set obtained by the training set obtaining unit 610.
In one example, in the training system 600, the parameters of the steel bar during the stamping process include the stamping force during the stamping process and the temperature after the steel bar is bent.
In an example, in the training system 600, the parameter updating unit 660 is further configured to: iteratively updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value obtained by the classification loss function value calculation unit 650 and the cosine distance loss function value obtained by the cosine distance loss function value calculation unit 640; in each iteration, firstly, the parameters of the first convolutional neural network and the classifier are fixed, the parameters of the second convolutional neural network are updated, and then the parameters of the second convolutional neural network are fixed, and the parameters of the first convolutional neural network and the classifier are updated.
In an example, in the training system 600, the parameter updating unit 660 is further configured to: iteratively updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value obtained by the classification loss function value calculation unit 650, the cosine distance loss function value obtained by the cosine distance loss function value calculation unit 640, and the cross-entropy loss function value obtained by the cross-entropy loss function value calculation unit 670; in each iteration, firstly, the parameters of the first convolutional neural network and the classifier are fixed, the parameters of the second convolutional neural network are updated, and then the parameters of the second convolutional neural network are fixed, and the parameters of the first convolutional neural network and the classifier are updated.
Here, it will be understood by those skilled in the art that the specific functions and operations of the respective units and modules in the training system 600 have been described in detail in the above description of the training method of the neural network for quality detection of steel bar press bending with reference to fig. 1 to 4, and thus, a repetitive description thereof will be omitted.
As described above, the training system 600 according to the embodiment of the present application can be implemented in various terminal devices, such as a server for quality detection of punching and bending of steel bars. In one example, the training system 600 according to embodiments of the present application may be integrated into a terminal device as a software module and/or a hardware module. For example, the training system 600 may be a software module in the operating system of the terminal device, or may be an application developed for the terminal device; of course, the training system 600 may also be one of many hardware modules of the terminal device.
Alternatively, in another example, the training system 600 and the terminal device may be separate devices, and the training system 600 may be connected to the terminal device through a wired and/or wireless network and transmit the interactive information according to an agreed data format.
According to another aspect of the application, a quality detection system for steel bar stamping and bending based on a deep neural network is also provided.
Fig. 8 illustrates a block diagram of a deep neural network based quality detection system for steel bar press bending according to an embodiment of the present application. As shown in fig. 8, a deep neural network-based quality detection system 800 for stamping and bending a steel bar according to an embodiment of the present application includes: an image acquiring unit 810 to be detected, configured to acquire an image including a punched and bent steel bar to be detected; a probability generating unit 820, configured to input the steel bar image obtained by the image obtaining unit to be detected into the first convolution neural network and the classifier trained by the training method of the neural network for quality detection of steel bar stamping and bending according to any one of claims 1 to 6, where the output of the classifier is a first probability that the steel bar is qualified by stamping and bending and a second probability that the steel bar is unqualified by stamping and bending; the detection result generating unit 830 is configured to obtain a detection result whether the steel bar to be detected is qualified to be punched based on the first probability that the steel bar is qualified to be punched and bent and the second probability that the steel bar is unqualified to be punched and bent, which are obtained by the probability generating unit.
Here, it will be understood by those skilled in the art that the specific functions and operations of the respective units and modules in the above-described inspection system 800 have been described in detail in the above description of the quality inspection method for steel bar press bending based on the deep neural network of fig. 5, and thus, a repetitive description thereof will be omitted.
As described above, the identification system 800 according to the embodiment of the present application can be implemented in various terminal devices, such as a server for quality detection of punching and bending of a reinforcing bar. In one example, the detection system 800 according to embodiments of the application may be integrated into the terminal device as one software module and/or hardware module. For example, the detection system 800 may be a software module in the operating system of the terminal device, or may be an application developed for the terminal device; of course, the detection system 800 may also be one of many hardware modules of the terminal device.
Alternatively, in another example, the detection system 800 and the terminal device may be separate devices, and the detection system 800 may be connected to the terminal device through a wired and/or wireless network and transmit the interaction information according to an agreed data format.
Exemplary electronic device
Next, an electronic apparatus according to an embodiment of the present application is described with reference to fig. 9.
FIG. 9 illustrates a block diagram of an electronic device in accordance with an embodiment of the present application.
As shown in fig. 9, the electronic device 10 includes one or more processors 11 and a memory 12.
The processor 11 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.
Memory 12 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer readable storage medium and executed by the processor 11 to implement the above-described training of the neural network for quality detection of steel bar punch bends of the various embodiments of the present application, or the function of the quality detection method for steel bar punch bends based on the deep neural network, and/or other desired functions. Various content such as cross-entropy loss values may also be stored in the computer-readable storage medium.
In one example, the electronic device 10 may further include: an input system 13 and an output system 14, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
The input system 13 may comprise, for example, a keyboard, a mouse, etc.
The output system 14 may output various information to the outside, including an updated neural network, a result of semantic segmentation of an image, and the like. The output system 14 may include, for example, a display, speakers, a printer, and a communication network and its connected remote output devices, among others.
Of course, for simplicity, only some of the components of the electronic device 10 relevant to the present application are shown in fig. 9, and components such as buses, input/output interfaces, and the like are omitted. In addition, the electronic device 10 may include any other suitable components depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above-described methods and apparatus, embodiments of the present application may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the training of a neural network for quality detection of rebar punch bends according to various embodiments of the present application described in the "exemplary methods" section above in this specification, or steps in functions in a method for quality detection of rebar punch bends based on a deep neural network.
The computer program product may be written with program code for performing the operations of embodiments of the present application in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present application may also be a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, cause the processor to perform the training of a neural network for quality detection of steel bar press bending according to various embodiments of the present application described in the "exemplary methods" section above in the present specification, or the steps in the functions in the quality detection method for steel bar press bending based on a deep neural network.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing describes the general principles of the present application in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present application are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present application. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the foregoing disclosure is not intended to be exhaustive or to limit the disclosure to the precise details disclosed.
The block diagrams of devices, systems, apparatuses, and systems referred to in this application are only meant as illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. These devices, systems, apparatuses, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
It should also be noted that in the systems, apparatus and methods of the present application, the components or steps may be broken down and/or re-combined. These decompositions and/or recombinations are to be considered as equivalents of the present application.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the application. Thus, the present application is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, the description is not intended to limit embodiments of the application to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (10)

1. A training method of a neural network for quality detection of steel bar stamping and bending is characterized by comprising the following steps:
acquiring a first training set containing an image of a punched and bent steel bar and a second training set containing an image of a steel bar which is detected to be qualified in punching and bending and an image of a steel bar which is detected to be unqualified in punching and bending;
passing the first training set through a first convolutional neural network to obtain a first feature map;
passing the second training set through a second convolutional neural network to obtain a second feature map, the second convolutional neural network having the same network structure as the first convolutional neural network;
calculating a cosine distance loss function value between the first feature map and the second feature map;
passing the first feature map through a classifier to obtain a classification loss function value; and
updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value and the cosine distance loss function value.
2. The training method of the neural network for quality detection of steel bar stamping bends as claimed in claim 1, wherein the step of passing the first feature map through a classifier to obtain a classification loss function value comprises the steps of:
passing the first feature map through a full connection layer to obtain a classification feature vector; and
inputting the classification feature vector into a classification function to obtain the classification loss function value.
3. The training method of the neural network for detecting the quality of the punched and bent steel bars according to claim 1, wherein in the second training set, the steel bars which are qualified in the detected punched and bent steel bars and the steel bars which are unqualified in the detected punched and bent steel bars are marked in each steel bar image in the form of label information, and the label information comprises parameters of the steel bars in the punching process;
the method further comprises the following steps: calculating a cross entropy loss function value between the first feature map and the label information;
wherein updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value and the cosine distance loss function value comprises: updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value, the cosine distance loss function value, and the cross entropy loss function value.
4. The training method of the neural network for quality detection of steel bar stamping bending as claimed in claim 3, wherein the parameters of the steel bar in the stamping process comprise stamping force in the stamping process and temperature of the steel bar after being bent.
5. The training method of the neural network for quality inspection of steel bar punch bends as claimed in claim 1, wherein updating the first convolutional neural network, the second convolutional neural network and the classifier based on a weighted sum of the classification loss function value and the cosine distance loss function value comprises: iteratively updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function values and the cosine distance loss function values;
in each iteration, firstly, the parameters of the first convolutional neural network and the classifier are fixed, the parameters of the second convolutional neural network are updated, and then the parameters of the second convolutional neural network are fixed, and the parameters of the first convolutional neural network and the classifier are updated.
6. The training method of the neural network for quality inspection of steel bar punch bends as claimed in claim 3, wherein updating the first convolutional neural network, the second convolutional neural network and the classifier based on a weighted sum of the classification loss function value and the cosine distance loss function value comprises: iteratively updating the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value, the cosine distance loss function value, and the cross-entropy loss function value;
in each iteration, firstly, the parameters of the first convolutional neural network and the classifier are fixed, the parameters of the second convolutional neural network are updated, and then the parameters of the second convolutional neural network are fixed, and the parameters of the first convolutional neural network and the classifier are updated.
7. A quality detection method for steel bar stamping and bending based on a deep neural network is characterized by comprising the following steps:
acquiring an image of a punched and bent steel bar to be detected;
inputting the steel bar image into a first convolution neural network and the classifier trained by the training method of the neural network for detecting the quality of the steel bar stamping and bending according to any one of claims 1 to 6, wherein the output of the classifier is a first probability that the steel bar is qualified by stamping and bending and a second probability that the steel bar is unqualified by stamping and bending; and
and determining whether the steel bar is qualified to be punched based on the first probability and the second probability.
8. A training system for a neural network for sizing electronic components to be stored, comprising:
the training set acquisition unit is used for acquiring a first training set containing an image of the punched and bent steel bar and a second training set containing an image of the steel bar which is detected to be punched and bent and is unqualified;
a first feature map generating unit, configured to pass the first training set obtained by the training set obtaining unit through a first convolutional neural network to obtain a first feature map;
a second feature map generating unit, configured to pass the second training set obtained by the training set obtaining unit through a second convolutional neural network to obtain a second feature map, where the second convolutional neural network and the first convolutional neural network have the same network structure;
a cosine distance loss function value calculation unit configured to calculate a cosine distance loss function value between the first feature map obtained by the first feature map generation unit and the second feature map obtained by the second feature map generation unit;
a classification loss function value calculation unit configured to pass the first feature map obtained by the first feature map generation unit through a classifier to obtain a classification loss function value; and
a parameter updating unit configured to update the first convolutional neural network, the second convolutional neural network, and the classifier based on a weighted sum of the classification loss function value obtained by the classification loss function value calculating unit and the cosine distance loss function value obtained by the cosine distance loss function value calculating unit.
9. The utility model provides a quality detection system that is used for reinforcing bar punching press to bend based on degree of depth neural network which characterized in that includes:
the device comprises an image acquisition unit to be detected, a data acquisition unit and a data processing unit, wherein the image acquisition unit is used for acquiring an image containing a punched and bent steel bar to be detected;
a probability generating unit, configured to input the steel bar image obtained by the image obtaining unit to be detected into the first convolution neural network and the classifier trained by the training method for the neural network used for detecting the quality of steel bar stamping and bending according to any one of claims 1 to 6, where the output of the classifier is a first probability that the steel bar is qualified by stamping and bending and a second probability that the steel bar is unqualified by stamping and bending; and
and the detection result generation unit is used for obtaining a detection result whether the steel bar to be detected is qualified by stamping or not based on the first probability that the steel bar is qualified by stamping and bending and the second probability that the steel bar is unqualified by stamping and bending, which are obtained by the probability generation unit.
10. An electronic device, comprising:
a processor; and
a memory in which computer program instructions are stored, which, when executed by the processor, cause the processor to execute the method of training a neural network for quality detection of steel bar punch bends of any one of claims 1-6, or the method of quality detection for steel bar punch bends of claim 7 based on a deep neural network.
CN202011463126.4A 2020-12-11 2020-12-11 Neural network training method for quality detection of steel bar stamping and bending Withdrawn CN112465805A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011463126.4A CN112465805A (en) 2020-12-11 2020-12-11 Neural network training method for quality detection of steel bar stamping and bending

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011463126.4A CN112465805A (en) 2020-12-11 2020-12-11 Neural network training method for quality detection of steel bar stamping and bending

Publications (1)

Publication Number Publication Date
CN112465805A true CN112465805A (en) 2021-03-09

Family

ID=74804135

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011463126.4A Withdrawn CN112465805A (en) 2020-12-11 2020-12-11 Neural network training method for quality detection of steel bar stamping and bending

Country Status (1)

Country Link
CN (1) CN112465805A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113139520A (en) * 2021-05-14 2021-07-20 杭州旭颜科技有限公司 Equipment diaphragm performance monitoring method for industrial Internet
CN115638742A (en) * 2022-10-12 2023-01-24 北京迈思发展科技有限责任公司 Reinforcing bar shape quality inspection system based on image recognition

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113139520A (en) * 2021-05-14 2021-07-20 杭州旭颜科技有限公司 Equipment diaphragm performance monitoring method for industrial Internet
CN113139520B (en) * 2021-05-14 2022-07-29 江苏中天互联科技有限公司 Equipment diaphragm performance monitoring method for industrial Internet
CN115638742A (en) * 2022-10-12 2023-01-24 北京迈思发展科技有限责任公司 Reinforcing bar shape quality inspection system based on image recognition
CN115638742B (en) * 2022-10-12 2023-08-15 北京迈思发展科技有限责任公司 Reinforcing bar shape quality inspection system based on image recognition

Similar Documents

Publication Publication Date Title
CN111414987B (en) Training method and training device of neural network and electronic equipment
CN111667066B (en) Training method and device of network model, character recognition method and device and electronic equipment
CN114627102B (en) Image anomaly detection method, device and system and readable storage medium
JP4300098B2 (en) Object identification method and apparatus, program and recording medium
CN110705531B (en) Missing character detection and missing character detection model establishing method and device
CN115471216B (en) Data management method of intelligent laboratory management platform
CN112465805A (en) Neural network training method for quality detection of steel bar stamping and bending
CN112183289A (en) Method, device, equipment and medium for detecting patterned screen
CN116091414A (en) Cardiovascular image recognition method and system based on deep learning
CN112733785A (en) Stability detection method of information equipment based on layer depth and receptive field
CN109919214B (en) Training method and training device for neural network model
CN110533184B (en) Network model training method and device
CN109145991B (en) Image group generation method, image group generation device and electronic equipment
CN115690514A (en) Image recognition method and related equipment
CN111680674B (en) Hall personnel monitoring method based on self-integrated attention mechanism
CN112001301B (en) Building monitoring method and device based on global cross entropy weighting and electronic equipment
CN112734016A (en) Training method of neural network for detecting smoothness of surface of steel bar
CN111127502B (en) Method and device for generating instance mask and electronic equipment
CN110309285B (en) Automatic question answering method, device, electronic equipment and storage medium
CN112686882A (en) Method for detecting stability of pipeline erected on pipeline support frame
CN112348045A (en) Training method and training device for neural network and electronic equipment
CN115017321A (en) Knowledge point prediction method and device, storage medium and computer equipment
CN112651494A (en) Training method of neural network for cable anti-winding early warning
CN112348161A (en) Neural network training method, neural network training device and electronic equipment
CN112818760A (en) Method for intelligently evaluating influence of weeds on road surface traffic

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20210309

WW01 Invention patent application withdrawn after publication