Steel plate image segmentation method and device in hot rolling process

By using the SAM model and image enhancement algorithm in the hot rolling process, combined with the attention mechanism, the problem of low segmentation accuracy caused by steel plate temperature and water mist occlusion is solved, and the segmentation effect and model robustness are improved.

CN118887246APending Publication Date: 2024-11-01NORTHEASTERN UNIV CHINA

Patent Information

Application Number
CN202410846547.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

During the hot rolling process, the steel plate area is affected by the steel plate temperature and water mist shading, and existing algorithms are difficult to effectively process, resulting in low segmentation accuracy, insufficient image label accuracy and data diversity, and poor model robustness.

Method used

Using the steel plate image segmentation method based on SAM model and image enhancement algorithm, image encoding and attention calculation are performed through input module, encoding module, attention module, decoding module and output conversion module, combined with spatial attention unit and channel attention unit. , decode fill and pixel value conversion to generate a steel plate segmented image.

Benefits of technology

Improve the accuracy and robustness of steel plate image segmentation, can effectively deal with water mist shading and steel plate color changes, improve the segmentation effect and model training data diversity, and solve the problem of low labeling efficiency and accuracy of traditional industrial image data .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887246A_ABST
    Figure CN118887246A_ABST
Patent Text Reader

Abstract

The invention discloses a steel plate image segmentation method and device in a hot rolling process, and relates to the technical field of image segmentation, and the method comprises the steps: marking a steel plate region in an image in the hot rolling process through an SAM large model, and obtaining a binarization label image which is more precise in segmentation; and the original steel plate image and the binarized label image are used as input data and corresponding labels of the segmentation model, so that the data set for the steel plate image in the hot rolling process is constructed, the steel plate image in the hot rolling process can be accurately labeled, and the problems of low image data labeling efficiency and low accuracy are solved. Then, diversity of steel plate image data in the hot rolling process is improved by using an image enhancement mode, and robustness and accuracy of a training model are improved. Then, an attention mechanism module is introduced to construct a steel plate image segmentation model, accurate segmentation and contour feature extraction of a steel plate image in the hot rolling process are achieved, and the problems of steel plate color change, water mist shielding and the like caused by steel plate temperature change are solved;
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 segmentation, and in particular to a method and device for segmenting steel plate images during a hot rolling process. Background Art

[0002] With the development of modern industrial manufacturing, hot-rolled steel plates are not only a steel product, but also a key basic material, which is widely used in the fields of ships, automobiles, bridges, buildings, machinery, aerospace, etc. However, during high-speed rolling, the surface of the steel plate is more prone to contour anomalies such as warping, edge waves, and sickle shapes, which affect subsequent production and processing, reduce the qualification rate and production efficiency of the steel plate, and even damage the equipment in serious cases, causing the production line to stop. In the hot rolling process, the contour features and surface information of the steel plate are extracted, and the steel plate area is usually segmented first. The traditional method of extracting the contour features of the steel plate mainly relies on human eyes to observe and evaluate. This detection method is generally limited by human subjectivity and energy, and may encounter other complex situations such as water mist occlusion during the production process. It is difficult for humans to effectively observe the steel plate area.

[0003] In the related art, the steel plate image extraction and segmentation methods based on the hot rolling process mainly include threshold segmentation, region growing algorithm, watershed algorithm, genetic algorithm, etc. These methods usually segment the steel plate area based on the color, brightness, texture and edge gradient information of the steel plate area. With the advancement of deep learning technology, some researchers have also segmented steel plate images to extract contour information by designing and applying convolutional neural networks. However, the applicant recognizes that during the rolling process, the steel plate area is affected by the temperature of the steel plate itself and the occlusion of water mist, and the color and edge information are greatly disturbed. It is difficult for existing algorithms to effectively deal with these interferences. In addition, the image labels used by existing algorithms are not accurate, the training data is small in data volume and diversity, and the model robustness is also poor, resulting in low segmentation accuracy. Summary of the invention

[0004] In view of this, the present application provides a method and device for steel plate image segmentation in a hot rolling process, the main purpose of which is to solve the problem that during the rolling process, the steel plate area is affected by the temperature of the steel plate itself and the obstruction of water mist, and the color and edge information are greatly disturbed. It is difficult for existing algorithms to effectively deal with these interferences. In addition, the image labels used by existing algorithms are not accurate, the training data is small in data volume and diversity, and the model robustness is also poor, resulting in the problem of low segmentation accuracy.

[0005] According to the first aspect of the present application, a method for segmenting a steel plate image during a hot rolling process is provided, the method comprising:

[0006] Acquire at least one original steel plate image, and input the at least one original steel plate image into a steel plate image segmentation model, wherein the steel plate image segmentation model is trained using an image segmentation data set obtained based on a SAM model and an image enhancement algorithm, and comprises an input module, an encoding module, an attention module, a decoding module, and an output conversion module;

[0007] Based on the input module, the at least one original steel plate image is sent to the encoding module for encoding, and based on the attention module, the at least one encoding feature map output by the encoding module is subjected to attention calculation to obtain at least one designated feature image, wherein the attention module includes a spatial attention unit and a channel attention unit;

[0008] Based on the attention module, the at least one designated feature image is sent to the decoding module for decoding filling, and based on the output conversion module, at least one decoding feature map output by the decoding module is normalized and calculated to obtain at least one target feature image;

[0009] Based on the output conversion module, a preset threshold is used to convert the pixel values ​​of the at least one target feature map to obtain and output at least one steel plate segmentation image.

[0010] Optionally, before acquiring at least one original steel plate image and inputting the at least one original steel plate image into the steel plate image segmentation model, the method further includes:

[0011] Acquire a plurality of sample images, input the plurality of sample images into the SAM model, and acquire a label image corresponding to each of the sample images output by the SAM model;

[0012] For each of the sample images, a random number and a preset probability value are obtained, and based on the random number and the preset probability value, the sample image and the label image corresponding to the sample image are calculated using the image enhancement algorithm to obtain a sample enhanced image and a label enhanced image, wherein:

[0013]

[0014] Wherein, p is the random number, k is the preset probability value, and f t () is the image enhancement algorithm, when I is the sample image, I t is the sample enhanced image; when I is the label image, it is I t The label enhances the image;

[0015] Performing image enhancement operations on the multiple sample images and the label images corresponding to each of the sample images respectively to obtain multiple sample enhanced images and the label enhanced images corresponding to each of the sample enhanced images, and using the multiple sample enhanced images and the label enhanced images corresponding to each of the sample enhanced images as the image segmentation data set;

[0016] Dividing the image segmentation dataset into a training dataset and a validation dataset;

[0017] A preset number of iterative training times and an initial image segmentation model are obtained, and the initial image segmentation model is iteratively trained using the training data set according to the preset number of iterative training times to obtain the steel plate image segmentation model.

[0018] Optionally, inputting the plurality of sample images into the SAM model and obtaining a label image corresponding to each sample image output by the SAM model comprises:

[0019] For each of the sample images, the image encoder module of the SAM model is used to process the sample image to obtain intermediate features, and the point prompt code corresponding to the sample image is obtained. The prompt encoder module of the SAM model is used to convert the point prompt code into an embedded prompt, and the mask decoder module of the SAM model is used to perform cross-attention calculation on the intermediate features and the embedded prompt to obtain the label image;

[0020] Obtain a label image corresponding to each of the sample images obtained by performing segmentation processing on each of the sample images by the SAM model.

[0021] Optionally, the iterative training of the initial image segmentation model using the training data set according to the preset number of iterative training times to obtain the steel plate image segmentation model includes:

[0022] Iteratively training the initial image segmentation model using the training data set according to the preset number of iterative training times, and obtaining the segmentation result output by the initial image segmentation model after each iterative training to obtain multiple segmentation results;

[0023] Using the verification data set to perform verification calculations on the multiple segmentation results to obtain multiple segmentation indicators;

[0024] Determining a target segmentation index among the multiple segmentation indexes, wherein the target segmentation index is a segmentation index with the highest value among the multiple segmentation indexes;

[0025] The target segmentation result corresponding to the target segmentation index is determined from the multiple segmentation results, and the initial image segmentation model after iterative training that outputs the target segmentation result is used as the steel plate image segmentation model.

[0026] Optionally, performing attention calculation on at least one encoding feature map output by the encoding module based on the attention module to obtain at least one specified feature image includes:

[0027] For each of the encoded feature maps, the channel attention unit is used to calculate the encoded feature map to obtain a target two-dimensional space map, where:

[0028]

[0029] Among them, σ1 is the Softmax activation function, σ0 is the ReLu activation function, ω0 is the first weight of the convolution layer, ω1 is the second weight of the convolution layer, b0 is the first bias of the convolution layer, and b1 is the second bias of the convolution layer. is the feature map after global average pooling, F i is the encoding feature map, GAP() is the global average pooling, Conv() is the convolutional layer, is the element-wise product operation, is the target two-dimensional space map;

[0030] The encoding feature map is calculated using the spatial attention unit to obtain a specified two-dimensional spatial map, where:

[0031]

[0032] Among them, σ1 is the Softmax activation function, σ0 is the ReLu activation function, ω2 is the third weight of the convolution layer, ω3 is the fourth weight of the convolution layer, b2 is the third bias of the convolution layer, and b3 is the fourth bias of the convolution layer. are the feature maps aggregated after global average pooling and maximum pooling, respectively, F i is the encoding feature map, Conv() is the convolution layer, GAP() is the global average pooling, GMP() is the global maximum pooling, is the element-wise product operation, specifying a two-dimensional spatial graph for the said;

[0033] Aggregating the target two-dimensional space image and the specified two-dimensional space image to obtain the specified feature image;

[0034] Obtain the at least one specified feature image obtained by processing each of the encoded feature maps by the channel attention unit and the spatial attention unit.

[0035] Optionally, the sending of the at least one designated feature image to the decoding module for decoding filling based on the attention module, and the normalization calculation of at least one decoding feature map output by the decoding module based on the output conversion module to obtain at least one target feature image include:

[0036] For each of the specified characteristic images, the multiple decoders of the decoding module are sequentially used to decode the specified characteristic images, and after each of the decoders completes the decoding operation, the upsampling unit of the decoder is used to perform an image filling operation according to a preset image size;

[0037] Using the multiple decoders to perform decoding and image filling operations on each of the specified feature images to obtain the at least one decoded feature image;

[0038] Based on the output conversion module, convolution calculation is performed on the at least one decoding feature map to obtain the at least one decoding feature map after convolution;

[0039] For each of the decoded feature maps after convolution, a normalization calculation is performed on the decoded feature map after convolution based on the output conversion module to obtain a target feature image, wherein:

[0040]

[0041] Wherein, x is the pixel value of the decoded feature map after convolution, and S(x) is the target feature image;

[0042] Obtain the at least one target feature image obtained by the output conversion module performing normalization calculation on each of the decoded feature maps after convolution.

[0043] Optionally, the output conversion module uses a preset threshold to perform pixel value conversion on the at least one target feature map to obtain and output at least one steel plate segmentation image, including:

[0044] For each of the target feature images, multiple pixel values ​​of the target feature image are read based on the output conversion module, multiple first pixel values ​​less than the preset threshold are obtained from the multiple pixel values, the multiple first pixel values ​​are changed to a value of 0, and multiple second pixel values ​​greater than the preset threshold are obtained from the multiple pixel values, the multiple second pixel values ​​are changed to a value of 1, and the steel plate segmentation image is obtained;

[0045] The at least one steel plate segmentation image is obtained by the output conversion module performing pixel value conversion on each of the target feature maps.

[0046] According to a second aspect of the present application, a steel plate image segmentation device for a hot rolling process is provided, the device comprising:

[0047] An image input module, used to obtain at least one original steel plate image, and input the at least one original steel plate image into a steel plate image segmentation model, wherein the steel plate image segmentation model is trained using an image segmentation data set obtained based on a SAM model and an image enhancement algorithm, and comprises an input module, an encoding module, an attention module, a decoding module, and an output conversion module;

[0048] An attention calculation module, used for sending the at least one original steel plate image to the encoding module for encoding based on the input module, performing attention calculation on at least one encoding feature map output by the encoding module based on the attention module, and obtaining at least one designated feature image, wherein the attention module includes a spatial attention unit and a channel attention unit;

[0049] a normalization calculation module, configured to send the at least one designated feature image to the decoding module for decoding filling based on the attention module, and perform normalization calculation on at least one decoding feature image output by the decoding module based on the output conversion module to obtain at least one target feature image;

[0050] A pixel value conversion module is used to perform pixel value conversion on the at least one target feature map based on the output conversion module using a preset threshold value to obtain and output at least one steel plate segmentation image.

[0051] Optionally, the device further comprises:

[0052] The model training module is used to obtain a plurality of sample images, input the plurality of sample images into the SAM model, and obtain a label image corresponding to each of the sample images output by the SAM model; for each of the sample images, obtain a random number and a preset probability value, and based on the random number and the preset probability value, use the image enhancement algorithm to calculate the sample image and the label image corresponding to the sample image, respectively, to obtain a sample enhanced image and a label enhanced image, wherein:

[0053]

[0054] Wherein, p is the random number, k is the preset probability value, and f t () is the image enhancement algorithm, when I is the sample image, I t is the sample enhanced image; when I is the label image, it is I tThe label enhanced image; performing image enhancement operations on the multiple sample images and the label image corresponding to each of the sample images, respectively, to obtain multiple sample enhanced images and the label enhanced image corresponding to each of the sample enhanced images, and using the multiple sample enhanced images and the label enhanced image corresponding to each of the sample enhanced images as the image segmentation data set; dividing the image segmentation data set into a training data set and a verification data set; obtaining a preset number of iterative training times and an initial image segmentation model, and iteratively training the initial image segmentation model using the training data set according to the preset number of iterative training times to obtain the steel plate image segmentation model.

[0055] Optionally, the model training module is used to, for each of the sample images, use the image encoder module of the SAM model to process the sample image to obtain intermediate features, obtain point prompt codes corresponding to the sample image, use the prompt encoder module of the SAM model to convert the point prompt codes into embedded prompts, use the mask decoder module of the SAM model to perform cross-attention calculations on the intermediate features and the embedded prompts to obtain the label image; obtain the label image corresponding to each of the sample images obtained by performing segmentation processing on each of the sample images by the SAM model.

[0056] Optionally, the model training module is used to iteratively train the initial image segmentation model using the training data set according to the preset number of iterative training times, and obtain the segmentation results output by the initial image segmentation model after each iterative training to obtain multiple segmentation results; use the verification data set to verify and calculate the multiple segmentation results to obtain multiple segmentation indicators; determine a target segmentation indicator among the multiple segmentation indicators, and the target segmentation indicator is the segmentation indicator with the highest value among the multiple segmentation indicators; determine a target segmentation result corresponding to the target segmentation indicator among the multiple segmentation results, and use the iteratively trained initial image segmentation model that outputs the target segmentation result as the steel plate image segmentation model.

[0057] Optionally, the attention calculation module is used to calculate the encoding feature map using the channel attention unit for each encoding feature map to obtain a target two-dimensional space map, wherein:

[0058]

[0059]

[0060] Among them, σ1 is the Softmax activation function, σ0 is the ReLu activation function, ω0 is the first weight of the convolution layer, ω1 is the second weight of the convolution layer, b0 is the first bias of the convolution layer, and b1 is the second bias of the convolution layer. is the feature map after global average pooling, F i is the encoding feature map, GAP() is the global average pooling, Conv() is the convolutional layer, is the element-wise product operation, is the target two-dimensional spatial graph; the spatial attention unit is used to calculate the encoding feature graph to obtain a specified two-dimensional spatial graph, wherein,

[0061]

[0062] Among them, σ1 is the Softmax activation function, σ0 is the ReLu activation function, ω2 is the third weight of the convolution layer, ω3 is the fourth weight of the convolution layer, b2 is the third bias of the convolution layer, and b3 is the fourth bias of the convolution layer. are the feature maps aggregated after global average pooling and maximum pooling, respectively, F i is the encoding feature map, Conv() is the convolution layer, GAP() is the global average pooling, GMP() is the global maximum pooling, is the element-wise product operation, The specified two-dimensional spatial map is the specified two-dimensional spatial map; the target two-dimensional spatial map and the specified two-dimensional spatial map are aggregated to obtain the specified feature image; and at least one specified feature image is obtained by processing each of the encoded feature maps by the channel attention unit and the spatial attention unit.

[0063] Optionally, the normalization calculation module is used to decode each of the designated feature images in turn using multiple decoders of the decoding module, and when each of the decoders completes the decoding operation, use the upsampling unit of the decoder to perform an image filling operation according to a preset image size; use the multiple decoders to perform decoding and image filling operations on each of the designated feature images to obtain the at least one decoding feature map; based on the output conversion module, perform convolution calculations on the at least one decoding feature map respectively to obtain the at least one decoding feature map after convolution; for each of the decoding feature maps after convolution, perform normalization calculations on the decoding feature map after convolution based on the output conversion module to obtain a target feature image, wherein,

[0064]

[0065] Wherein, x is the pixel value of the decoded feature map after convolution, and S(x) is the target feature image; the at least one target feature image is obtained by the output conversion module performing normalization calculation on each of the decoded feature maps after convolution.

[0066] Optionally, the pixel value conversion module is used to read multiple pixel values ​​of the target feature image for each of the target feature images based on the output conversion module, obtain multiple first pixel values ​​less than the preset threshold from the multiple pixel values, change the multiple first pixel values ​​to the value 0, and obtain multiple second pixel values ​​greater than the preset threshold from the multiple pixel values, change the multiple second pixel values ​​to the value 1, so as to obtain the steel plate segmentation image; obtain the at least one steel plate segmentation image obtained by performing pixel value conversion on each of the target feature images by the output conversion module.

[0067] By means of the above technical scheme, the present application provides a steel plate image segmentation method, device, computer equipment and readable storage medium. The present application obtains at least one original steel plate image, inputs at least one original steel plate image into a steel plate image segmentation model, sends at least one original steel plate image to an encoding module for encoding based on an input module, performs attention calculation on at least one encoding feature map output by the encoding module based on an attention module, obtains at least one designated feature image, sends at least one designated feature image to a decoding module for decoding filling based on the attention module, performs normalization calculation on at least one decoding feature map output by the decoding module based on an output conversion module, obtains at least one target feature image, and performs pixel value conversion on at least one target feature map using a preset threshold based on the output conversion module, obtains and outputs at least one steel plate segmentation image. Among them, the steel plate image segmentation model is obtained by training with an image segmentation data set obtained based on a SAM model and an image enhancement algorithm, and includes an input module, an encoding module, an attention module, a decoding module and an output conversion module, and the attention module includes a spatial attention unit and a channel attention unit. The SAM large model is used to mark the steel plate area in the hot rolling process image to obtain a more accurately segmented binary label image, and the original steel plate image and the obtained binary label image are used as the input data and corresponding labels of the segmentation model, so as to construct a data set for the hot rolling process steel plate image, which can accurately label the steel plate image in the hot rolling process and solve the problem of low efficiency and accuracy of manual labeling of traditional industrial image data. Subsequently, the diversity of steel plate image data in the hot rolling process is improved by using image enhancement methods such as rotation, Gaussian blur, and contrast transformation, and the robustness and accuracy of the training model are improved. Then, by introducing the attention mechanism module, a segmentation model based on the hot rolling process steel plate image is constructed, which has strong robustness, can realize accurate segmentation and contour feature extraction of steel plate images in the hot rolling process, and solve the problems of steel plate color change and water mist occlusion caused by steel plate temperature change.

[0068] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0070] Figure 1 A schematic flow chart of a method for steel plate image segmentation in a hot rolling process provided by an embodiment of the present application is shown;

[0071] Figure 2A A schematic flow chart of another method for steel plate image segmentation in a hot rolling process provided by an embodiment of the present application is shown;

[0072] Figure 2B A flow chart of the processing steps of the steel plate image segmentation algorithm provided in an embodiment of the present application is shown;

[0073] Figure 3A A schematic diagram of the structure of steel plate image segmentation in a hot rolling process provided by an embodiment of the present application is shown;

[0074] Figure 3B A schematic structural diagram of another steel plate image segmentation process in a hot rolling process provided by an embodiment of the present application is shown;

[0075] Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0076] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0077] The present application embodiment provides a method for segmenting steel plate images during hot rolling. Figure 1 As shown, the method includes:

[0078] 101. Obtain at least one original steel plate image, and input the at least one original steel plate image into a steel plate image segmentation model.

[0079] During the hot rolling process of steel plates, the contour features and surface information of the steel plates are important indicators for steel plate quality detection. Currently, the features are mainly extracted and evaluated through human visual observation, which usually has limitations such as subjectivity, accuracy and low efficiency. In recent years, with the development of image processing algorithms, image-based hot rolling process steel plate quality detection methods have received widespread attention. Existing image-based methods for extracting steel plate contour features and surface information require the steel plate area to be segmented during the hot rolling process first. However, due to the small number of data set labels and the influence of water mist and color changes of the steel plate area during the hot rolling process, the segmentation effect of the steel plate area is poor and the segmentation effect is greatly disturbed by environmental factors such as water mist. This will cause the abnormal contours of the steel plate such as sickle bends to be unable to be effectively detected, which will greatly affect the yield and production efficiency of the steel plate.

[0080] To solve this problem, the present application proposes a method for hot rolling process steel plate image segmentation. First, the visual basic SAM (Segment Anything Model) large model is used to establish a steel plate image segmentation dataset for the hot rolling process, so as to solve the problem of few labels in the hot rolling process dataset. Then, the dataset is processed by using image enhancement methods such as rotation, Gaussian blur, and contrast transformation to improve the diversity of steel plate image data in the hot rolling process, improve the robustness and accuracy of the training model, and then use the image segmentation model based on the hot rolling process steel plate to improve the segmentation accuracy under the influence of factors such as water mist occlusion. The execution subject of the present application can be an image segmentation system, which relies on the computing power of the server to provide services to users. The server can be an independent server, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN) and big data and artificial intelligence platforms and other basic cloud computing servers, so as to effectively and accurately segment the steel plate area of ​​the image in the hot rolling process.

[0081] In an embodiment of the present application, the image segmentation system obtains at least one original steel plate image, and inputs at least one original steel plate image into the steel plate image segmentation model. The original steel plate image is an image of a steel plate in an actual hot rolling process at an industrial site, and the steel plate image segmentation model is trained using an image segmentation data set obtained based on a SAM model and an image enhancement algorithm. The steel plate image segmentation model includes an input module, an encoding module, an attention module, a decoding module, and an output conversion module, which can suppress the interference of water mist features, thereby more accurately capturing the boundaries and features of the steel plate area.

[0082] 102. Based on the input module, at least one original steel plate image is sent to the encoding module for encoding, and based on the attention module, attention calculation is performed on at least one encoding feature map output by the encoding module to obtain at least one specified feature image.

[0083] In an embodiment of the present application, the image segmentation system sends at least one original steel plate image to the encoding module for encoding based on the input module, which can capture the detail information in the image and generate a feature map. Then, the image segmentation system performs attention calculation on at least one encoded feature map output by the encoding module based on the attention module to obtain at least one specified feature image. Among them, the attention module includes a spatial attention unit and a channel attention unit. The spatial attention is used to pay attention to the steel plate contour features, so that the network focuses on the steel plate area in the image, suppresses the interference of water mist features, and thus more accurately captures the boundaries and features of the steel plate area. The channel attention is used to pay attention to the color features of the steel plate area, so that the network can automatically adjust the weights of different channels to adapt to different color changes, thereby enhancing the network's adaptive perception of color information. Therefore, the steel plate image segmentation model can solve the problems of water mist interference and steel plate color changes in the hot rolling process through the attention module, and improve the accuracy of model segmentation.

[0084] 103. Based on the attention module, at least one designated feature image is sent to the decoding module for decoding filling, and based on the output conversion module, at least one decoding feature map output by the decoding module is normalized and calculated to obtain at least one target feature image.

[0085] In an embodiment of the present application, the image segmentation system sends at least one designated feature image to the decoding module for decoding filling based on the attention module. Then, the image segmentation system performs normalization calculation on at least one decoding feature image output by the decoding module based on the output conversion module to obtain at least one target feature image.

[0086] 104. Based on the output conversion module, a preset threshold is used to convert the pixel values ​​of at least one target feature map to obtain and output at least one steel plate segmentation image.

[0087] In an embodiment of the present application, the image segmentation system uses a preset threshold to convert pixel values ​​of at least one target feature map based on an output conversion module, obtains and outputs at least one steel plate segmentation image, and obtains clearer segmentation results by setting the threshold, thereby achieving accurate segmentation of the steel plate image during the hot rolling process.

[0088] The method provided in the embodiment of the present application obtains at least one original steel plate image, inputs at least one original steel plate image into a steel plate image segmentation model, sends at least one original steel plate image to an encoding module for encoding based on an input module, performs attention calculation on at least one encoding feature map output by the encoding module based on an attention module to obtain at least one designated feature image, sends at least one designated feature image to a decoding module for decoding filling based on the attention module, performs normalization calculation on at least one decoding feature map output by the decoding module based on an output conversion module to obtain at least one target feature image, and performs pixel value conversion on at least one target feature map using a preset threshold based on the output conversion module to obtain and output at least one steel plate segmentation image. The steel plate image segmentation model is obtained by training with an image segmentation data set obtained based on a SAM model and an image enhancement algorithm, and includes an input module, an encoding module, an attention module, a decoding module, and an output conversion module, and the attention module includes a spatial attention unit and a channel attention unit. The SAM large model is used to mark the steel plate area in the hot rolling process image to obtain a more accurately segmented binary label image, and the original steel plate image and the obtained binary label image are used as the input data and corresponding labels of the segmentation model, so as to construct a data set for the hot rolling process steel plate image, which can accurately label the steel plate image in the hot rolling process and solve the problem of low efficiency and accuracy of manual labeling of traditional industrial image data. Subsequently, the diversity of steel plate image data in the hot rolling process is improved by using image enhancement methods such as rotation, Gaussian blur, and contrast transformation, and the robustness and accuracy of the training model are improved. Then, by introducing the attention mechanism module, a segmentation model based on the hot rolling process steel plate image is constructed, which has strong robustness, can realize accurate segmentation and contour feature extraction of steel plate images in the hot rolling process, and solve the problems of steel plate color change and water mist occlusion caused by steel plate temperature change.

[0089] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, the embodiment of the present application provides another steel plate image segmentation method in the hot rolling process, such as Figure 2A As shown, the method includes:

[0090] 201. Obtain a plurality of sample images, input the plurality of sample images into a SAM model, and obtain a label image corresponding to each sample image output by the SAM model.

[0091] In the embodiment of the present application, the image segmentation system establishes a hot rolling process steel plate image segmentation data set for training the image segmentation model. First, the image segmentation SAM model in the computer field is used. The SAM model can better segment the features of the image without samples, so that an accurate binary label image can be obtained. The frame containing the steel plate area in the video data obtained from the hot rolling process site is used as the original steel plate image data, and the original steel plate image data is imported into the SAM model to obtain a binary image that accurately segments the steel plate area as a label for the subsequent model training, wherein the pixel value of the steel plate area is set to 1, and the pixel value of the non-steel plate area is set to 0.

[0092] Specifically, since the SAM model is composed of an image encoder module, a hint encoder module, and a mask decoder module, for each sample image, the image segmentation system first uses the image encoder module of the SAM model to process the sample image to obtain intermediate features, and the calculation formula is as follows:

[0093] Formula 1: F img =Φ i-enc (I)

[0094] Where I is the sample image, Φ i-enc () is the image encoder module, F img An intermediate feature.

[0095] Next, the image segmentation system obtains the point cue code corresponding to the sample image, and uses the cue encoder module of the SAM model to convert the point cue code into an embedded cue, calculated as follows:

[0096] Formula 2: T prompt =Φ p-enc ({P})

[0097] Among them, {P} is the point prompt code, including foreground points, background points, bounding boxes or masks, etc., which can be obtained by clicking on the steel plate area in the hot rolling process image, Φ p-enc () is the prompt encoder module, T prompt For embedded prompts.

[0098] Then, the image segmentation system uses the mask decoder module of the SAM model to perform cross-attention calculations on the intermediate features and embedded cues to obtain the label image, which is calculated as follows:

[0099] Formula 3: y = Φ m-dec (F img ,T prompt )

[0100] Among them, F img is the intermediate feature, T prompt For embedded prompts, Φm-dec () is the mask decoder module, and y is the label image. The cross-attention mechanism of the mask decoder module can promote the interaction between image features and hint embedding, and finally obtain an accurate steel plate area segmentation result as the original label image.

[0101] Finally, by repeatedly executing the above steps, the image segmentation system can obtain the label image corresponding to each sample image obtained by the SAM model segmenting each sample image. The SAM model is used to accurately label the steel plate images in the hot rolling process, thereby providing a method for the hot rolling process steel plate industrial data set with a lack of accurate labels, and can also solve the problem of low efficiency and accuracy of manual labeling of traditional industrial image data.

[0102] 202. Use an image enhancement algorithm to perform image enhancement on multiple sample images and a label image corresponding to each sample image to obtain an image segmentation data set.

[0103] In the embodiment of the present application, the image segmentation system expands and preprocesses the data set, that is, the steel plate image is enhanced by randomly selecting different angles, flipping, and various color image enhancement methods including adjusting color contrast and light brightness. Specifically, for each sample image, the image segmentation system obtains a random number and a preset probability value, and based on the random number and the preset probability value, uses an image enhancement algorithm to calculate the sample image and the label image corresponding to the sample image, respectively, to obtain a sample enhanced image and a label enhanced image, and the calculation formula is the following formula 4:

[0104]

[0105] Among them, p is a randomly generated (0-1) random number, k is a preset probability value, indicating the probability of image enhancement, and f t () is the image enhancement algorithm. When I is the sample image, I t is the sample enhanced image; when I is the label image, it is I t Label augmented images;

[0106] Then, the image segmentation system performs image enhancement operations on multiple sample images and the label image corresponding to each sample image, respectively, to obtain multiple sample enhanced images and the label enhanced image corresponding to each sample enhanced image, and uses the multiple sample enhanced images and the label enhanced image corresponding to each sample enhanced image as the image segmentation data set. In this way, the image segmentation system performs the same enhancement on the sample image and the label image at the same time by using image enhancement methods such as rotation, Gaussian blur, and contrast transformation. When training the model, the enhanced sample image can be compared with the label image after the image segmentation model outputs the loss, thereby obtaining a more accurate steel plate image segmentation model. Image enhancement can also improve the diversity of steel plate image data during hot rolling, and improve the robustness and accuracy of the training model.

[0107] 203. The image segmentation data set is divided into a training data set and a verification data set, and the initial image segmentation model is iteratively trained using the training data set according to a preset number of iterative training times to obtain a steel plate image segmentation model.

[0108] In the embodiment of the present application, the steel plate image segmentation model based on the hot rolling process adopts the Encode-Decode (decoding-encoding) architecture, Encode consists of an input module and an encoding module including 6 groups of encoders, Decode consists of an output conversion module and a decoding module including 6 groups of decoders, and an attention module after Encode extracts features, wherein the attention module consists of a channel attention unit and a spatial attention unit. The introduction of spatial attention can pay attention to the contour features of the steel plate, allowing the network to focus on the steel plate area in the image, suppressing the interference of water mist features, thereby more accurately capturing the boundaries and features of the steel plate area; the introduction of channel attention can pay attention to the color features of the steel plate area, allowing the network to automatically adjust the weights of different channels to adapt to different color changes, thereby enhancing the network's adaptive perception of color information. The specific model training process is as follows:

[0109] The image segmentation system uses the training data set to iteratively train the initial image segmentation model according to the preset number of iterative training times, and obtains the segmentation results output by the initial image segmentation model after each iterative training to obtain multiple segmentation results. For example, the image segmentation system selects 80% of the data from the processed image segmentation data set as the training data set and 20% of the data as the verification data set, and then inputs the training data set into the constructed initial image segmentation model for iterative training, and the preset number of iterative training rounds is set to 80 rounds.

[0110] Next, the image segmentation system uses the validation data set to verify and calculate multiple segmentation results, obtain multiple segmentation indices, and determine the target segmentation index among the multiple segmentation indices, where the target segmentation index is the segmentation index with the highest value among the multiple segmentation indices. Subsequently, the image segmentation system selects the model with the best segmentation index to save, that is, determines the target segmentation result corresponding to the target segmentation index among the multiple segmentation results, and uses the initial image segmentation model after iterative training that outputs the target segmentation result as the steel plate image segmentation model. The steel plate image segmentation model obtained by training with the image segmentation data set obtained based on the SAM model and the image enhancement algorithm has strong robustness, and can realize accurate segmentation and contour feature extraction of steel plate images during hot rolling, and solve problems such as steel plate color change and water mist occlusion caused by steel plate temperature changes.

[0111] Optionally, the image segmentation system can use the Adam (adaptive motion estimation algorithm) optimization algorithm to optimize the model of the training process, with the learning rate set to 0.00001, and the loss function of the model using the mean absolute value loss, and its loss function L can be expressed as the following formula 5:

[0112]

[0113] in, Represents the label image predicted by the model, y i represents the true label image, and N is the total number of pixels.

[0114] 204. Obtain at least one original steel plate image, and input the at least one original steel plate image into a steel plate image segmentation model.

[0115] In the embodiment of the present application, based on the steel plate image segmentation model obtained by the above training process, the image segmentation system can effectively segment the steel plate area in the hot rolling process image by extracting features from the original steel plate image. The steel plate image segmentation model includes an input module, an encoding module, an attention module, a decoding module and an output conversion module, and is trained using an image segmentation data set obtained based on the SAM model and the image enhancement algorithm.

[0116] 205. Based on the input module, at least one original steel plate image is sent to the encoding module for encoding, and based on the attention module, attention calculation is performed on at least one encoding feature map output by the encoding module to obtain at least one specified feature image.

[0117] In the embodiment of the present application, the image segmentation system sends at least one original steel plate image to the encoding module for encoding based on the input module to obtain at least one encoding feature map. For each encoding feature map, the image segmentation system uses a channel attention unit to calculate the encoding feature map to obtain a target two-dimensional space map, and the calculation formula is the following formula 6:

[0118]

[0119] Among them, σ1 is the Softmax (normalization function) activation function, σ0 is the ReLu (Rectified Linear Unit) activation function, ω0 is the first weight of the convolution layer, ω1 is the second weight of the convolution layer, b0 is the first bias of the convolution layer, and b1 is the second bias of the convolution layer. is the feature map after global average pooling, F i is the encoding feature map, GAP() is the global average pooling, Conv() is the convolutional layer, is the element-wise product operation, is the target two-dimensional space graph,

[0120] Next, the image segmentation system uses the spatial attention unit to calculate the encoded feature map to obtain the specified two-dimensional spatial map. The calculation formula is as follows:

[0121]

[0122] Among them, σ1 is the Softmax activation function, σ0 is the ReLu activation function, ω2 is the third weight of the convolution layer, ω3 is the fourth weight of the convolution layer, b2 is the third bias of the convolution layer, and b3 is the fourth bias of the convolution layer. are the feature maps aggregated after global average pooling and maximum pooling, respectively, F i is the encoding feature map, Conv() is the convolution layer, GAP() is the global average pooling, GMP() is the global maximum pooling, is the element-wise product operation, To specify a two-dimensional space graph,

[0123] Then, the image segmentation system aggregates the target two-dimensional spatial map and the specified two-dimensional spatial map to obtain the specified feature image. Based on the above process, the image segmentation system can obtain at least one specified feature image obtained by processing each encoded feature map by the channel attention unit and the spatial attention unit. Due to the problems of water mist interference and steel plate color change in the hot rolling process, the steel plate image segmentation model introduces an attention module, including a channel attention unit and a spatial attention unit. In response to the water mist interference problem, the spatial attention unit is introduced to focus on the steel plate area in the image, suppressing the interference of water mist features, so as to more accurately capture the boundaries and features of the steel plate area; and in response to the influence of steel plate color changes, the channel attention unit is introduced to automatically adjust the weights of different channels to adapt to different color changes, thereby enhancing the network's adaptive perception of color information.

[0124] 206. Send at least one designated feature image to a decoding module for decoding filling based on the attention module.

[0125] In the embodiment of the present application, since the model uses encoding and decoding processes to extract image features, the image size will change, which is not conducive to the subsequent generation of segmented images. Therefore, in order to ensure that the image size remains unchanged, the steel plate image segmentation model uses upsampling to fill the feature map during the jump connection process of each group of decoders. Specifically, for each specified feature image, the image segmentation system sequentially uses multiple decoders of the decoding module to decode the specified feature image, and when each decoder completes the decoding operation, the upsampling unit of the decoder is used to perform image filling operations according to the preset image size. In this way, the image segmentation system uses multiple decoders to decode and fill the image for each specified feature image to obtain at least one decoded feature map.

[0126] 207. Perform normalization calculation on at least one decoding feature map output by the decoding module based on the output conversion module to obtain at least one target feature image.

[0127] In the embodiment of the present application, the image segmentation system performs convolution calculation on at least one decoding feature map based on the output conversion module to obtain at least one decoding feature map after convolution. For each decoding feature map after convolution, the image segmentation system performs normalization calculation on the decoding feature map after convolution based on the output conversion module to obtain a target feature image, and the calculation formula is the following formula 8:

[0128]

[0129] Wherein, x is the pixel value of the decoded feature map after convolution, S(x) is the target feature image, and e is a natural constant. Based on the above process, the image segmentation system can obtain the output conversion module to perform normalization calculation on each decoded feature map after convolution to obtain at least one target feature image with relatively smooth mapping.

[0130] 208. Based on the output conversion module, a preset threshold is used to convert the pixel values ​​of at least one target feature map to obtain and output at least one steel plate segmentation image.

[0131] In the embodiment of the present application, for each target feature image, the image segmentation system reads multiple pixel values ​​of the target feature image based on the output conversion module, obtains multiple first pixel values ​​less than a preset threshold value from the multiple pixel values, changes the multiple first pixel values ​​to a value of 0, and obtains multiple second pixel values ​​greater than the preset threshold value from the multiple pixel values, changes the multiple second pixel values ​​to a value of 1, and obtains a steel plate segmentation image, as shown in the following formula 9:

[0132]

[0133] Among them, K represents the preset threshold, I(x,y) represents the pixel value of the target feature image, and I'(x,y) represents the pixel value of the steel plate segmentation image. For example, the preset threshold is 0.5, and the continuous prediction results are operated element by element. The values ​​greater than 0.5 are set to 1 and marked as the target area, and the values ​​less than 0.5 are set to 0 and marked as the background area. It should be noted that the pixel value of the target feature image is a number from 0 to 1, which represents the probability that each pixel is located in the steel plate area. Therefore, a clearer segmentation result is obtained by setting a preset threshold. Based on the above process, the image segmentation system can obtain at least one steel plate segmentation image obtained by the output conversion module by converting the pixel value of each target feature map.

[0134] In summary, this application proposes a steel plate image segmentation algorithm processing step flow chart as follows:

[0135] First, collect steel plate images, use the SAM model to establish a steel plate image segmentation dataset, and expand and preprocess the dataset. Then, build a steel plate segmentation model based on the hot rolling process, use the dataset to train the steel plate segmentation model based on the hot rolling process, and obtain a steel plate image segmentation model. Finally, use the trained steel plate image segmentation model to segment the steel plate images during the hot rolling process. After experiments, the segmentation accuracy of the on-site steel plate images of the hot rolling process in this application reached 90.7%, which effectively solved the problems of color change of steel plates and water mist interference during the hot rolling process, and can provide strong support for the subsequent effective extraction of steel plate contour features during the hot rolling process and the improvement of the accuracy of abnormal contour detection of steel plates such as sickle bends.

[0136] The method provided in the embodiment of the present application obtains at least one original steel plate image, inputs at least one original steel plate image into a steel plate image segmentation model, sends at least one original steel plate image to an encoding module for encoding based on an input module, performs attention calculation on at least one encoding feature map output by the encoding module based on an attention module to obtain at least one designated feature image, sends at least one designated feature image to a decoding module for decoding filling based on the attention module, performs normalization calculation on at least one decoding feature map output by the decoding module based on an output conversion module to obtain at least one target feature image, and performs pixel value conversion on at least one target feature map using a preset threshold based on the output conversion module to obtain and output at least one steel plate segmentation image. The steel plate image segmentation model is obtained by training with an image segmentation data set obtained based on a SAM model and an image enhancement algorithm, and includes an input module, an encoding module, an attention module, a decoding module, and an output conversion module, and the attention module includes a spatial attention unit and a channel attention unit. The SAM large model is used to mark the steel plate area in the hot rolling process image to obtain a more accurately segmented binary label image, and the original steel plate image and the obtained binary label image are used as the input data and corresponding labels of the segmentation model, so as to construct a data set for the hot rolling process steel plate image, which can accurately label the steel plate image in the hot rolling process and solve the problem of low efficiency and accuracy of manual labeling of traditional industrial image data. Subsequently, the diversity of steel plate image data in the hot rolling process is improved by using image enhancement methods such as rotation, Gaussian blur, and contrast transformation, and the robustness and accuracy of the training model are improved. Then, by introducing the attention mechanism module, a segmentation model based on the hot rolling process steel plate image is constructed, which has strong robustness, can realize accurate segmentation and contour feature extraction of steel plate images in the hot rolling process, and solve the problems of steel plate color change and water mist occlusion caused by steel plate temperature change.

[0137] Further, as Figure 1 In a specific implementation of the method, the present application provides a steel plate image segmentation device for a hot rolling process, such as Figure 3A As shown, the device includes: an image input module 301, an attention calculation module 302, a normalization calculation module 303 and a pixel value conversion module 304.

[0138] An image input module 301 is used to obtain at least one original steel plate image, and input the at least one original steel plate image into a steel plate image segmentation model, wherein the steel plate image segmentation model is trained using an image segmentation data set obtained based on a SAM model and an image enhancement algorithm, and includes an input module, an encoding module, an attention module, a decoding module, and an output conversion module;

[0139] An attention calculation module 302 is used to send the at least one original steel plate image to the encoding module for encoding based on the input module, and perform attention calculation on at least one encoding feature map output by the encoding module based on the attention module to obtain at least one specified feature image, wherein the attention module includes a spatial attention unit and a channel attention unit;

[0140] A normalization calculation module 303 is used to send the at least one designated feature image to the decoding module for decoding filling based on the attention module, and perform normalization calculation on at least one decoding feature map output by the decoding module based on the output conversion module to obtain at least one target feature image;

[0141] The pixel value conversion module 304 is used to perform pixel value conversion on the at least one target feature map based on the output conversion module using a preset threshold value to obtain and output at least one steel plate segmentation image.

[0142] In specific application scenarios, such as Figure 3B As shown, the device also includes: a model training module 305.

[0143] The model training module 305 is used to obtain a plurality of sample images, input the plurality of sample images into the SAM model, and obtain a label image corresponding to each of the sample images output by the SAM model; for each of the sample images, obtain a random number and a preset probability value, and based on the random number and the preset probability value, use the image enhancement algorithm to calculate the sample image and the label image corresponding to the sample image, respectively, to obtain a sample enhanced image and a label enhanced image, wherein:

[0144]

[0145] Wherein, p is the random number, k is the preset probability value, and f t () is the image enhancement algorithm, when I is the sample image, I t is the sample enhanced image; when I is the label image, it is I t The label enhanced image; performing image enhancement operations on the multiple sample images and the label image corresponding to each of the sample images, respectively, to obtain multiple sample enhanced images and the label enhanced image corresponding to each of the sample enhanced images, and using the multiple sample enhanced images and the label enhanced image corresponding to each of the sample enhanced images as the image segmentation data set; dividing the image segmentation data set into a training data set and a verification data set; obtaining a preset number of iterative training times and an initial image segmentation model, and iteratively training the initial image segmentation model using the training data set according to the preset number of iterative training times to obtain the steel plate image segmentation model.

[0146] In a specific application scenario, the model training module 305 is used to, for each of the sample images, use the image encoder module of the SAM model to process the sample image to obtain intermediate features, obtain the point prompt code corresponding to the sample image, use the prompt encoder module of the SAM model to convert the point prompt code into an embedded prompt, use the mask decoder module of the SAM model to perform cross-attention calculations on the intermediate features and the embedded prompts to obtain the label image; obtain the label image corresponding to each of the sample images obtained by segmenting each of the sample images with the SAM model.

[0147] In a specific application scenario, the model training module 305 is used to iteratively train the initial image segmentation model using the training data set according to the preset number of iterative training times, and obtain the segmentation results output by the initial image segmentation model after each iterative training to obtain multiple segmentation results; use the verification data set to verify and calculate the multiple segmentation results to obtain multiple segmentation indicators; determine the target segmentation indicator among the multiple segmentation indicators, and the target segmentation indicator is the segmentation indicator with the highest value among the multiple segmentation indicators; determine the target segmentation result corresponding to the target segmentation indicator among the multiple segmentation results, and use the iteratively trained initial image segmentation model that outputs the target segmentation result as the steel plate image segmentation model.

[0148] In a specific application scenario, the attention calculation module 302 is used to calculate the encoding feature map using the channel attention unit for each encoding feature map to obtain a target two-dimensional space map, wherein:

[0149]

[0150] Among them, σ1 is the Softmax activation function, σ0 is the ReLu activation function, ω0 is the first weight of the convolution layer, ω1 is the second weight of the convolution layer, b0 is the first bias of the convolution layer, and b1 is the second bias of the convolution layer. is the feature map after global average pooling, F i is the encoding feature map, GAP() is the global average pooling, Conv() is the convolutional layer, is the element-wise product operation, is the target two-dimensional spatial graph; the spatial attention unit is used to calculate the encoding feature graph to obtain a specified two-dimensional spatial graph, wherein,

[0151]

[0152] Among them, σ1 is the Softmax activation function, σ0 is the ReLu activation function, ω2 is the third weight of the convolution layer, ω3 is the fourth weight of the convolution layer, b2 is the third bias of the convolution layer, and b3 is the fourth bias of the convolution layer. are the feature maps aggregated after global average pooling and maximum pooling, respectively, F i is the encoding feature map, Conv() is the convolution layer, GAP() is the global average pooling, GMP() is the global maximum pooling, is the element-wise product operation, The specified two-dimensional spatial map is the specified two-dimensional spatial map; the target two-dimensional spatial map and the specified two-dimensional spatial map are aggregated to obtain the specified feature image; and at least one specified feature image is obtained by processing each of the encoded feature maps by the channel attention unit and the spatial attention unit.

[0153] In a specific application scenario, the normalization calculation module 303 is used to decode each of the specified feature images in turn using multiple decoders of the decoding module, and when each of the decoders completes the decoding operation, use the upsampling unit of the decoder to perform an image filling operation according to a preset image size; use the multiple decoders to perform decoding and image filling operations on each of the specified feature images to obtain the at least one decoding feature map; based on the output conversion module, perform convolution calculations on the at least one decoding feature map to obtain the at least one decoding feature map after convolution; for each of the decoding feature maps after convolution, perform normalization calculations on the decoding feature map after convolution based on the output conversion module to obtain a target feature image, wherein,

[0154]

[0155] Wherein, x is the pixel value of the decoded feature map after convolution, and S(x) is the target feature image; the at least one target feature image is obtained by the output conversion module performing normalization calculation on each of the decoded feature maps after convolution.

[0156] In a specific application scenario, the pixel value conversion module 304 is used to read multiple pixel values ​​of the target feature image based on the output conversion module for each of the target feature images, obtain multiple first pixel values ​​less than the preset threshold from the multiple pixel values, change the multiple first pixel values ​​to the value 0, and obtain multiple second pixel values ​​greater than the preset threshold from the multiple pixel values, change the multiple second pixel values ​​to the value 1, to obtain the steel plate segmentation image; obtain the at least one steel plate segmentation image obtained by the output conversion module performing pixel value conversion on each of the target feature images.

[0157] The device provided in the embodiment of the present application obtains at least one original steel plate image, inputs at least one original steel plate image into a steel plate image segmentation model, sends at least one original steel plate image to an encoding module for encoding based on an input module, performs attention calculation on at least one encoding feature map output by the encoding module based on an attention module to obtain at least one designated feature image, sends at least one designated feature image to a decoding module for decoding filling based on the attention module, performs normalization calculation on at least one decoding feature map output by the decoding module based on an output conversion module to obtain at least one target feature image, and performs pixel value conversion on at least one target feature map using a preset threshold based on the output conversion module to obtain and output at least one steel plate segmentation image. The steel plate image segmentation model is obtained by training with an image segmentation data set obtained based on a SAM model and an image enhancement algorithm, and includes an input module, an encoding module, an attention module, a decoding module, and an output conversion module, and the attention module includes a spatial attention unit and a channel attention unit. The SAM large model is used to mark the steel plate area in the hot rolling process image to obtain a more accurately segmented binary label image, and the original steel plate image and the obtained binary label image are used as the input data and corresponding labels of the segmentation model, so as to construct a data set for the hot rolling process steel plate image, which can accurately label the steel plate image in the hot rolling process and solve the problem of low efficiency and accuracy of manual labeling of traditional industrial image data. Subsequently, the diversity of steel plate image data in the hot rolling process is improved by using image enhancement methods such as rotation, Gaussian blur, and contrast transformation, and the robustness and accuracy of the training model are improved. Then, by introducing the attention mechanism module, a segmentation model based on the hot rolling process steel plate image is constructed, which has strong robustness, can realize accurate segmentation and contour feature extraction of steel plate images in the hot rolling process, and solve the problems of steel plate color change and water mist occlusion caused by steel plate temperature change.

[0158] It should be noted that for other corresponding descriptions of the functional units involved in the steel plate image segmentation device for hot rolling process provided in the embodiment of the present application, reference can be made to Figure 1 and FIG. 2A to FIG. 2B The corresponding description in will not be repeated here.

[0159] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0160] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0161] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

[0162] In an exemplary embodiment, see Figure 4 , and also provides a computer device, which includes a bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device, wherein each functional unit can communicate with each other through the bus. The memory stores a computer program, and the processor is used to execute the program stored in the memory to execute a steel plate image segmentation method in a hot rolling process in the above embodiment.

[0163] A readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for segmenting steel plate images in a hot rolling process.

[0164] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by hardware, or by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0165] Those skilled in the art will appreciate that the accompanying drawing is only a schematic diagram of a preferred implementation scenario, and the modules or processes in the accompanying drawing are not necessarily required for implementing the present application.

[0166] Those skilled in the art will appreciate that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more devices different from the implementation scenario. The modules in the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.

[0167] The above application serial numbers are for description only and do not represent the advantages or disadvantages of the implementation scenarios.

[0168] The above disclosure only discloses several specific implementation scenarios of the present application. However, the present application is not limited thereto, and any changes that can be conceived by technicians in this field should fall within the scope of protection of the present application.

Claims

1. A steel plate image segmentation method in a hot rolling process, characterized in that: include: Acquire at least one original steel plate image, and input the at least one original steel plate image into a steel plate image segmentation model, wherein the steel plate image segmentation model is trained using an image segmentation data set obtained based on a SAM model and an image enhancement algorithm, and comprises an input module, an encoding module, an attention module, a decoding module, and an output conversion module; Based on the input module, the at least one original steel plate image is sent to the encoding module for encoding, and based on the attention module, the at least one encoding feature map output by the encoding module is subjected to attention calculation to obtain at least one designated feature image, wherein the attention module includes a spatial attention unit and a channel attention unit; Based on the attention module, the at least one designated feature image is sent to the decoding module for decoding filling, and based on the output conversion module, at least one decoding feature map output by the decoding module is normalized and calculated to obtain at least one target feature image; Based on the output conversion module, a preset threshold is used to convert the pixel values ​​of the at least one target feature map to obtain and output at least one steel plate segmentation image.

2. The method according to claim 1, characterized in that: Before acquiring at least one original steel plate image and inputting the at least one original steel plate image into the steel plate image segmentation model, the method further comprises: Acquire a plurality of sample images, input the plurality of sample images into the SAM model, and acquire a label image corresponding to each of the sample images output by the SAM model; For each of the sample images, a random number and a preset probability value are obtained, and based on the random number and the preset probability value, the sample image and the label image corresponding to the sample image are calculated using the image enhancement algorithm to obtain a sample enhanced image and a label enhanced image, wherein: Wherein, p is the random number, k is the preset probability value, and f t () is the image enhancement algorithm, when I is the sample image, I t is the sample enhanced image; when I is the label image, it is I t The label enhances the image; Performing image enhancement operations on the multiple sample images and the label images corresponding to each of the sample images respectively to obtain multiple sample enhanced images and the label enhanced images corresponding to each of the sample enhanced images, and using the multiple sample enhanced images and the label enhanced images corresponding to each of the sample enhanced images as the image segmentation data set; Dividing the image segmentation dataset into a training dataset and a validation dataset; A preset number of iterative training times and an initial image segmentation model are obtained, and the initial image segmentation model is iteratively trained using the training data set according to the preset number of iterative training times to obtain the steel plate image segmentation model.

3. The method according to claim 2, characterized in that The step of inputting the plurality of sample images into the SAM model and obtaining a label image corresponding to each of the sample images output by the SAM model comprises: For each of the sample images, the image encoder module of the SAM model is used to process the sample image to obtain intermediate features, and the point prompt code corresponding to the sample image is obtained. The prompt encoder module of the SAM model is used to convert the point prompt code into an embedded prompt, and the mask decoder module of the SAM model is used to perform cross-attention calculation on the intermediate features and the embedded prompt to obtain the label image; Obtain a label image corresponding to each of the sample images obtained by performing segmentation processing on each of the sample images by the SAM model.

4. The method according to claim 2, characterized in that: The iterative training of the initial image segmentation model using the training data set according to the preset iterative training times to obtain the steel plate image segmentation model includes: Iteratively training the initial image segmentation model using the training data set according to the preset number of iterative training times, and obtaining the segmentation result output by the initial image segmentation model after each iterative training to obtain multiple segmentation results; Using the verification data set to perform verification calculations on the multiple segmentation results to obtain multiple segmentation indicators; Determining a target segmentation index among the multiple segmentation indexes, wherein the target segmentation index is a segmentation index with the highest value among the multiple segmentation indexes; The target segmentation result corresponding to the target segmentation index is determined from the multiple segmentation results, and the initial image segmentation model after iterative training that outputs the target segmentation result is used as the steel plate image segmentation model.

5. The method according to claim 1, characterized in that The step of performing attention calculation on at least one encoding feature map output by the encoding module based on the attention module to obtain at least one specified feature image includes: For each of the encoded feature maps, the channel attention unit is used to calculate the encoded feature map to obtain a target two-dimensional space map, where: Among them, σ1 is the Softmax activation function, σ0 is the ReLu activation function, ω0 is the first weight of the convolution layer, ω1 is the second weight of the convolution layer, b0 is the first bias of the convolution layer, and b1 is the second bias of the convolution layer. is the feature map after global average pooling, F i is the encoding feature map, GAP() is the global average pooling, Conv() is the convolutional layer, is the element-wise product operation, is the target two-dimensional space map; The encoding feature map is calculated using the spatial attention unit to obtain a specified two-dimensional spatial map, where: Among them, σ1 is the Softmax activation function, σ0 is the ReLu activation function, ω2 is the third weight of the convolution layer, ω3 is the fourth weight of the convolution layer, b2 is the third bias of the convolution layer, and b3 is the fourth bias of the convolution layer. are the feature maps aggregated after global average pooling and maximum pooling, respectively, F i is the encoding feature map, Conv() is the convolution layer, GAP() is the global average pooling, GMP() is the global maximum pooling, is the element-wise product operation, specifying a two-dimensional spatial graph for the said; Aggregating the target two-dimensional space image and the specified two-dimensional space image to obtain the specified feature image; Obtain the at least one specified feature image obtained by processing each of the encoded feature maps by the channel attention unit and the spatial attention unit.

6. The method according to claim 1, characterized in that The step of sending the at least one designated feature image to the decoding module for decoding filling based on the attention module, and performing normalization calculation on at least one decoding feature map output by the decoding module based on the output conversion module to obtain at least one target feature image includes: For each of the specified characteristic images, the multiple decoders of the decoding module are sequentially used to decode the specified characteristic images, and after each of the decoders completes the decoding operation, the upsampling unit of the decoder is used to perform an image filling operation according to a preset image size; Using the multiple decoders to perform decoding and image filling operations on each of the specified feature images to obtain the at least one decoded feature image; Based on the output conversion module, convolution calculation is performed on the at least one decoding feature map to obtain the at least one decoding feature map after convolution; For each of the decoded feature maps after convolution, a normalization calculation is performed on the decoded feature map after convolution based on the output conversion module to obtain a target feature image, wherein: Wherein, x is the pixel value of the decoded feature map after convolution, and S(x) is the target feature image; Obtain the at least one target feature image obtained by the output conversion module performing normalization calculation on each of the decoded feature maps after convolution.

7. The method according to claim 1, characterized in that The step of converting the pixel values ​​of the at least one target feature map using a preset threshold based on the output conversion module to obtain and output at least one steel plate segmentation image comprises: For each of the target feature images, multiple pixel values ​​of the target feature image are read based on the output conversion module, multiple first pixel values ​​less than the preset threshold are obtained from the multiple pixel values, the multiple first pixel values ​​are changed to a value of 0, and multiple second pixel values ​​greater than the preset threshold are obtained from the multiple pixel values, the multiple second pixel values ​​are changed to a value of 1, and the steel plate segmentation image is obtained; The at least one steel plate segmentation image is obtained by the output conversion module performing pixel value conversion on each of the target feature maps.

8. A steel plate image segmentation device for hot rolling process, characterized in that: include: An image input module, used to obtain at least one original steel plate image, and input the at least one original steel plate image into a steel plate image segmentation model, wherein the steel plate image segmentation model is trained using an image segmentation data set obtained based on a SAM model and an image enhancement algorithm, and comprises an input module, an encoding module, an attention module, a decoding module, and an output conversion module; An attention calculation module, used for sending the at least one original steel plate image to the encoding module for encoding based on the input module, performing attention calculation on at least one encoding feature map output by the encoding module based on the attention module, and obtaining at least one designated feature image, wherein the attention module includes a spatial attention unit and a channel attention unit; a normalization calculation module, configured to send the at least one designated feature image to the decoding module for decoding filling based on the attention module, and perform normalization calculation on at least one decoding feature image output by the decoding module based on the output conversion module to obtain at least one target feature image; A pixel value conversion module is used to perform pixel value conversion on the at least one target feature map based on the output conversion module using a preset threshold value to obtain and output at least one steel plate segmentation image.

Citation Information

Patent Citations

  • Medical image segmentation method and system based on double-branch embedded attention mechanism

    CN116309650A

  • Polyp image segmentation method and imaging method based on edge and neighborhood information

    CN117197166A

Cited By

  • Thermal infrared sensor calibration method and device, electronic equipment and storage medium

    CN119915388A