Flat material surface quality detection method and device based on lightweight significance detection model and medium
By building a lightweight saliency detection model and adopting scale-adaptive feature extraction and multi-scale feature interaction, the problems of large model size and insufficient real-time performance in existing technologies are solved, and efficient and fast surface defect detection is achieved, which is suitable for industrial production lines.
Patent Information
- Application Number
- CN202511122125.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-08-12
AI Technical Summary
Existing saliency detection algorithms in industrial production have problems such as bloated model size, insufficient real-time performance and low detection accuracy, making it difficult to meet the needs of high-speed detection.
A lightweight saliency detection model is designed, which adopts a scale-adaptive feature extraction module and a multi-scale feature interaction mechanism. Combined with a deep supervision strategy, a lightweight backbone network is constructed. Through dynamic weight allocation and multi-scale feature aggregation, fast and high-precision surface defect detection is achieved.
It achieves an inference speed of 62fps and efficient feature extraction while maintaining a lightweight architecture, improving adaptability and detection accuracy for defects of different scales, and meeting the real-time detection needs of industrial production lines.
Smart Images

Figure CN120635076A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a flat material surface quality detection method, device and medium based on a lightweight saliency detection model. Background Art
[0002] With the rapid development of modern industrial manufacturing technology, flat steel, as an important basic industrial material, is widely used in key areas such as construction, automobiles, ships, aerospace, and home appliance manufacturing. Its surface quality directly affects the structural safety, service life, and appearance of the product. For example, in the production of automotive steel plates, surface scratches or rust can lead to defects in the subsequent coating process and even cause structural corrosion. In the application of metal foil materials for precision electronic components, slight deformations or cracks can cause serious problems such as circuit short circuits. Therefore, flat steel surface quality inspection is a key link in ensuring product qualification during industrial production, and is of great significance for improving production efficiency and reducing manufacturing costs.
[0003] In recent years, with the advancement of intelligent manufacturing, traditional inspection methods that rely on manual vision have been unable to meet the high-speed, high-precision inspection requirements of modern production lines. There is an urgent need to achieve efficient identification and location of surface defects through automated and intelligent technologies. Among existing technologies, computer vision-based inspection technologies have gradually emerged. Early methods mostly used traditional image processing algorithms such as threshold segmentation and edge detection. However, these methods are sensitive to changes in lighting and surface texture interference, have poor generalization capabilities, and are difficult to adapt to complex industrial scenarios. In recent years, with the development of deep learning technology, saliency detection algorithms based on convolutional neural networks (CNNs) have been widely used in surface defect detection. The core idea is to automatically learn defect features through deep learning models to achieve segmentation and location of salient targets.
[0004] Currently, most saliency detection algorithms use deep networks such as VGG, ResNet, and Transformer as their backbone architecture. Typical solutions, such as CPD and U2Net models, extract multi-level features through backbone networks such as VGG / ResNet and use feature pyramids to fuse deep semantic information, achieving a high defect recall rate in laboratory environments. At the same time, the Transformer-based PFSNet further introduces a self-attention mechanism to further improve positioning accuracy in complex texture backgrounds.
[0005] However, these methods have exposed serious flaws in actual industrial deployment: on the one hand, the number of parameters in backbone networks such as VGG often exceeds 130M, resulting in bloated model size and its storage requirements exceeding the carrying capacity of embedded devices; on the other hand, industrial production lines have strict requirements on detection speed. For example, the operating speed of cold-rolled steel plate production lines can reach hundreds of meters per minute, requiring the detection system to have a processing capacity of tens of frames per second (fps). Complex structures such as ResNet usually take more than 80ms to infer a single frame, which cannot meet real-time detection requirements and can easily cause detection delays or data backlogs; in addition, although some models have reduced the number of parameters through lightweight design, over-simplification has led to insufficient feature extraction capabilities, poor adaptability to defects of different scales and shapes, and a significant decrease in detection accuracy.
[0006] Therefore, there is an urgent need for a model that takes into account lightweight, real-time performance and detection accuracy to solve the above problems. Summary of the Invention
[0007] The present invention overcomes the shortcomings of the existing technology and provides a flat material surface quality detection method, equipment and medium based on a lightweight saliency detection model. By designing a lightweight saliency detection model that takes into account both detection effect and real-time performance, the surface quality of flat materials can be accurately detected, thereby compensating for the defect that the real-time performance of the existing method cannot meet the actual industrial detection needs.
[0008] To achieve the above objectives, the present invention adopts the following technical solutions: In a first aspect, an embodiment of the present invention provides a method for detecting the surface quality of flat materials based on a lightweight saliency detection model, comprising the following steps: S1. Label the flat material surface damage dataset and divide it into training set and test set; S2. Build a lightweight saliency detection model, which consists of a bottom-up encoder, a top-down decoder, and a lateral connection between the encoder and the decoder; S3. Construct a loss function and use a deep supervision strategy to generate predictions for the output feature maps of each stage of the decoder and calculate the loss; S4. Use the training set to train the detection model, using the Adam optimizer and the poly learning rate decay strategy; S5. Normalize the test set image, input it into the detection model, and infer the saliency map of the surface defects.
[0009] In a preferred embodiment of the present invention, in step S2, the encoder is constructed with a scale-adaptive feature extraction module SAFE as a basic unit, comprising five stages {E1, E2, E3, E4, E5}, with a different number of SAFE modules stacked in each stage; depthwise separable convolution is used between stages to adjust the number of channels and feature map size; the SAFE module includes a multi-scale feature interaction module MFI and a dynamic selection module DS.
[0010] In a preferred embodiment of the present invention, the MFI module implements feature interaction through the following steps: S21, using multiple depth-separable convolutions with different expansion rates to input feature maps Process and obtain N Branch feature graph ;in, C , H , W are the number of channels, height and width respectively; R is a set of real numbers; ; S22, yes After 3×3 average pooling operation, the residual connection is connected with Add, accumulate the output feature maps of each branch element by element to obtain the feature map , and input to the DS module.
[0011] In a preferred embodiment of the present invention, the DS module dynamically assigns feature weights through the following steps: S211, feature map Perform 3×3 convolution processing, input the dynamic measurement submodule DMM, extract the global context information of the channel dimension through global average pooling, and embed the learnable vector ; S212, will Z Input the multi-layer perceptron to calculate the dynamic attention weight of each branch And multiply it with the corresponding branch feature by channel and accumulate it pixel by pixel, and output the SAFE module result by combining the residual connection ;in, FC ( Z ) represents the fully connected layer processing of vector Z; ReLU Express FC ( Z )’s output is processed by nonlinear activation function; FC Express ReLU The output of is processed by the second fully connected layer; It means that the output of the final fully connected layer is normalized; It is the result of the DS module fusing dynamic attention weight allocation with multi-branch features.
[0012] In a preferred embodiment of the present invention, the number of SAFE modules in each stage of the encoder is: 1 each in E1 and E2 stages, 3 each in E3 and E5 stages, and 6 in E4 stage.
[0013] In a preferred embodiment of the present invention, in step S2, the decoder is constructed based on a multi-scale feature aggregation module MFA, including a feature fusion module and an MFA module; the feature fusion module integrates encoder features, pyramid pooling module output features and upsampling features, and performs depth-separable convolution processing.
[0014] In a preferred embodiment of the present invention, the MFA module implements cross-scale aggregation through the following steps: S2111, divide the input features into 4 parts by channel , , using the expansion rate Depthwise separable convolution extracts feature maps ; S2112, establish element-by-element addition between different branches through residual connection to generate decoder output feature map .
[0015] In a preferred embodiment of the present invention, in step S3, the loss function adopts a deep supervision strategy to output feature maps at each stage of the decoder. Generate predictions through 1×1 convolution and sigmoid activation function , the loss function is defined as: ;in, is the standard cross entropy loss function; is the annotated saliency image; is the weight coefficient.
[0016] In a second aspect, an embodiment of the present invention provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; The memory stores a computer program executed by at least one of the processors, and the computer program is executed by at least one of the processors so as to enable the at least one processor to execute any one of the aforementioned methods for detecting surface quality of flat materials based on a lightweight saliency detection model.
[0017] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer instructions, which are used to enable a processor to implement any of the aforementioned methods for detecting surface quality of flat materials based on a lightweight saliency detection model when executed.
[0018] The present invention solves the defects existing in the background technology and has the following beneficial effects: (1) The present invention provides a method, device and medium for detecting the surface quality of flat materials based on a lightweight saliency detection model. By constructing a lightweight backbone network with a scale-adaptive feature extraction module as the core and combining multi-scale feature interaction and dynamic selection mechanisms, the number of model parameters and the computational complexity are significantly reduced. At the same time, the dynamic weight distribution strategy is used to enhance the characterization capability of features of different scales, so that the number of model parameters is only 2.29M. While maintaining a lightweight architecture, the inference speed reaches 62fps, and the key features of flat material surface defects can be efficiently extracted, thereby achieving fast inference speed and good feature learning ability, effectively solving the problem of insufficient real-time performance of deep models in the existing technology due to the large number of parameters, thereby meeting the needs of industrial production lines for high-speed detection and ensuring that real-time detection goals are achieved without sacrificing accuracy.
[0019] (2) The decoder architecture based on the multi-scale feature aggregation module innovatively designed in the present invention extracts multi-scale information by using convolution with different expansion rates after splitting the features by channel, and establishes cross-branch residual connections, thereby strengthening the correlation between feature maps of different scales. This enables the decoder to better fuse the deep semantic information from the encoder with the shallow detail features, improves the positioning accuracy of small defects and defects in complex backgrounds, and effectively solves the problem of information loss when the output features of the pyramid pooling module are fused across scales, thereby enhancing the model's adaptability to diverse defect forms and ensuring the stable output of high-quality saliency maps in various industrial scenarios.
[0020] (3) The present invention adopts a deep supervision loss function to perform multi-scale optimization on the output feature maps of each stage of the decoder. By applying cross-entropy loss to the prediction results of different levels, the transparency of the hidden layer learning process and the efficiency of gradient propagation are improved, and the collaborative learning of multi-level features by the model is promoted. The problem of insufficient deep feature learning that is easily caused by the traditional single-scale loss function is avoided, and the detection accuracy and generalization ability of the model are further improved, so that the model can still maintain stable defect recognition performance when facing complex situations such as illumination changes and surface texture interference. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments described in the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive efforts. Figure 1 4 is a flow chart of a method for detecting surface quality of flat materials based on a lightweight saliency detection model according to embodiment 1 of the present invention; Figure 2This is a diagram of the overall network architecture of the detection model of Example 1 of the present invention; Figure 3 1 is a diagram showing the backbone network parameter settings of the detection model according to embodiment 1 of the present invention; Figure 4 1 is a design diagram of the SAFE module of the detection model of Example 1 of the present invention; Figure 5 1 is a design diagram of a detection model decoder according to embodiment 1 of the present invention; Figure 6 This is a design diagram of the MFA module of the detection model of Example 1 of the present invention; Figure 7 This is a comparison diagram of the saliency map output by the detection model and the actual flat material in Example 1 of the present invention; Figure 8 A schematic diagram of the structure of an electronic device that can be used to implement embodiment 1 of the present invention is shown. DETAILED DESCRIPTION
[0022] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0023] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.
[0024] Example 1: Figure 1 As shown, a flat material surface quality detection method based on a lightweight saliency detection model includes the following steps: S1. Label the flat material surface damage dataset and divide it into training set and test set in a 4:1 ratio; In this embodiment, in the dataset annotation, images of flat material surfaces of different types, including but not limited to scratches, rust or deformation, with different lighting conditions and surface textures, are collected to ensure sample diversity. Professional image annotation tools (such as LabelMe and VGG Image Annotator) are used to manually annotate the damaged areas in the image at the pixel level, that is, mark the defect outline pixel by pixel, and generate a saliency image of the same size as the original image, namely the label map, in which the pixel value of the defect area is set to 1, i.e., the foreground, and the non-defect area is set to 0, i.e., the background, forming a one-to-one corresponding data pair between the original image and the label map.
[0025] Furthermore, the labeled dataset is randomly divided into a training set and a test set in a 4:1 ratio. When dividing, it is necessary to ensure that the defect types and scale distributions of the training set and the test set are consistent (for example, the proportions of large-scale rust and small scratches are similar) to avoid a decrease in the model generalization ability due to imbalanced data distribution.
[0026] Furthermore, the annotated saliency image is directly used as the supervisory signal for the loss function in step S3 to calculate the difference between the predicted result and the true label. The divided training set is used for model parameter learning in step S4, and the test set is used for inference effect evaluation in step S5 to ensure that the model's generalization ability is verified on unseen data.
[0027] S2. Build a lightweight saliency detection model, whose overall network architecture is as follows Figure 2 As shown; E1-E5 respectively represent the five stages of the encoder {E1, E2, E3, E4, E5} constructed in this embodiment; D1-D5 respectively represent the five stages of the decoder {D1, D2, D3, D4, D5} constructed in this embodiment; PPM represents the pyramid pooling module constructed in this embodiment; Represents the feature map output by the decoder at each stage, Represents the feature map output by the encoder at each stage, where .
[0028] In this implementation, the model consists of a bottom-up encoder, a top-down decoder, and a lateral connection between the two. The specific construction process includes the following steps: 2-a. Construction of encoder, we designed an encoder with scale-adaptive feature extraction module SAFE as the unit; Figure 2 As shown in Figure 1, the encoder consists of five stages, denoted as {E1, E2, E3, E4, E5}, and the encoder of each stage is composed of a different number of stacked SAFE modules.
[0029] Optionally, due to the high resolution of the shallow network feature map, in order to reduce the amount of computation, only one SAFE module is used in the E1 and E2 stages, three SAFE modules each in the E3 and E5 stages, and six SAFE modules in the E4 stage.
[0030] Among them, depth-separable convolution is used between each stage to adjust the number of channels and the size of the feature map. Figure 3 The specific parameter settings in the backbone network are shown in the figure. As the basic unit of the encoder, the design of the SAFE module is as follows: Figure 4 As shown, it includes a multi-scale feature interaction module MFI and a dynamic selection module DS.
[0031] exist Figure 4In the figure, DDS represents depthwise separable convolution; AP represents average pooling; Conv 3×3 represents 3×3 convolution; DMM represents dynamic weighting module; GAP represents global average pooling; FC represents fully connected layer; ReLU represents ReLU activation function; Softmax represents normalization; ㊉ represents bitwise addition; Ⓧ represents bitwise multiplication.
[0032] Furthermore, in the MFI module, the input feature map is firstly processed using multiple depthwise separable convolutions (DDS) with different expansion rates. , processed, and obtained Branch feature graph ;in, C , H , W are the number of channels, height and width respectively; is the set of real numbers; . After 3×3 average pooling operation (AP), the residual connection is connected with The feature map is obtained by adding the output feature maps of each branch element by element to realize feature interaction, thereby enhancing the representation ability of each branch for salient targets; the feature map output by each branch is accumulated element by element , and input to the DS module.
[0033] Furthermore, the DS module is data-driven and can adaptively perceive and measure the importance of features at different scales according to the changes in the input feature map. Specifically, the feature map is firstly convolved with 3×3 convolution. After processing, it is input into the dynamic measurement submodule DMM, which uses the global average pooling (GAP) operation to extract the channel dimension. The global context information is embedded into a learnable vector ;in, Z No. c The components are expressed as: ;in, c Represents the channel index, corresponding to the channel dimension of the feature map, ; and Represents the pixel coordinates in the height and width directions of the feature map respectively; specifically, the feature map is averaged in the channel dimension through the global average pooling operation. Processing, for each channel c All pixels ( x , y ) to find the average value and obtain the learnable vector Z No. c A portion.
[0034] Next, we can learn vectorsZ The input is processed into a simple multi-layer perceptron (MLP), which consists of two fully connected layers, a nonlinear ReLU and a softmax. Since MLP is learnable, it can dynamically assign different attention weights to each scale feature. i Dynamic attention weights of branches The calculation formula is: ; in, ; FC ( Z ) represents the fully connected layer processing of vector Z; ReLU Express FC ( Z )’s output is processed by nonlinear activation function; FC Express ReLU The output of is processed by the second fully connected layer; It means that the output of the final fully connected layer is normalized; after, Multiply the corresponding branch features by channel and integrate the multiplied results by pixel-by-pixel addition to obtain the feature map : ; Finally, the original input feature map is connected through the residual connection X ,and Add element by element to get the output of the final SAFE module Y : .
[0035] 2-b. Construction of decoder, we designed a decoder based on the MFA module, such as Figure 5 As shown, the decoder D n It consists of two parts: feature fusion module and multi-scale feature aggregation module MFA.
[0036] exist Figure 5 DSConv k×k Indicates the depth-separable k×k dilated convolution module; Upsample represents the upsampling module constructed in this embodiment; Conv 1×1 represents the 1×1 convolution module constructed in this embodiment; ㊉ represents the bitwise addition module constructed in this embodiment.
[0037] Depend on Figure 2As can be seen, unlike the classic encoder-decoder network structure, this implementation passes the output of the encoder's final stage (E5) through a pyramid pooling module (PPM) to further improve the network's learning of global features, and inputs the PPM's output features into the decoders of each stage for feature fusion, thereby fully utilizing the deep semantic information of the network.
[0038] like Figure 5 As shown, the feature fusion module fuses features from three directions and uses a depth-separable Dilated convolution is used to integrate the fused results.
[0039] After fusing the features from the three directions, simply using a layer of convolution for processing is not enough. In particular, the output features of the PPM module will go through a relatively large scale span (up to 16 times the scale span) during the upsampling process. It is necessary to reasonably establish cross-scale connections and then construct a multi-scale feature aggregation module (MFA) to further process the fused features.
[0040] The implementation of the multi-scale feature aggregation module (MFA) is as follows Figure 6 As shown. Figure 6 In the figure, Split represents the channel division module constructed in this embodiment; DDS represents the depthwise separable convolution constructed in this embodiment; ㊉ represents the bitwise addition module constructed in this embodiment; © represents the channel splicing module constructed in this embodiment; Conv represents the convolution module constructed in this embodiment.
[0041] like Figure 6 As shown, the output features of the feature fusion module are used as the input of the MFA module, denoted as F , and divided into 4 parts by channel, using Indicates that , through the expansion rate The depth-separable convolution is used to extract information of different scales, forming 4 different branches to obtain the feature map ,in .
[0042] Furthermore, in order to achieve cross-scale feature aggregation, residual connections are established between different branches, and the following is obtained by element-by-element addition: .
[0043] Going further, use Represents the feature map output by the decoder at each stage, Represents the feature map output by the encoder at each stage, where ,get: ; in, It is i stage k × k Depthwise separable convolution; Up is an upsampling operation; Represents a 1×1 convolution operation.
[0044] S3. Construct loss function; Specifically, deep supervision is used to improve the transparency of the hidden layer learning process. For the output feature maps of the decoders at different stages, Using a 1×1 convolution and sigmoid Activation function to generate multiple predictions, i.e. ,in, .
[0045] Furthermore, the standard cross entropy loss function is used, which is defined as: ;in, is the standard cross entropy loss function; is the annotated saliency image; is the weight coefficient, which is set to 0.4 to balance the loss weight value.
[0046] S4, using the training set to train the detection model; Specifically, the data set obtained in step S1 is used to train the detection model constructed in step S2. The backbone network in the model is initialized with the pre-model. The Adam optimizer is used for optimization, and the parameters are set to , , and 10 -4 The weights of the training set are decayed, and the batch size is set to 20; the initial learning rate is set to 0.0005, and the poly learning rate decay strategy is used. The learning rate in the nth round of iteration is: ;in, is the initial learning rate; power is set to 0.9, and the model is trained for 100 rounds of iterations, i.e. #epochs .
[0047] S5, reasoning and obtaining detection results; Specifically, after the test set images are normalized, they are input into the trained saliency detection model to obtain the final saliency map; Figure 7As shown in FIG1 , the left side is the original image of the flat material surface defect, and the right side is the saliency map output by the lightweight saliency detection model constructed in the embodiment. The number of parameters of the lightweight saliency detection model in this embodiment is only 2.29M, and its hardware environment is shown in Table 1. The comparison of the inference speed between the lightweight saliency detection model in Example 1 and the traditional model is shown in Table 2.
[0048] Table 1: Hardware environment of the lightweight saliency detection model in Example 1
[0049] Table 2: Comparison of inference speed between the lightweight saliency detection model in Example 1 and the traditional model
[0050] As shown in Table 2, FPS is specifically used as a quantitative indicator of inference speed. In deep learning, FPS represents the number of images that a model can process per second during the inference process. A higher FPS value indicates a faster inference speed. The present invention significantly reduces the number of model parameters and computational complexity by constructing a lightweight backbone network with a scale-adaptive feature extraction module as its core, combining multi-scale feature interaction with a dynamic selection mechanism. At the same time, the dynamic weight distribution strategy enhances the characterization capability of features at different scales. While maintaining a lightweight architecture, it achieves an inference speed of 62 fps, can efficiently extract key features of flat material surface defects, and thus achieve fast inference speed and good feature learning capability. This effectively solves the problem of insufficient real-time performance of deep models in the existing technology due to the large number of parameters, thereby meeting the high-speed detection requirements of industrial production lines and ensuring that real-time detection goals are achieved without sacrificing accuracy.
[0051] Specifically, the model's high speed stems primarily from the fast forward computational capabilities of the lightweight backbone network and the efficiency of the model structure. The lightweight design of the backbone network and the intelligent focusing of the scale-adaptive module reduce a large number of unnecessary floating-point operations. Through the encoder-decoder structure combined with lateral connections, the model can perform object detection directly on multi-scale feature maps that combine high-level semantic information and low-level spatial details in a single forward propagation. This completely avoids the huge computational overhead of multiple input image processing required by traditional multi-scale detection methods (such as image pyramids), thereby achieving extremely high inference speed. At the same time, the guarantee of detection accuracy depends on the model's powerful multi-scale feature fusion capability and the feature quality improved by the scale-adaptive module. The encoder extracts multi-level features, the decoder transmits strong semantic information through upsampling, and the lateral connection accurately fuses these high-level semantic information with the rich spatial detail features of the encoder's corresponding level. The encoder extracts multi-level features, the decoder transmits strong semantic information through upsampling, and the lateral connection accurately fuses these high-level semantic information with the rich spatial detail features of the encoder's corresponding level. The scale-adaptive module embedded in the lightweight backbone further improves the effectiveness of the features and can dynamically adapt to targets of different sizes and shapes and complex backgrounds, ensuring that the extracted features are rich and targeted enough even under conditions of limited parameters and calculations, thereby maintaining high detection accuracy.
[0052] Example 2: Figure 7 Schematic diagram of an electronic device structure that can be used to implement Embodiment 1 of the present invention is shown. Electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0053] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program executable by the at least one processor 11, and the computer program is executed by the at least one processor 11 so that the at least one processor 11 can perform the method provided by the present invention.
[0054] Furthermore, the processor 11 can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 12 or a computer program loaded from a storage unit 18 into a random access memory (RAM) 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0055] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0056] Furthermore, the processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the method for managing database resources.
[0057] In some specific embodiments, the method for managing database resources may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for managing database resources described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the method for managing database resources in any other appropriate manner (e.g., via firmware).
[0058] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), system on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0059] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0060] In the context of the present invention, a computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method for database resource management provided by the present invention. A computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by, or in conjunction with, an instruction execution system, device, or apparatus. Computer-readable storage media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0061] Among them, in order to provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device, which has: a display device for displaying information to the user (for example, a cathode ray tube (CRT) or a liquid crystal display (LCD monitor); and a keyboard and a pointing device (for example, a mouse or a trackball), through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (for example, visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0062] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the Internet.
[0063] Optionally, a computing system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. The client-server relationship is established by computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system. It solves the shortcomings of traditional physical hosts and virtual private server (VPS) services, such as high management difficulty and poor business scalability.
[0064] The above description is based on the ideal embodiment of the present invention. It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention. Therefore, the embodiments should be considered as illustrative and non-restrictive in all respects. The scope of the present invention is defined by the appended claims, not the foregoing description, and it is intended that all variations within the meaning and range of equivalents of the claims be encompassed within the present invention. Any reference signs in the claims should not be construed as limiting the claim to which they relate.
[0065] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
Claims
1. A method for detecting the surface quality of flat materials based on a lightweight saliency detection model, characterized in that: The following steps are involved: S1. Label the flat material surface damage dataset and divide it into training set and test set; S2. Build a lightweight saliency detection model, which consists of a bottom-up encoder, a top-down decoder, and a lateral connection between the encoder and the decoder; S3. Construct a loss function and use a deep supervision strategy to generate predictions for the output feature maps of each stage of the decoder and calculate the loss; S4. Use the training set to train the detection model, using the Adam optimizer and the poly learning rate decay strategy; S5. Normalize the test set image, input it into the detection model, and infer the saliency map of the surface defects; In step S2, the encoder is constructed with the scale-adaptive feature extraction module SAFE as the basic unit, which includes five stages {E1, E2, E3, E4, E5}, and each stage stacks a different number of SAFE modules; depthwise separable convolution is used between stages to adjust the number of channels and feature map size; the SAFE module includes a multi-scale feature interaction module MFI and a dynamic selection module DS.
2. The method for detecting flat material surface quality based on a lightweight saliency detection model according to claim 1, wherein: The multi-scale feature interaction module MFI implements feature interaction through the following steps: S21, using multiple depth-separable convolutions with different expansion rates to input feature maps Process and obtain N Branch feature graph ;in, C , H , W are the number of channels, height and width respectively; R is a set of real numbers; ; S22, yes After 3×3 average pooling operation, the residual connection is connected with Add, accumulate the output feature maps of each branch element by element to obtain the feature map , and input to the DS module.
3. The method for detecting flat material surface quality based on a lightweight saliency detection model according to claim 2, wherein: The DS module dynamically assigns feature weights through the following steps: S211, feature map Perform 3×3 convolution processing, input the dynamic measurement submodule DMM, extract the global context information of the channel dimension through global average pooling, and embed the learnable vector ; S212, will Z Input the multi-layer perceptron to calculate the dynamic attention weight of each branch And multiply it with the corresponding branch feature by channel and accumulate it pixel by pixel, and output the SAFE module result by combining the residual connection ;in, FC ( Z ) represents the fully connected layer processing of vector Z; ReLU Express FC ( Z )’s output is processed by nonlinear activation function; FC Express ReLU The output of is processed by the second fully connected layer; It means that the output of the final fully connected layer is normalized; It is the result of the DS module fusing dynamic attention weight allocation with multi-branch features.
4. The method for detecting flat material surface quality based on a lightweight saliency detection model according to claim 1, wherein: The number of SAFE modules in each stage of the encoder is: 1 each in E1 and E2 stages, 3 each in E3 and E5 stages, and 6 in E4 stage.
5. The method for detecting flat material surface quality based on a lightweight saliency detection model according to claim 1, wherein: In step S2, the decoder is constructed based on a multi-scale feature aggregation module MFA, which includes a feature fusion module and an MFA module; the feature fusion module integrates encoder features, pyramid pooling module output features and upsampling features, and performs depth-separable convolution processing.
6. The method for detecting flat material surface quality based on a lightweight saliency detection model according to claim 5, characterized in that: The MFA module achieves cross-scale aggregation through the following steps: S2111, divide the input features into 4 parts by channel , , using the expansion rate Depthwise separable convolution extracts feature maps ; S2112, establish element-by-element addition between different branches through residual connection to generate decoder output feature map .
7. The method for detecting flat material surface quality based on a lightweight saliency detection model according to claim 1, wherein: In the step S3, the loss function adopts a deep supervision strategy to output feature maps at each stage of the decoder. Generate predictions through 1×1 convolution and sigmoid activation function , the loss function is defined as: ;in, is the standard cross entropy loss function; is the annotated saliency image; is the weight coefficient.
8. An electronic device, characterized in that: include: at least one processor; and a memory communicatively coupled to at least one of said processors; The memory stores a computer program executed by at least one of the processors, and the computer program is executed by at least one of the processors so as to enable at least one of the processors to execute the flat material surface quality detection method based on a lightweight saliency detection model according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the flat material surface quality detection method based on a lightweight saliency detection model according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
RGB-D underwater saliency target detection method based on semantic guidance fusion
CN118570623A
Building change detection method and system based on siamese unet model
WO2025030625A1
Cited By
Semantic and edge collaborative lightweight industrial defect inspection method and system
CN121258974A
A semantic and edge collaborative lightweight industrial defect inspection method and system
CN121258974B