Steel defect prediction method and system based on image processing

Using image processing technology to extract steel surface features and construct a BP neural network model, the problem of insufficient reliability and accuracy in predicting steel surface defects is solved, accurate prediction and timely repair of steel surface defects is achieved, and product quality is improved.

CN118570554AInactive Publication Date: 2024-08-30JINGYE STEEL CO LTD

Patent Information

Application Number
CN202410960553.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the steel manufacturing process, the prediction of steel surface defects has insufficient reliability and accuracy, resulting in defects not being discovered and repaired in time, affecting product quality.

Method used

An image processing-based method is used to collect steel surface images for preprocessing, feature extraction, and normalization, and the BP neural network model is used for defect prediction, including the extraction of shape features, texture features, grayscale features, and color features. and analysis to build predictive models to predict steel surface defects.

Benefits of technology

It improves the reliability and accuracy of steel defect prediction, enables timely detection of mild, moderate and severe defects, and carries out corresponding processing and repair, extending the service life of steel and improving product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570554A
    Figure CN118570554A
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a steel defect prediction method and system based on image processing, and the method comprises the steps: collecting a steel surface image, and carrying out the preprocessing of the steel surface image, and obtaining a first image; performing feature extraction on the first image to obtain shape feature data, texture feature data, gray feature data and color feature data; performing normalization processing on the shape feature data, the texture feature data, the gray feature data and the color feature data to obtain normalized feature data; and pre-constructing a BP neural network model, and inputting the normalized feature data into the BP neural network model to obtain a steel surface defect prediction result. Through the method, the reliability and the accuracy of the steel defect prediction result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image processing, and in particular to a steel defect prediction method and system based on image processing. Background Art

[0002] In the steel manufacturing process, various defects may exist on the surface of products such as steel plates, steel coils and steel pipes, such as cracks, dents, scratches and bubbles. These defects on the surface of metal materials such as steel will cause abnormal vibration and noise during the use of the machine, and accelerate the further oxidation and wear of the defective surface after contact with the air. Therefore, the prediction of steel surface defects is a very important link. Through defect prediction, we can pay attention to steel prone to defects in advance or repair these defects as soon as possible to improve the quality of steel products. With the development of image processing technology, various image processing algorithms are relatively complete. In actual application, they can be directly called and debugged, and the operation is very convenient. Machine vision based on image processing has huge development potential. Therefore, how to reliably and accurately predict steel defects through image technology has become an urgent problem to be solved. Summary of the invention

[0003] The main purpose of this application is to provide a steel defect prediction method and system based on image processing, aiming to improve the reliability and accuracy of steel defect prediction.

[0004] In order to achieve the above-mentioned invention object, the present application proposes a steel defect prediction method based on image processing, comprising: A steel defect prediction method based on image processing, the method comprising: Collecting a steel surface image, and preprocessing the steel surface image to obtain a first image; Performing feature extraction on the first image to obtain shape feature data, texture feature data, grayscale feature data and color feature data; Normalizing the shape feature data, the texture feature data, the grayscale feature data, and the color feature data to obtain normalized feature data; A BP neural network model is pre-constructed, and the normalized feature data is input into the BP neural network model to obtain a steel surface defect prediction result.

[0005] Further, extracting features from the first image to obtain shape feature data specifically includes: Performing threshold segmentation on the first image to obtain a binary image; Performing contour detection on the binary image based on an edge detection algorithm; Shape feature extraction is performed on the contour to obtain shape feature data, wherein the shape feature data includes but is not limited to area and perimeter.

[0006] Furthermore, the extracting features of the first image to obtain texture feature data specifically includes: Dividing the first image into a plurality of sub-images, obtaining first LBP values ​​corresponding to all pixels in each sub-image, calculating a histogram corresponding to each sub-image based on the first LBP values, and normalizing the histogram to obtain a normalized histogram; The normalized histograms corresponding to each sub-image are connected to obtain the LBP texture feature vector of the first image, and the LBP texture feature vector is used as texture feature data.

[0007] Furthermore, the extracting features of the first image to obtain grayscale feature data specifically includes: converting the first image into a grayscale image according to a weighted average method; Divide the grayscale image into a plurality of sub-images, and obtain first grayscale values ​​corresponding to all pixels in each sub-image; Calculate the gray level frequency corresponding to each sub-image based on the magnitude of the first gray value; The gray level frequencies are counted to generate a gray histogram, and the gray histogram is used as gray feature data.

[0008] Furthermore, the extracting features of the first image to obtain color feature data specifically includes: Obtain the RGB value corresponding to each pixel value in the first image, substitute the RGB value into a preset color space conversion formula, calculate the brightness value and saturation value of the first image, and obtain the color feature data of the first image by substituting the brightness value and the saturation value.

[0009] Furthermore, before the step of inputting the normalized feature data into the BP neural network model to obtain the steel surface defect prediction result, the following steps are specifically included: Acquire a normalized feature historical data set, and divide the normalized feature historical data set into a normalized feature training data set and a normalized feature test data set; The BP neural network model is trained based on the normalized feature training data set, and the BP neural network model is tested based on the normalized feature test data set until the prediction accuracy of the BP neural network model meets a preset accuracy threshold, and the training of the BP neural network model is stopped.

[0010] Furthermore, after the step of obtaining the steel surface defect prediction result, the following steps are specifically included: When the predicted result of the steel surface defect is a slight defect, performing a surface flattening treatment on the steel surface; When the predicted result of the steel surface defect is a moderate defect, the steel surface is cleaned, partially repaired and anti-corrosion treated; When the predicted result of the steel surface defect is a severe defect, the steel surface is repaired by welding and confirmed by non-destructive testing.

[0011] A steel defect prediction system based on image processing, the system comprising: A first image acquisition module is used to acquire a steel surface image and pre-process the steel surface image to obtain a first image; A feature extraction module, used to extract features from the first image to obtain shape feature data, texture feature data, grayscale feature data and color feature data; A normalization feature module, used for normalizing the shape feature data, the texture feature data, the grayscale feature data and the color feature data to obtain normalized feature data; The defect prediction module is used to pre-build a BP neural network model, input the normalized feature data into the BP neural network model, and obtain the steel surface defect prediction result.

[0012] The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the above-mentioned steel defect prediction methods based on image processing are implemented.

[0013] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of any one of the above-mentioned steel defect prediction methods based on image processing are implemented.

[0014] Beneficial effects: The present application relates to the field of image processing technology, and in particular to a steel defect prediction method and system based on image processing, the method comprising: collecting a steel surface image, preprocessing the steel surface image to obtain a first image; extracting features from the first image to obtain shape feature data, texture feature data, grayscale feature data, and color feature data; normalizing the shape feature data, texture feature data, grayscale feature data, and color feature data to obtain normalized feature data; pre-building a BP neural network model, inputting the normalized feature data into the BP neural network model, and obtaining a steel surface defect prediction result. Through the above method, the reliability and accuracy of the steel defect prediction result are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a schematic flow chart of an embodiment of a steel defect prediction method based on image processing of the present application; Figure 2 This is a schematic diagram of the structure of an embodiment of the steel defect prediction system based on image processing of the present application; Figure 3 This is a schematic block diagram of the structure of an embodiment of a computer device of the present application; The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0017] Reference Figure 1 The embodiment of the present application provides a steel defect prediction method based on image processing, including steps S10-S40. The detailed description of each step of the steel defect prediction method based on image processing is as follows.

[0018] S10, collecting a steel surface image, and preprocessing the steel surface image to obtain a first image; In this embodiment, a first image of the sludge after drying is collected by a camera or other image acquisition equipment. In one embodiment, the steel surface image is subjected to image preprocessing to obtain a first image, wherein the image preprocessing includes image cropping, adjusting image size and angle, enhancing contrast, and removing image noise.

[0019] S20, performing feature extraction on the first image to obtain shape feature data, texture feature data, grayscale feature data and color feature data; In this embodiment, specifically, in one embodiment, feature extraction is performed on the first image to obtain shape feature data, which specifically includes: threshold segmentation is performed on the first image to obtain a binary image; contour detection is performed on the binary image based on an edge detection algorithm; shape feature extraction is performed on the contour to obtain shape feature data, and the shape feature data includes but is not limited to area and perimeter. In another embodiment, feature extraction is performed on the first image to obtain texture feature data, which specifically includes: dividing the first image into multiple sub-images, obtaining the first LBP value corresponding to all pixels in each sub-image, calculating the histogram corresponding to each sub-image based on the first LBP value, normalizing the histogram to obtain a normalized histogram; connecting the normalized histograms corresponding to each sub-image to obtain the LBP texture feature vector of the first image, and using the LBP texture feature vector as texture feature data. In another embodiment, feature extraction is performed on the first image to obtain grayscale feature data, which specifically includes: converting the first image into a grayscale image according to a weighted average method; dividing the grayscale image into multiple sub-images, and obtaining the first grayscale value corresponding to all pixels in each sub-image; calculating the grayscale level frequency corresponding to each sub-image based on the size of the first grayscale value; counting the grayscale level frequencies to generate a grayscale histogram, and using the grayscale histogram as grayscale feature data.

[0020] S30, normalizing the shape feature data, the texture feature data, the grayscale feature data, and the color feature data to obtain normalized feature data; In this embodiment, the shape feature is data describing the outline or geometric shape of an object, such as area, perimeter, rectangularity, etc. Normalization is achieved by subtracting the mean from the value of each shape feature and then dividing it by the standard deviation (or scaling the data to a range of 0 to 1 by other methods), which ensures that the effects of shape features of different scales on the final result are consistent. Texture features describe the surface texture of a local area of ​​an image. Normalization usually uses linear scaling or statistical distribution-based methods to ensure that the value ranges of texture features of different images are similar so that they can be effectively compared and weighted in subsequent model training or classification processes. Grayscale features reflect the brightness distribution and grayscale level statistics of an image, such as average grayscale, standard deviation, histogram features, etc. Normalization of grayscale feature data is accomplished by simple linear transformations (such as minimum-maximum scaling) to ensure that the grayscale features of all images are within a similar numerical range. Color features describe information such as the distribution, hue, and saturation of colors in an image, such as color histogram statistical features. Normalizing color feature data is a conversion of color space (such as from RGB to HSV), and then normalizing each channel independently to ensure that all color feature data have comparable weights.

[0021] Shape feature data includes the size of the object, the perimeter of the contour, etc. Grayscale features are used to describe the brightness and contrast information of the image. Color features involve the hue, saturation and other attributes of the image. Normalization is to scale the data to the range of [0,1].

[0022] S40, pre-constructing a BP neural network model, inputting the normalized feature data into the BP neural network model, and obtaining a steel surface defect prediction result.

[0023] In this embodiment, before the step of inputting the normalized feature data into the BP neural network model to obtain the steel surface defect prediction result, it specifically includes: obtaining a normalized feature historical data set, dividing the normalized feature historical data set into a normalized feature training data set and a normalized feature test data set; training the BP neural network model based on the normalized feature training data set, and testing the BP neural network model based on the normalized feature test data set, until the prediction accuracy of the BP neural network model meets the preset accuracy threshold, and stopping the training of the BP neural network model.

[0024] In one embodiment, the feature extraction of the first image to obtain shape feature data specifically includes: threshold segmentation of the first image to obtain a binary image; contour detection of the binary image based on an edge detection algorithm; shape feature extraction of the contour to obtain shape feature data, wherein the shape feature data includes but is not limited to area and perimeter.

[0025] In this embodiment, the first image is firstly subjected to threshold segmentation to convert it into a binary image. Threshold segmentation is the process of setting a threshold value according to the grayscale value of the image to divide the pixels into two categories (generally black and white). After obtaining the binary image, an edge detection algorithm is used to detect the edges in the image. Common edge detection algorithms include Sobel, Canny, etc., which effectively identify the edge information in the image. Based on the results obtained by edge detection, contour detection is performed. The contour can be regarded as a continuous line connecting all edges, which describes the overall shape of the object in the image. Shape feature data is extracted from the detected contour. Common shape features include but are not limited to area and perimeter. The area indicates the size of the area enclosed by the contour, while the perimeter indicates the length of the contour. Specifically, the original image is converted into a binary image according to the grayscale threshold. In this embodiment, the grayscale threshold is set to 128, and the resulting binary image The Canny edge detection algorithm is used to perform edge detection on the binary image. Based on the results of the Canny edge detection, the contour in the image is found. Shape feature data, such as area and perimeter, are extracted from the detected contour. In this embodiment, the area of ​​the detected circular contour is 100 pixels^2 and the perimeter is 20 pixels.

[0026] In one embodiment, the feature extraction of the first image to obtain texture feature data specifically includes: dividing the first image into multiple sub-images, obtaining a first LBP value corresponding to all pixels in each sub-image, calculating a histogram corresponding to each sub-image based on the first LBP value, normalizing the histogram to obtain a normalized histogram; connecting the normalized histogram corresponding to each sub-image to obtain an LBP texture feature vector of the first image, and using the LBP texture feature vector as texture feature data.

[0027] In this embodiment, specifically, feature extraction is performed on the first image to obtain texture feature data, and it also includes: feature extraction is performed on the first image to obtain texture feature data; specifically, the first image is divided into multiple sub-images, and the first LBP value corresponding to all pixels in each sub-image is obtained, and the histogram corresponding to each sub-image is calculated based on the first LBP value, and the histogram is normalized to obtain a normalized histogram; the normalized histogram corresponding to each sub-image is connected to obtain the LBP texture feature vector of the second image, and the LBP texture feature vector is used as the texture feature data. Specifically, by selecting a first pixel point in each sub-image, based on the first pixel point, obtaining the first grayscale value of 8 pixels adjacent to the first pixel point, and respectively comparing the first grayscale value with the second grayscale value corresponding to the first pixel point, if the first grayscale value is greater than the second grayscale value, the position of the pixel point corresponding to the first grayscale value is marked as 1, otherwise it is 0; based on the above operation, in this way, the binary numbers corresponding to the 8 pixels in the 3*3 neighborhood except the central pixel point, and based on the binary numbers corresponding to the 8 pixels, the LBP value of the central pixel point of the window, that is, the first LBP value corresponding to the first pixel point, is obtained; repeat the above operation until the first LBP value corresponding to all pixels in each sub-image is obtained. In one embodiment, the histogram corresponding to each sub-image is calculated based on the first LBP value. Specifically, based on the first LBP values ​​corresponding to all pixels in each sub-image, the probability of each first LBP value appearing is counted, and based on the probability, the histogram corresponding to each sub-image is generated.

[0028] In one embodiment, the feature extraction of the first image to obtain grayscale feature data specifically includes: converting the first image into a grayscale image according to a weighted average method; dividing the grayscale image into multiple sub-images, and obtaining the first grayscale value corresponding to all pixels in each sub-image; calculating the grayscale level frequency corresponding to each sub-image based on the size of the first grayscale value; counting the grayscale level frequencies to generate a grayscale histogram, and using the grayscale histogram as grayscale feature data.

[0029] In this embodiment, specifically, in one embodiment, the first image is converted into a grayscale image using a weighted average method. The color image is converted into a single-channel grayscale image, and the values ​​of the red, green and blue channels are usually combined into a grayscale value using a weighted average method. The grayscale image is divided into multiple small areas or sub-images. The grayscale values ​​of all pixels in each sub-image are obtained, each sub-image is traversed, and the grayscale value of each pixel is obtained. Based on the size of the pixel grayscale value in the sub-image, the frequency of occurrence of each grayscale level in each sub-image is calculated. The grayscale level frequencies of all sub-images are summarized to generate a grayscale histogram of the entire image. The grayscale level frequency is the frequency of occurrence of each grayscale level (an integer between 0 and 255) in the image or sub-image. The grayscale histogram is a histogram with grayscale level as the horizontal axis and frequency as the vertical axis, which is used to represent the number of pixels of each grayscale level in the image. Finally, the generated grayscale histogram is used as the grayscale feature data describing the first image.

[0030] In one embodiment, the feature extraction of the first image to obtain color feature data specifically includes: obtaining the RGB value corresponding to each pixel value in the first image, substituting the RGB value into a preset color space conversion formula, calculating the brightness value and saturation value of the first image, and obtaining the color feature data of the first image by substituting the brightness value and the saturation value.

[0031] In this embodiment, feature extraction is performed on the first image to obtain color feature data; specifically, the RGB value corresponding to each pixel value in the first image is obtained, the RGB value is substituted into a preset color space conversion formula, the brightness value and saturation value of the first image are calculated, and the brightness value and the saturation value are converted to obtain the color feature data of the first image. In one embodiment, the pixel values ​​of each channel of the first image in the RGB color space are obtained to obtain the R pixel value of the R channel, the G pixel value of the G channel, and the B pixel value of the B channel; the R pixel value, the G pixel value, and the B pixel value are substituted into a preset color space conversion formula to calculate and obtain the brightness value and saturation of the first image in the HSI color space; wherein the color space conversion formula is as follows: ; ; ; ; In the formula, is the pixel value of each channel in the RGB color space, for Normalized pixel value; Expressed as brightness value in HSI color space, Expressed as saturation value in HSI color space.

[0032] In one embodiment, before the step of inputting the normalized feature data into the BP neural network model to obtain the steel surface defect prediction result, it specifically includes: obtaining a normalized feature historical data set, dividing the normalized feature historical data set into a normalized feature training data set and a normalized feature test data set; training the BP neural network model based on the normalized feature training data set, and testing the BP neural network model based on the normalized feature test data set, until the prediction accuracy of the BP neural network model meets a preset accuracy threshold, and stopping training the BP neural network model.

[0033] In this embodiment, specifically, a normalized feature historical data set is obtained, which contains sample data of steel surface defects, each sample has shape features, texture features, grayscale features and color features, and these features have been normalized. Divide the normalized feature historical data set: divide this historical data set into a normalized feature training data set and a normalized feature test data set, and the normalized feature training data set is used to train the data set of the BP neural network model. The normalized feature test data set is a data set for evaluating the performance of the BP neural network model. Use the normalized feature training data set to train the BP neural network model. The training process will continuously adjust the weights and biases of the neural network through the back propagation algorithm to minimize the prediction error. Use the normalized feature test data set to evaluate the performance of the trained BP neural network model. Make predictions on the test set and compare them with the actual labels to calculate the prediction accuracy of the model. Compare the prediction accuracy of the BP neural network model on the test set with the preset accuracy threshold. If the accuracy of the model has met or exceeded the preset threshold, stop training, otherwise continue to optimize the model and retrain until it meets or exceeds the preset accuracy requirement.

[0034] In one embodiment, after the step of obtaining the steel surface defect prediction result, it specifically includes: when the steel surface defect prediction result is a slight defect, performing surface flattening treatment on the steel surface; when the steel surface defect prediction result is a moderate defect, cleaning, locally repairing and anti-corrosion treatment on the steel surface; when the steel surface defect prediction result is a severe defect, performing welding repair on the steel surface and performing non-destructive testing to confirm the quantity.

[0035] In this embodiment, specifically, the predicted result is a slight defect, and some slight pits and surface unevenness are found on the surface of the steel after inspection. Surface flattening treatment, for slight defects, the surface of the steel will be treated with a surface flattening tool, including the use of a grinding tool or a chemical treatment agent to eliminate small pits and surface unevenness so that it meets the surface quality requirements of the product. The predicted result is a moderate defect, and a large area of ​​rust and some local damage are detected on the surface of the steel. Cleaning, local repair and anti-corrosion treatment, for moderate defects, first the surface of the steel needs to be thoroughly cleaned to remove rust and dirt. Then, local repairs are performed, which may involve filling damage or surface coating repairs. Finally, anti-corrosion coatings or chemical treatment agents are applied to prevent further corrosion and damage. The predicted result is a severe defect, indicating that there are severe cracks, deep corrosion or other serious structural problems on the surface of the steel. Welding repair and non-destructive testing, for severe defects, welding repairs are required to repair cracks or rebuild the structure of the damaged part. After repair, non-destructive testing must be performed to confirm the quantity to ensure that the repaired part meets the strength and quality standards of the product.

[0036] Reference Figure 2 The present application provides a steel defect prediction system based on image processing, the system comprising: A first image acquisition module 10 is used to acquire a steel surface image and pre-process the steel surface image to obtain a first image; A feature extraction module 20 is used to extract features from the first image to obtain shape feature data, texture feature data, grayscale feature data and color feature data; A normalization feature module 30, used for normalizing the shape feature data, the texture feature data, the grayscale feature data and the color feature data to obtain normalized feature data; The defect prediction module 40 is used to pre-build a BP neural network model, input the normalized feature data into the BP neural network model, and obtain the steel surface defect prediction result.

[0037] As described above, it can be understood that the various components of the steel defect prediction system based on image processing proposed in the present application can realize the functions of any one of the steel defect prediction methods based on image processing described above.

[0038] In one embodiment, the feature extraction module 20 further includes executing: Performing threshold segmentation on the first image to obtain a binary image; Performing contour detection on the binary image based on an edge detection algorithm; Shape feature extraction is performed on the contour to obtain shape feature data, wherein the shape feature data includes but is not limited to area and perimeter.

[0039] In one embodiment, the feature extraction module 20 further includes executing: Dividing the first image into a plurality of sub-images, obtaining first LBP values ​​corresponding to all pixels in each sub-image, calculating a histogram corresponding to each sub-image based on the first LBP values, and normalizing the histogram to obtain a normalized histogram; The normalized histograms corresponding to each sub-image are connected to obtain the LBP texture feature vector of the first image, and the LBP texture feature vector is used as texture feature data.

[0040] In one embodiment, the feature extraction module 20 further includes executing: converting the first image into a grayscale image according to a weighted average method; Divide the grayscale image into a plurality of sub-images, and obtain first grayscale values ​​corresponding to all pixels in each sub-image; Calculate the gray level frequency corresponding to each sub-image based on the magnitude of the first gray value; The gray level frequencies are counted to generate a gray histogram, and the gray histogram is used as gray feature data.

[0041] In one embodiment, the feature extraction module 20 further includes executing: Obtain the RGB value corresponding to each pixel value in the first image, substitute the RGB value into a preset color space conversion formula, calculate the brightness value and saturation value of the first image, and obtain the color feature data of the first image by substituting the brightness value and the saturation value.

[0042] In one embodiment, the defect prediction module 40 further includes executing: Acquire a normalized feature historical data set, and divide the normalized feature historical data set into a normalized feature training data set and a normalized feature test data set; The BP neural network model is trained based on the normalized feature training data set, and the BP neural network model is tested based on the normalized feature test data set until the prediction accuracy of the BP neural network model meets a preset accuracy threshold, and the training of the BP neural network model is stopped.

[0043] In one embodiment, the defect prediction module 40 further includes executing: When the predicted result of the steel surface defect is a slight defect, performing a surface flattening treatment on the steel surface; When the predicted result of the steel surface defect is a moderate defect, the steel surface is cleaned, partially repaired and anti-corrosion treated; When the predicted result of the steel surface defect is a severe defect, the steel surface is repaired by welding and confirmed by non-destructive testing.

[0044] Reference Figure 3 In an embodiment of the present application, a computer device is also provided, the internal structure of which can be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface, a display device and an input device connected through a system bus. Among them, the network interface of the computer device is used to communicate with an external terminal through a network connection. The display device of the computer device is used to display an interactive page. The input device of the computer device is used to receive user input. The processor designed for the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium. The non-volatile storage medium stores an operating system, a computer program and a database. The database of the computer device is used to store raw data. When the computer program is executed by the processor, a steel defect prediction method based on image processing is implemented.

[0045] The processor executes the above-mentioned steel defect prediction method based on image processing, which includes: collecting steel surface images, preprocessing the steel surface images to obtain a first image; extracting features from the first image to obtain shape feature data, texture feature data, gray feature data and color feature data; normalizing the shape feature data, texture feature data, gray feature data and color feature data to obtain normalized feature data; pre-building a BP neural network model, inputting the normalized feature data into the BP neural network model, and obtaining steel surface defect prediction results. Through the above method, the reliability and accuracy of steel defect prediction results are improved.

[0046] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by the processor, a steel defect prediction method based on image processing is implemented, which includes collecting a steel surface image, preprocessing the steel surface image, and obtaining a first image; performing feature extraction on the first image to obtain shape feature data, texture feature data, grayscale feature data, and color feature data; normalizing the shape feature data, the texture feature data, the grayscale feature data, and the color feature data to obtain normalized feature data; pre-constructing a BP neural network model, and inputting the normalized feature data into the BP neural network model to obtain a steel surface defect prediction result.

[0047] The computer-readable storage medium provides a steel defect prediction method based on image processing, the method comprising: collecting a steel surface image, preprocessing the steel surface image to obtain a first image; extracting features from the first image to obtain shape feature data, texture feature data, grayscale feature data and color feature data; normalizing the shape feature data, texture feature data, grayscale feature data and color feature data to obtain normalized feature data; pre-constructing a BP neural network model, inputting the normalized feature data into the BP neural network model, and obtaining a steel surface defect prediction result. Through the above method, the reliability and accuracy of the steel defect prediction result are improved.

[0048] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0049] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.

[0050] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A steel defect prediction method based on image processing, characterized in that: include: Collecting a steel surface image, and preprocessing the steel surface image to obtain a first image; Performing feature extraction on the first image to obtain shape feature data, texture feature data, grayscale feature data and color feature data; Normalizing the shape feature data, the texture feature data, the grayscale feature data, and the color feature data to obtain normalized feature data; A BP neural network model is pre-constructed, and the normalized feature data is input into the BP neural network model to obtain a steel surface defect prediction result.

2. The steel defect prediction method based on image processing according to claim 1, characterized in that: The extracting features of the first image to obtain shape feature data specifically includes: Performing threshold segmentation on the first image to obtain a binary image; Performing contour detection on the binary image based on an edge detection algorithm; Shape feature extraction is performed on the contour to obtain shape feature data, wherein the shape feature data includes but is not limited to area and perimeter.

3. The steel defect prediction method based on image processing according to claim 1, characterized in that: The extracting features of the first image to obtain texture feature data specifically includes: Dividing the first image into a plurality of sub-images, obtaining first LBP values ​​corresponding to all pixels in each sub-image, calculating a histogram corresponding to each sub-image based on the first LBP values, and normalizing the histogram to obtain a normalized histogram; The normalized histograms corresponding to each sub-image are connected to obtain the LBP texture feature quantity of the first image, and the LBP texture feature vector is used as texture feature data.

4. The steel defect prediction method based on image processing according to claim 1, characterized in that: The extracting features of the first image to obtain grayscale feature data specifically includes: converting the first image into a grayscale image according to a weighted average method; Divide the grayscale image into a plurality of sub-images, and obtain first grayscale values ​​corresponding to all pixels in each sub-image; Calculate the gray level frequency corresponding to each sub-image based on the magnitude of the first gray value; The gray level frequencies are counted to generate a gray histogram, and the gray histogram is used as gray feature data.

5. The steel defect prediction method based on image processing according to claim 1, characterized in that: The extracting features of the first image to obtain color feature data specifically includes: Obtain the RGB value corresponding to each pixel value in the first image, substitute the RGB value into a preset color space conversion formula, calculate the brightness value and saturation value of the first image, and obtain the color feature data of the first image by substituting the brightness value and the saturation value.

6. The steel defect prediction method based on image processing according to claim 1, characterized in that: Before the step of inputting the normalized feature data into the BP neural network model to obtain the steel surface defect prediction result, the method specifically includes: Acquire a normalized feature historical data set, and divide the normalized feature historical data set into a normalized feature training data set and a normalized feature test data set; The BP neural network model is trained based on the normalized feature training data set, and the BP neural network model is tested based on the normalized feature test data set until the prediction accuracy of the BP neural network model meets a preset accuracy threshold, and the training of the BP neural network model is stopped.

7. The steel defect prediction method based on image processing according to claim 1, characterized in that: After the step of obtaining the steel surface defect prediction result, the method specifically includes: When the predicted result of the steel surface defect is a slight defect, performing a surface flattening treatment on the steel surface; When the predicted result of the steel surface defect is a moderate defect, the steel surface is cleaned, partially repaired and anti-corrosion treated; When the predicted result of the steel surface defect is a severe defect, the steel surface is repaired by welding and confirmed by non-destructive testing.

8. A steel defect prediction system based on image processing, characterized in that: The system comprises: A first image acquisition module is used to acquire a steel surface image and pre-process the steel surface image to obtain a first image; A feature extraction module, used to extract features from the first image to obtain shape feature data, texture feature data, grayscale feature data and color feature data; A normalization feature module, used for normalizing the shape feature data, the texture feature data, the grayscale feature data and the color feature data to obtain normalized feature data; The defect prediction module is used to pre-build a BP neural network model, input the normalized feature data into the BP neural network model, and obtain the steel surface defect prediction result.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the steel defect prediction method based on image processing according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the steel defect prediction method based on image processing according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Microscopic image detection and recognition method for rice blast fungus spore based on support vector machine

    CN108564124A

  • Die casting surface defect detection method and system based on machine vision

    CN110006907A

  • GIS equipment defect detection method based on X-ray imaging

    CN111079955A

  • Blank answer detection method and system for examination paper marking

    CN112700414A

  • Method for inspecting defects of product by using 2d image information

    KR102525667B1

Cited By

  • Raw material conveying control system for candy production

    CN120270798A