Scrap steel detection method, system, equipment and medium
By extracting feature maps layer by layer and fusing them in stages, the problem of easily missing small targets in scrap steel identification was solved, thus improving the accuracy of identification and detection capabilities.
Patent Information
- Application Number
- CN202510962429.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-14
- Publication Date
- 2025-10-31
AI Technical Summary
Existing technologies are prone to missing small targets when identifying scrap steel, and deep convolutional neural networks lack sufficient data support and background information, which affects the accuracy of identification.
A scrap steel detection method is adopted, which extracts feature maps of different scales layer by layer through the backbone network, and performs staged fusion using a feature enhancement network to generate a multi-scale fused feature map, which is then input into the detection network for target detection.
It improves the accuracy of identifying targets of different scales in scrap steel pile images, reduces missegmentation of large targets, and enhances the detection capability of small and medium-sized targets.
Smart Images

Figure CN120876386A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method, system, device and medium for detecting scrap steel. Background Technology
[0002] Scrap steel refers to steel scraps and waste steel products that cannot be used for their original purpose but can be recycled as raw materials for smelting. Scrap steel inspection refers to determining the type and grade of scrap steel and removing hazardous materials from it. The results of scrap steel inspection directly affect the quality of steel smelting and the profitability of enterprises. Currently, scrap steel inspection generally relies on manual visual inspection, assisted by tools such as vernier calipers when necessary. Simultaneously, sealed components and explosive materials that could affect steelmaking safety are manually removed from the scrap steel pile. In recent years, with the development of deep learning technology, computer vision-based target detection methods have yielded many industrial results, attracting numerous steel companies and research institutes to dedicate themselves to using deep neural networks to solve the problem of scrap steel inspection.
[0003] Currently, some companies have launched scrap steel grading systems based on deep convolutional neural networks (DNNs), achieving decent accuracy under certain conditions. However, these scrap steel inspection methods still have shortcomings and technical deficiencies, specifically: 1) Training deep convolutional neural networks requires a large amount of data. Currently, there is no official large-scale database of scrap steel and sealed component data, leading to poor grading performance of deep convolutional neural networks when data is insufficient; 2) Conventional target detection algorithms used for scrap steel grading and sealed component identification sometimes miss small targets and are also affected by background information. Therefore, there is a need to provide a scrap steel detection method, system, equipment, and medium. Summary of the Invention
[0004] This invention provides a method, system, equipment, and medium for detecting scrap steel, in order to solve the technical problem that small targets are easily missed when identifying scrap steel in the prior art.
[0005] This invention provides a method for detecting scrap steel, the method comprising: acquiring an image of a scrap steel pile to be identified; inputting the scrap steel pile image into the backbone network of a scrap steel detection model, extracting features at different levels from the scrap steel pile image to obtain a first-scale feature map, a second-scale feature map, and a third-scale feature map in sequence; wherein the scales of the first-scale feature map, the second-scale feature map, and the third-scale feature map decrease sequentially; inputting the first-scale feature map, the second-scale feature map, and the third-scale feature map together into the feature enhancement network of the scrap steel detection model, fusing the three-scale feature maps to obtain a first-scale fused feature map, fusing the second-scale feature map and the third-scale feature map, and fusing the second-scale fused feature map with the third-scale feature map to obtain a third-scale fused feature map; inputting the first-scale fused feature map, the second-scale fused feature map, and the third-scale fused feature map into the detection network of the scrap steel detection model to generate detection results for various types of scrap steel in the scrap steel pile image.
[0006] In one embodiment of the present invention, the step of inputting the scrap steel pile image into the backbone network of the scrap steel detection model and performing feature extraction at different levels on the scrap steel pile image to obtain a first-scale feature map, a second-scale feature map, and a third-scale feature map sequentially includes: inputting the scrap steel pile image into the spatial rearrangement module of the backbone network, dividing the scrap steel pile image into a preset number of sub-images, and stitching all the sub-images according to the channel dimension to obtain an initial feature map; wherein, the spatial rearrangement module is a Focus network; inputting the initial feature map into the feature extraction module of the backbone network, performing feature extraction at different levels on the initial feature map to obtain the first-scale feature map, the second-scale feature map, and the third-scale feature map sequentially; wherein, the feature extraction module includes multiple cascaded CSP networks.
[0007] In one embodiment of the present invention, the step of generating the third-scale feature map includes: inputting the second-scale feature map into the deep feature extraction unit of the feature extraction module, extracting features from the second-scale feature map through a CSP network to obtain an initial third-scale feature map; inputting the initial third-scale feature map into the feature aggregation unit of the feature extraction module, performing pooling operations of various different scales on the initial third-scale feature map, and concatenating all pooling results with the initial third-scale feature map to obtain the final third-scale feature map.
[0008] In one embodiment of the present invention, the step of generating the first scale fused feature map includes: inputting the second scale feature map and the third scale feature map into the initial fusion module of the feature enhancement network, fusing the two features, and semantically compressing the fusion result to obtain the initial fused feature map; inputting the initial fused feature map and the first scale feature map into the first fusion module of the feature enhancement network, fusing the two features to obtain the first scale fused feature map.
[0009] In one embodiment of the present invention, the step of generating the second scale fusion feature map includes: inputting the initial fusion feature map and the first scale fusion feature map into the second fusion module of the feature enhancement network to obtain the second scale fusion feature map.
[0010] In one embodiment of the present invention, the step of generating the third-scale fused feature map includes: inputting the second-scale fused feature map and the third-scale feature map into the third fusion module of the feature enhancement network to obtain the third-scale fused feature map.
[0011] In one embodiment of the present invention, the step of inputting the first-scale fused feature map, the second-scale fused feature map, and the third-scale fused feature map into the detection network of the scrap steel detection model to generate the detection result of scrap steel in the scrap steel pile image includes: inputting the first-scale fused feature map into the first detection module of the detection network to perform target detection and identify the first scrap steel target and its corresponding scrap steel grade in the scrap steel pile image; inputting the second-scale fused feature map into the second detection module of the detection network to perform target detection and identify the second scrap steel target and its corresponding scrap steel grade in the scrap steel pile image; inputting the third-scale fused feature map into the third detection module of the detection network to perform target detection and identify the third scrap steel target and its corresponding scrap steel grade in the scrap steel pile image; and summarizing the first, second, and third scrap steel targets and their corresponding scrap steel grades identified in the scrap steel pile image to obtain the detection result of scrap steel in the scrap steel pile image.
[0012] This invention also provides a scrap steel detection system, comprising: an image acquisition module for acquiring an image of a scrap steel pile to be identified; a feature extraction module for inputting the scrap steel pile image into the backbone network of a scrap steel detection model, performing feature extraction at different levels on the scrap steel pile image, and sequentially obtaining a first-scale feature map, a second-scale feature map, and a third-scale feature map; wherein the scales of the first-scale feature map, the second-scale feature map, and the third-scale feature map decrease sequentially; a fusion module for inputting the first-scale feature map, the second-scale feature map, and the third-scale feature map together into the feature enhancement network of the scrap steel detection model, fusing the three scale feature maps to obtain a first-scale fused feature map, fusing the second-scale feature map and the third-scale feature map, and fusing the second-scale fused feature map with the third-scale feature map to obtain a third-scale fused feature map; and a recognition module for inputting the first-scale fused feature map, the second-scale fused feature map, and the third-scale fused feature map into the detection network of the scrap steel detection model, and generating detection results for various types of scrap steel in the scrap steel pile image.
[0013] The present invention also provides an electronic device, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device enables the scrap steel detection method described above.
[0014] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer processor, causes the computer to perform any of the above-described scrap steel detection methods.
[0015] The beneficial effects of this invention are as follows: This invention proposes a method, system, device, and medium for detecting scrap steel. The method inputs an image of a scrap steel pile into a backbone network, extracting feature maps of different scales layer by layer, thereby effectively capturing multi-level feature information in the image. A staged fusion strategy is employed through a feature enhancement network. First, the third-scale feature map is initially fused with the second-scale feature map to improve the model's detection capability for small and medium-sized targets. Then, the fusion result is fused with the first-scale feature map to integrate global semantic features and local features in the image. The resulting three fused feature maps of different scales comprehensively cover scrap steel targets of different scales, shapes, and materials in the image. By inputting the three fused feature maps of different scales into corresponding detection networks, the detection results can be adaptively output for targets of different scales. This prevents large targets from being mis-segmented and improves the model's ability to recognize small and medium-sized targets, thereby greatly improving the model's accuracy in recognizing different targets in scrap steel pile images. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0017] In the attached diagram:
[0018] Figure 1 This is a schematic flowchart of a scrap steel detection method provided in an embodiment of the present invention;
[0019] Figure 2 This is a schematic diagram of the scrap steel detection model;
[0020] Figure 3 for Figure 2 A schematic diagram of the basic convolutional module;
[0021] Figure 4 for Figure 2 A schematic diagram of the structure of the Focus network;
[0022] Figure 5 for Figure 2 A schematic diagram of the structure of a SPP network;
[0023] Figure 6 This is a structural block diagram of a scrap steel detection system provided in one embodiment of the present invention;
[0024] Figure 7 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation
[0025] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0026] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. The drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0027] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.
[0028] This invention provides a method for detecting scrap steel. An image of a scrap steel pile is input into a backbone network, and feature maps of different scales are extracted layer by layer, effectively capturing multi-level feature information in the image. A phased fusion strategy is employed through a feature enhancement network. First, the third-scale feature map and the second-scale feature map are initially fused to improve the model's detection capability for small and medium-sized targets. Then, the fused result is fused with the first-scale feature map to integrate global semantic features and local features in the image. The resulting three fused feature maps at different scales comprehensively cover scrap steel targets of different scales, shapes, and materials in the image. By inputting the three fused feature maps at different scales into corresponding detection networks, the detection results are adaptively output for targets of different scales. This prevents large targets from being mis-segmented and improves the model's ability to recognize small and medium-sized targets, thus greatly enhancing the model's recognition performance for different targets in scrap steel pile images. This invention addresses the shortcomings of current manual scrap steel detection and deep convolutional neural network-based scrap steel detection by using image morphology-based data augmentation methods to expand the data and reduce the time cost of data collection in the early stages of training. By adding an output tensor to the network structure and optimizing the loss function, the perception of foreground targets in scrap steel data is enhanced, thereby improving the recall rate of small-sized scrap steel and doped sealed components.
[0029] like Figure 1 As shown, the method for detecting scrap steel includes the following steps:
[0030] S11. Obtain an image of the scrap steel pile to be identified.
[0031] Images of scrap steel piles can be acquired by deploying industrial cameras, surveillance cameras, or dedicated image sensors at the work site. These images are three-channel RGB color images containing various steel products of different materials, sizes, and corrosion states, such as reinforcing bars, structural steel, and scrap components. Furthermore, the images may also contain potentially hazardous enclosed components such as sealed containers and oil drums. Enclosed components refer to metal parts that are surface-sealed and cannot be naturally ventilated or have their internal contents evacuated. Although these components may not appear significantly different from ordinary scrap steel, they may contain residual flammable and explosive gases. This invention aims to identify different types of scrap steel in scrap steel pile images and determine their grade. In addition, it can automatically identify enclosed components in scrap steel piles, thereby improving the safety of scrap steel handling operations.
[0032] S12. Input the image of the scrap steel pile into the backbone network of the scrap steel detection model, and perform feature extraction at different levels on the image of the scrap steel pile to obtain a first-scale feature map, a second-scale feature map and a third-scale feature map in sequence; wherein the scales of the first-scale feature map, the second-scale feature map and the third-scale feature map decrease sequentially.
[0033] The structure of the scrap steel detection model is as follows: Figure 2 As shown, CSPDarknet is used as the backbone network, FPN and PAN are used as feature enhancement networks, and finally three detector heads are connected to predict scrap steel detection. The scrap steel pile image is input into the backbone network, and layer-by-layer feature extraction is performed through multiple feature extraction units to obtain first-scale feature maps, second-scale feature maps, and third-scale feature maps. The spatial size of these three feature maps decreases sequentially, but the semantic features are progressively enhanced. The first-scale feature map has global semantic features and is suitable for performing coarse-grained target classification to identify large-sized scrap steel. The second-scale feature map is at a medium receptive field level, possessing both global and fine-grained features, and is suitable for identifying medium-sized scrap steel, such as rebar, structural steel, and plates. The third-scale feature map retains more fine-grained spatial information and is more suitable for identifying smaller targets, such as hazardous components like sealed parts.
[0034] In an optional embodiment of the present invention, step S12 includes the following process: inputting the scrap steel pile image into the spatial rearrangement module of the backbone network, dividing the scrap steel pile image into a preset number of sub-images, and stitching all the sub-images according to the channel dimension to obtain an initial feature map; wherein, the spatial rearrangement module is a Focus network; inputting the initial feature map into the feature extraction module of the backbone network, performing feature extraction at different levels on the initial feature map, and sequentially obtaining the first scale feature map, the second scale feature map, and the third scale feature map; wherein, the feature extraction module includes multiple cascaded CSP networks.
[0035] Specifically, the acquired images of the scrap steel pile are input into a spatial rearrangement module, which is a Focus network. This module divides the scrap steel pile image along both the height and width directions with a preset stride (e.g., 2), resulting in a preset number of sub-images (e.g., 4). All the sub-images are then stitched together along the channel dimension, compressing the spatial size and increasing the number of channels while maintaining image information integrity, thus generating an initial feature map. This initial feature map is then input into a feature extraction module, which includes multiple cascaded CSP (Cross Stage Partial) networks. The input feature map is divided into a first initial feature map and a second initial feature map along the channel dimension. The first initial feature map is then processed layer by layer through a preset number of standard convolutional units (including convolutional layers, normalization layers, and activation functions) for feature extraction. The image feature map extracted by the last standard convolutional unit and the second initial feature map are then stitched together along the channel dimension to obtain the output feature map. For the first CSP network, its input feature map is the initial feature map; for each of the remaining CSP networks, its input feature map is the output feature map of the previous CSP network. Features are extracted layer by layer in the manner described above, and the outputs of the three CSP networks are selected as the first-scale feature map, the second-scale feature map, and the third-scale feature map, respectively. Preferably, the output of the last CSP network is used as the third-scale feature map.
[0036] In an optional embodiment of the present invention, the step of generating the third-scale feature map includes: inputting the second-scale feature map into the deep feature extraction unit of the feature extraction module, extracting features from the second-scale feature map through a CSP network to obtain an initial third-scale feature map; inputting the initial third-scale feature map into the feature aggregation unit of the feature extraction module, performing pooling operations of various different scales on the initial third-scale feature map, and concatenating all pooling results with the initial third-scale feature map to obtain the final third-scale feature map.
[0037] The second-scale feature map is input into a deep feature extraction unit, where it undergoes feature compression and semantic enhancement via at least one CSP network to obtain an initial third-scale feature map. This initial third-scale feature map is then input into a feature aggregation unit, which employs a spatial pyramid pooling structure to perform max pooling operations at various preset scales (e.g., 5×5, 9×9, 13×13) on the initial third-scale feature map to capture contextual information within different receptive fields. All pooling results are concatenated and fused with the original feature map along the channel dimension to further enhance the perception capability for targets at different scales, thus forming the final third-scale feature map.
[0038] S13. Input the first-scale feature map, the second-scale feature map, and the third-scale feature map into the feature enhancement network of the scrap steel detection model. Fuse the three-scale feature maps to obtain a first-scale fused feature map. Then fuse the second-scale feature map and the third-scale feature map with the first-scale fused feature map to obtain a second-scale fused feature map. Finally, fuse the second-scale fused feature map with the third-scale feature map to obtain a third-scale fused feature map.
[0039] In one embodiment of the present invention, the first-scale feature map can be downsampled, and the third-scale feature map can be upsampled, so that the scale of the processed maps is consistent with that of the second-scale feature map. The upsampled third-scale feature map, the downsampled first-scale feature map, and the original second-scale feature map are then compared. Figure 3 Feature fusion is performed on the first scale feature map to obtain a first-scale fused feature map. The upsampled third-scale feature map and the original second-scale feature map are then fused to obtain a fused feature map. The first-scale fused feature map is downsampled to match the scale of the fused feature map, and this fused feature map is then fused again with the downsampled first-scale fused feature map to obtain a second-scale fused feature map. Similarly, the downsampled second-scale fused feature map and the third-scale feature map are fused to obtain a third-scale fused feature map.
[0040] In an optional embodiment of the present invention, the step of generating the first-scale fused feature map includes: inputting the second-scale feature map and the third-scale feature map into the initial fusion module of the feature enhancement network, fusing the two features, and semantically compressing the fusion result to obtain the initial fused feature map; inputting the initial fused feature map and the first-scale feature map into the first fusion module of the feature enhancement network, fusing the two features to obtain the first-scale fused feature map. This first-scale fused feature map has global perception capabilities, which helps improve the accuracy of identifying large or structurally complex scrap steel targets, and is suitable for structural analysis of coarse-grained or integral components.
[0041] Specifically, the second-scale feature map and the third-scale feature map output from the backbone network are input into the initial fusion module in the feature enhancement network. This module aligns the spatial dimensions of the third-scale feature map with the second-scale feature map through upsampling, and then fuses the two features through feature concatenation and convolution. The fused result is further processed through semantic compression operations (such as 1×1 convolution or channel compression) to obtain a highly integrated initial fused feature map.
[0042] The initial fused feature map and the first-scale feature map are input together into the first fusion module of the feature enhancement network. In this module, spatial and semantic information is effectively integrated from the two feature maps from different sources using feature alignment and fusion mechanisms.
[0043] In an optional embodiment of the present invention, the step of generating the second-scale fused feature map includes: inputting the initial fused feature map and the first-scale fused feature map into the second fusion module of the feature enhancement network to obtain the second-scale fused feature map.
[0044] The initial fused feature map obtained above and the first-scale fused feature map are input together into the second fusion module. This module performs spatial alignment and feature fusion operations on the two input feature maps. For example, it unifies the resolution by upsampling or downsampling and then concatenates the features. Then, it uses convolution operations to perform semantic integration and channel compression on the fused feature map, thereby obtaining the second-scale fused feature map. The second-scale fused feature map combines the local detail information in the first-scale features with the mid-to-high-level semantic information in the initial fused features, which helps to enhance the model's ability to perceive medium-sized targets (such as structurally intact scrap steel components).
[0045] In an optional embodiment of the present invention, the step of generating the third-scale fused feature map includes: inputting the second-scale fused feature map and the third-scale feature map into the third fusion module of the feature enhancement network to obtain the third-scale fused feature map.
[0046] The second-scale fused feature map generated above and the third-scale feature map output by the backbone network are input into this module. To achieve effective fusion, the third fusion module spatially aligns the two feature maps (e.g., by adjusting the resolution of the second-scale fused feature map to match the third-scale feature map through downsampling), and performs deep fusion using operations such as feature concatenation and convolutional integration to generate the final third-scale fused feature map. This third-scale fused feature map possesses both low-level details and high-level semantic information, providing more comprehensive feature support for subsequent small target detection (such as closed component recognition).
[0047] S14. Input the first scale fusion feature map, the second scale fusion feature map and the third scale fusion feature map into the detection network of the scrap steel detection model to generate the detection result of scrap steel in the scrap steel pile image.
[0048] In an optional embodiment of the present invention, step S14 includes the following process: inputting the first scale fusion feature map into the first detection module of the detection network to perform target detection, and identifying the first scrap steel target and its corresponding scrap steel grade in the scrap steel pile image; inputting the second scale fusion feature map into the second detection module of the detection network to perform target detection, and identifying the second scrap steel target and its corresponding scrap steel grade in the scrap steel pile image; inputting the third scale fusion feature map into the third detection module of the detection network to perform target detection, and identifying the third scrap steel target and its corresponding scrap steel grade in the scrap steel pile image; summarizing the first scrap steel target, second scrap steel target, and third scrap steel target identified in the scrap steel pile image and their corresponding scrap steel grades to obtain the detection result of scrap steel in the scrap steel pile image.
[0049] The resulting first-scale fused feature map is input into the first detection module of the detection network. This module is mainly responsible for identifying relatively large scrap steel targets in the image, such as whole steel components or large steel sections, and predicting their corresponding scrap steel grade based on the semantic information in the feature map. Similarly, the second-scale fused feature map is input into the second detection module, which focuses on identifying medium-sized targets in the image, such as broken steel bars and short steel pipes, and outputs their location and grade. The third-scale fused feature map is input into the third detection module to detect the smallest but most easily overlooked scrap steel targets in the image, especially hazardous components such as sealed parts, oil drums, and batteries, and provides their category and risk level. The three detection modules perform target detection operations on the fused feature maps of different scales, and independently output the detection results at the corresponding scale, including the location coordinates, category label, and scrap steel grade information of each target. By uniformly summarizing the output results of the first, second, and third detection modules, a complete scrap steel pile image detection result is integrated to support subsequent business operations such as classification and recycling, grade assessment, or hazardous material removal.
[0050] It is understandable that the dataset used to train the scrap steel detection model is obtained by data augmentation of the original scrap steel pile image set. Specifically, the original scrap steel pile image set can be obtained through relevant units or self-construction. Geometric data augmentation is then performed on these scrap steel pile images to increase the data volume. Geometric data augmentation includes, but is not limited to, traditional geometric methods such as mirroring, random cropping, and image flipping. This method achieves an initial expansion of the scrap steel pile image set. Considering that there may still be scrap steel pile images with a small amount of data in the image set, a second augmentation using the Mosaic image augmentation method is performed on these images, based on the previous data augmentation. This involves stitching together four images by randomly scaling, cropping, and arranging them to achieve the purpose of data expansion. Afterwards, data annotation is performed under the guidance of experts and with the support of relevant materials. After annotation, a random allocation method is used to divide all data into training, validation, and test sets in a 4:1:1 ratio, and they are stored in three separate folders.
[0051] During data annotation, existing data annotation tools (such as Labelimg) or self-made annotation tools can be used to annotate all data in the three folders. The label data for each image is stored in txt format, and the label for each detected object is represented by five data points: c, x, y, w, and d. These five data points represent the category of the detected object, the relative x and y coordinates of the center point, and the length and width of the rectangular selection area, respectively. All label files are stored in three separate folders corresponding to the training, validation, and test sets.
[0052] It should be noted that this application comprehensively considers the overlap area between the predicted bounding box and the labeled bounding box, the distance between the center points, and the consistency of the aspect ratio. Therefore, when training the scrap steel detection model, the loss function is: in, CIOU_Loss is the CIoU loss, IOU is the intersection-over-union ratio between the predicted bounding boxes and the ground truth bounding boxes of the detected targets in the scrap pile image, and d 2 c is the square of the Euclidean distance between the center point of the predicted bounding box and the center point of the ground truth bounding box. 2 The sum of the squares of the diagonal lengths of the smallest bounding rectangles of the predicted and ground truth boxes, where v is the aspect ratio consistency coefficient between the predicted and ground truth boxes, and w is the sum of the squares of the diagonal lengths of the bounding rectangles of the predicted and ground truth boxes. gt h is the width of the actual bounding box. gt w is the height of the actual bounding box p h is the width of the prediction box. p This represents the height of the predicted bounding box.
[0053] like Figure 2As shown, the input image is a 640×640, 3-channel RGB image of a scrap metal pile. A Focus network is used for spatial rearrangement, dividing the image into four sub-images, which are then stitched together by channel, compressing the spatial size to 320×320 and expanding the number of channels to 12. The Conv2D_BN_SiLU network is then used to extract basic features using convolution, BatchNorm, and SiLU activation functions, maintaining the image scale while expanding the number of channels to 64. From Conv2D_BN_SiLU(160,160,128) to CSPrayer(160,160,128), downsampling and the CSP network further enhance semantic expression, changing the image scale to 160×160 and expanding the number of channels to 128. Similarly, the Resblock_body_2 and Resblock_body_3 modules are used to output the first and second scale feature maps, respectively. The Resblock_body_4 module utilizes deep feature extraction and spatial pyramid pooling to obtain a third-scale feature map. Then, feature fusion (i.e., FPN+PANet structure) is used to enhance the feature maps at different scales. Through Conv2D+upsampling+Concat+CSPLayer+Conv2D, the third-scale feature map is upsampled, concatenated and fused with the second-scale feature map. The first-scale feature map is then concatenated and fused again with the previous fusion result. Using the YOLO detection head, an 80×80×3 scale first-scale fused feature map is obtained to detect large targets. The result of the previous two fusions is concatenated and fused a third time with the previous fusion result. Using the YOLO detection head, a 40×40×3 scale second-scale fused feature map is obtained to detect medium-scale targets. Using a similar method, a 20×20×3 scale third-scale fused feature map is obtained to detect small-scale targets.
[0054] Figure 3 for Figure 2 The Conv2D_BN_SiLU basic convolutional module extracts local features of the input information through the Conv Layer, accelerates convergence and stabilizes training through the Batch Normalization Layer (BN Layer), and replaces the traditional ReLU with the SiLU activation layer to improve the model's recognition accuracy of weak features such as blurred edges and corrosion of scrap steel. Figure 4 for Figure 2 The Focus network in this model divides the original input image into four feature maps by taking one sub-pixel from every other pixel. These feature maps are then concatenated along the channel dimension, halving the spatial size of the entire feature map and quadrupling the number of channels, resulting in a 320×320 feature map with 12 channels. This approach balances spatial compression and information preservation, maintaining the structural integrity of the scrap steel image and facilitating subsequent multi-scale learning. Figure 5 for Figure 2 The SPP network in the model applies max pooling of different sizes (5, 9, 13) to the input feature map, and then convolves and fuses the pooling results with the original feature map to provide a multi-scale receptive field and enhance the model's ability to recognize scrap steel targets of different sizes such as large, small, and long strips.
[0055] like Figure 6 As shown, the scrap steel detection system 600 includes: an image acquisition module 610, a feature extraction module 620, a fusion module 630, and a recognition module 640. The image acquisition module 610 acquires an image of the scrap steel pile to be identified. The feature extraction module 620 inputs the scrap steel pile image into the backbone network of the scrap steel detection model, extracting features at different levels to obtain a first-scale feature map, a second-scale feature map, and a third-scale feature map sequentially; wherein the scales of the first-scale feature map, the second-scale feature map, and the third-scale feature map decrease sequentially. The fusion module 630 inputs the first-scale feature map, the second-scale feature map, and the third-scale feature map into the feature enhancement network of the scrap steel detection model, fusing the three scale feature maps to obtain a first-scale fused feature map; fusing the second-scale feature map and the third-scale feature map, and then fusing them with the first-scale fused feature map to obtain a second-scale fused feature map; finally, fusing the second-scale fused feature map with the third-scale feature map to obtain a third-scale fused feature map. The recognition module 640 is used to input the first scale fusion feature map, the second scale fusion feature map and the third scale fusion feature map into the detection network of the scrap steel detection model to generate the detection results of various types of scrap steel in the scrap steel pile image.
[0056] Specific limitations regarding the scrap steel detection system can be found in the limitations on scrap steel detection methods described above, and will not be repeated here. Each module in the aforementioned scrap steel detection system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware format within or independently of the processor in a computer device, or stored in software format in the memory of a computer device, allowing the processor to call the corresponding operations of each module.
[0057] It should be noted that, in order to highlight the innovative aspects of this invention, this embodiment does not include modules that are not closely related to solving the technical problems proposed by this invention, but this does not mean that there are no other modules in this embodiment.
[0058] like Figure 7 As shown, the electronic device 7 may include a memory 71, a processor 72 and a bus, and may also include a computer program stored in the memory 71 and executable on the processor 72, such as a scrap steel detection program.
[0059] The memory 71 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 71 can be an internal storage unit of the electronic device 7, such as a portable hard drive. In other embodiments, the memory 71 can be an external storage device of the electronic device 7, such as a plug-in portable hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 7. Furthermore, the memory 71 can include both internal and external storage units of the electronic device 7. The memory 71 can be used not only to store application software and various types of data installed on the electronic device 7, such as scrap metal detection codes, but also to temporarily store data that has been output or will be output.
[0060] In some embodiments, the processor 72 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits packaged with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 72 is the control unit of the electronic device 7, connecting various components of the entire electronic device 7 via various interfaces and lines. It executes programs or modules stored in the memory 71 (e.g., scrap metal detection programs) and calls data stored in the memory 71 to perform various functions and process data in the electronic device 7.
[0061] The processor 72 executes the operating system of the electronic device 7 and various installed application programs. The processor 72 executes the application programs to implement the steps in the above-described scrap steel detection method.
[0062] For example, a computer program can be divided into one or more modules, one or more of which are stored in memory 71 and executed by processor 72 to complete this application. One or more modules can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in electronic device 7. For example, the computer program can be divided into an image acquisition module 610, a feature extraction module 620, a fusion module 630, and a recognition module 640.
[0063] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium, which can be non-volatile or volatile. The software functional module, stored in the storage medium, includes several instructions to cause a computer device (which may be a personal computer, computer equipment, or network device, etc.) or processor to execute some functions of the scrap steel detection methods of the various embodiments of this application.
[0064] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A method for detecting scrap steel, characterized in that, The method includes: Acquire images of the scrap steel pile to be identified; The image of the scrap steel pile is input into the backbone network of the scrap steel detection model, and features are extracted from the image of the scrap steel pile at different levels to obtain a first-scale feature map, a second-scale feature map, and a third-scale feature map in sequence; wherein the scales of the first-scale feature map, the second-scale feature map, and the third-scale feature map decrease sequentially. The first-scale feature map, the second-scale feature map, and the third-scale feature map are input into the feature enhancement network of the scrap steel detection model. The three-scale feature maps are fused to obtain the first-scale fused feature map. The second-scale feature map and the third-scale feature map are fused together and then fused with the first-scale fused feature map to obtain the second-scale fused feature map. The second-scale fused feature map is then fused with the third-scale feature map to obtain the third-scale fused feature map. The first-scale fusion feature map, the second-scale fusion feature map, and the third-scale fusion feature map are input into the detection network of the scrap steel detection model to generate detection results for various types of scrap steel in the scrap steel pile image.
2. The method for detecting scrap steel according to claim 1, characterized in that, The process involves inputting the image of the scrap steel pile into the backbone network of the scrap steel detection model, and extracting features from the image at different levels to obtain a first-scale feature map, a second-scale feature map, and a third-scale feature map, including: The image of the scrap steel pile is input into the spatial rearrangement module of the backbone network, which divides the scrap steel pile image into a preset number of sub-images and stitches all the sub-images together according to the channel dimension to obtain an initial feature map; wherein, the spatial rearrangement module is a Focus network; The initial feature map is input into the feature extraction module of the backbone network, and features are extracted from the initial feature map at different levels to obtain the first scale feature map, the second scale feature map and the third scale feature map in sequence; wherein, the feature extraction module includes multiple cascaded CSP networks.
3. The method for detecting scrap steel according to claim 2, characterized in that, The steps for generating the third-scale feature map include: The second-scale feature map is input into the deep feature extraction unit of the feature extraction module, and the CSP network is used to extract features from the second-scale feature map to obtain the initial third-scale feature map. The initial third-scale feature map is input into the feature aggregation unit of the feature extraction module. Pooling operations of various scales are performed on the initial third-scale feature map, and all pooling results are concatenated with the initial third-scale feature map to obtain the final third-scale feature map.
4. The method for detecting scrap steel according to claim 1, characterized in that, The steps for generating the first scale-fused feature map include: The second-scale feature map and the third-scale feature map are input into the initial fusion module of the feature enhancement network, the two are fused, and the fusion result is semantically compressed to obtain the initial fused feature map; The initial fused feature map and the first scale feature map are input into the first fusion module of the feature enhancement network, and the two are fused to obtain the first scale fused feature map.
5. The method for detecting scrap steel according to claim 4, characterized in that, The step of generating the second-scale fused feature map includes: inputting the initial fused feature map and the first-scale fused feature map into the second fusion module of the feature enhancement network to obtain the second-scale fused feature map.
6. The method for detecting scrap steel according to claim 5, characterized in that, The step of generating the third-scale fused feature map includes: inputting the second-scale fused feature map and the third-scale feature map into the third fusion module of the feature enhancement network to obtain the third-scale fused feature map.
7. The method for detecting scrap steel according to claim 1, characterized in that, The step of inputting the first-scale fused feature map, the second-scale fused feature map, and the third-scale fused feature map into the detection network of the scrap steel detection model to generate the detection results of scrap steel in the scrap steel pile image includes: The first scale fusion feature map is input into the first detection module of the detection network to perform target detection, and the first scrap steel target and its corresponding scrap steel grade in the scrap steel pile image are identified. The second scale fusion feature map is input into the second detection module of the detection network to perform target detection, and the second scrap steel target and its corresponding scrap steel grade in the scrap steel pile image are identified. The third-scale fused feature map is input into the third detection module of the detection network to perform target detection, thereby identifying the third scrap steel target and its corresponding scrap steel grade in the scrap steel pile image; The detection results of scrap steel in the scrap steel pile image are obtained by summarizing the first scrap steel target, the second scrap steel target, and the third scrap steel target identified in the scrap steel pile image, as well as the corresponding scrap steel grade.
8. A scrap steel detection system, characterized in that, The system includes: The image acquisition module is used to acquire images of the scrap steel pile to be identified; The feature extraction module is used to input the scrap steel pile image into the backbone network of the scrap steel detection model, and to extract features from the scrap steel pile image at different levels, thereby obtaining a first-scale feature map, a second-scale feature map, and a third-scale feature map in sequence; wherein the scales of the first-scale feature map, the second-scale feature map, and the third-scale feature map decrease sequentially. The fusion module is used to input the first-scale feature map, the second-scale feature map, and the third-scale feature map into the feature enhancement network of the scrap steel detection model, fuse the three-scale feature maps to obtain a first-scale fused feature map, fuse the second-scale feature map and the third-scale feature map, and then fuse the second-scale fused feature map with the first-scale fused feature map to obtain a second-scale fused feature map, and finally fuse the second-scale fused feature map with the third-scale feature map to obtain a third-scale fused feature map. The recognition module is used to input the first-scale fused feature map, the second-scale fused feature map and the third-scale fused feature map into the detection network of the scrap steel detection model to generate the detection results of various types of scrap steel in the scrap steel pile image.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the scrap steel detection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by the computer's processor, causes the computer to perform the scrap steel detection method according to any one of claims 1 to 7.