Neural network based on mixed attention mechanism and category feature optimization and defect detection method

By introducing hybrid attention mechanism, Transformer network, cross-section attention network and category feature optimization network into neural network, the problem of missed detection and misdetection in panel defect detection in the prior art is solved, and higher detection is achieved Accuracy and more information utilization.

CN119417827APending Publication Date: 2025-02-11CHENGDU UNION BIG DATA TECH CO LTD

Patent Information

Application Number
CN202510019446.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

Existing neural networks are prone to missed and misdetection in panel defect detection, and the Transformer network's potential in information utilization has not been fully utilized.

Method used

Adopt a neural network based on a hybrid attention mechanism and category feature optimization, combining channel attention and self-attention, build dependencies through the Transformer network, and use cross-cross attention network to enhance the feature interaction of adjacent windows, while introducing category feature optimization network Improve feature fusion.

Benefits of technology

Improve the accuracy of defect detection, reduce the occurrence of missed detection and false detection, make full use of the potential of Transformer network, and enhance feature interaction and fusion through cross-section attention network and category feature optimization network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417827A_ABST
    Figure CN119417827A_ABST
Patent Text Reader

Abstract

The invention provides a neural network based on a mixed attention mechanism and category feature optimization and a defect detection method, and relates to the technical field of defect detection, the neural network comprises a feature extraction network, a Transform network, a cross attention network, a feature fusion network, a category feature optimization network and a full connection layer; the feature extraction network is used for feature map construction, and the Transform network is used for feature map dependency relationship construction; the cross attention network is used for feature map global pixel point association; the feature fusion network is used for feature fusion of the feature map; the category feature optimization network is used for feature information smoothing processing of the feature map, and the full connection layer is used for defect category prediction of the feature map. According to the invention, the neural network with an optimized structure is used for panel defect detection, so that the problem that missing detection and false detection are easy to occur when the existing neural network is used for panel defect detection can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of defect detection technology, and in particular to a neural network and a defect detection method based on a hybrid attention mechanism and category feature optimization. Background Art

[0002] Panel processing factories will produce many defects in the process of producing panels. However, the production process of the entire panel product is complex and the production cycle is long. It often takes a long time from the substrate to the completion of production and processing. Therefore, the defects generated in each process stage need to be monitored at all times to prevent the defects from flowing into the next process and causing a reduction in yield.

[0003] At present, panel defects are usually detected by neural networks. The neural network first uses a convolutional layer to extract shallow texture features, then uses a series of superimposed residual layers to extract deep semantic features, and finally fuses the shallow texture features and deep semantic features into the fully connected layer for defect type prediction. In order to effectively extract and aggregate feature information, channel attention mechanisms and self-attention mechanisms are used for various detection tasks, but because the existing Transformer (the core of which is the self-attention mechanism) can only use a limited spatial range when using input information, this means that the current neural network has not yet fully utilized the potential of the Transformer; at the same time, when performing feature fusion, the fusion of multi-scale feature maps by direct addition or multiplication may mistakenly emphasize the features of some areas that do not belong to the current category, causing defect detection to be prone to missed detection and false detection. Summary of the invention

[0004] In order to solve the problem that existing neural networks are prone to missed detection and false detection when performing panel defect detection, an embodiment of the present invention provides a neural network and a defect detection method based on a hybrid attention mechanism and category feature optimization.

[0005] In a first aspect, an embodiment of the present invention provides a neural network based on a hybrid attention mechanism and category feature optimization, wherein the neural network includes a feature extraction network, a Transformer network, a cross attention network, a feature fusion network, a category feature optimization network, and a fully connected layer; The feature extraction network is used to perform shallow feature extraction and deep feature extraction on the original image to obtain a shallow texture feature map and a deep semantic feature map; The Transformer network is used to construct a dependency relationship between the shallow texture feature map and the deep semantic feature map to obtain a shallow region feature map and a deep region feature map; The cross attention network is used to perform global pixel association on the shallow region feature map and the deep region feature map to obtain a shallow region association map and a deep region association map; The feature fusion network is used to fuse image features of the shallow region association map and the deep region association map to obtain a feature fusion map; The category feature optimization network is used to perform feature information smoothing processing on the feature fusion graph to obtain a feature optimization graph; The fully connected layer is used to perform category prediction on the feature optimization graph to obtain a category prediction result.

[0006] In the above embodiment, in order to activate more input pixels of the original image, the present invention combines channel attention and self-attention, fully utilizes their respective powerful local fitting capabilities and global statistical information capabilities, inputs shallow features and deep features into the Transformer network for dependency construction, so as to achieve mixed attention output; and in order to better aggregate cross-window information and solve the problems of artifacts caused by Transformer network window division and low connection efficiency of moving windows between windows, the mixed attention output result is sent to the subsequent superimposed cross-attention network to enhance the interaction between adjacent window features; at the same time, in the multi-scale feature map fusion stage, due to the addition or multiplication operation to emphasize the features of the corresponding semantic category area in the feature map, all features that may cause some errors in the area are emphasized, so a category-level category feature optimization network is introduced to improve the features, so as to improve the defect detection accuracy.

[0007] As some optional implementations of the present application, the process of the Transformer network for constructing the dependency relationship between the shallow texture feature map and the deep semantic feature map is as follows: Normalize the shallow texture feature map and the deep semantic feature map; The window attention mechanism is used to divide the normalized shallow texture feature map and deep semantic feature map into multiple windows of fixed size, and self-attention is calculated in each window; The channel attention mechanism is used to offset the position of the window, and the self-attention is adjusted within each window. The channel attention weight is calculated and the features are weighted to obtain the shallow area feature map and the deep area feature map.

[0008] In the above embodiment, the present invention first captures local area correlation information through the window attention mechanism, and then introduces the channel attention mechanism to calculate global information, channel attention weights and feature weighting to generate a high-quality feature space.

[0009] As some optional implementations of the present application, the process of the cross attention network for global pixel association of the shallow region feature map and the deep region feature map is as follows: Perform row self-attention calculation on each pixel in the shallow region feature map and the deep region feature map to capture contextual information in the horizontal direction; Column self-attention calculation is performed on the shallow region feature map and the deep region feature map containing horizontal context information to capture the context information in the vertical direction, and generate the shallow region association map and the deep region association map containing vertical context information.

[0010] In the above embodiment, the present invention can associate the target pixel with any pixel by adding a cross attention network, effectively integrate the global information, and enhance the fluidity of information between windows.

[0011] As some optional implementations of the present application, the image feature fusion is to perform feature map connection fusion or feature map addition fusion on the shallow region association map and the deep region association map.

[0012] In the above embodiments, the present invention uses addition or multiplication operations to emphasize the features of the corresponding semantic category areas in the feature map.

[0013] As some optional implementations of the present application, the process of the category feature optimization network for smoothing feature information of the feature fusion graph is as follows: Performing pooling, convolution and activation processing on the feature fusion map to obtain a smooth feature fusion map; The smoothed feature fusion map and the feature fusion map are multiplied pixel by pixel to obtain the feature optimization map.

[0014] In the above embodiment, the present invention first performs pooling expansion on the feature fusion map in the channel dimension, then performs convolution processing and activation processing, and finally performs pixel multiplication operation on the processed feature and its own feature, which can smooth the introduced erroneous information to a certain extent.

[0015] In a second aspect, the present invention provides a defect detection method based on a hybrid attention mechanism and category feature optimization, the method using the neural network, the method comprising the following steps: Acquire the original image of the panel to be detected, and pre-process the original image of the panel to be detected; wherein the pre-processing includes performing interference fringe filtering and image sharpening enhancement on the original image of the panel to be detected; The original image of the panel to be inspected is input into the neural network for defect type prediction to obtain the panel defect type prediction result.

[0016] In the above embodiment, the present invention pre-processes the original image of the panel to be inspected, and the image edge can be highlighted by filtering out interference fringes, thereby effectively reducing the impact of horizontal and vertical lines inherent in image capture, and the high-frequency information in the image can be enhanced by image sharpening enhancement, thereby achieving a sharpening effect; and an improved neural network is used to predict the defect type of the original image of the panel to be inspected, which makes it less likely to have problems of missed detection and over-detection.

[0017] As some optional implementations of the present application, before the original image of the panel to be inspected is input into the neural network for defect type prediction, the neural network needs to be trained. The process of the model training is as follows: Acquire the original image of the history panel, and preprocess the original image of the history panel, wherein the preprocessing includes performing interference fringe filtering and image sharpening enhancement on the original image of the history panel; The original images of the history panel are input into the neural network for binary cross entropy loss calculation to achieve model training.

[0018] In the above embodiment, the present invention adopts a binary cross entropy loss calculation method to perform model training, that is, the difference between the probability distribution predicted by the neural network and the actual training label can be measured by binary cross entropy loss calculation. Through model training, the neural network can predict the defect type of the original image of the panel to be inspected.

[0019] In a third aspect, the present invention provides a defect detection system based on a hybrid attention mechanism and category feature optimization, wherein the functions of the system correspond one-to-one to the method, the system uses the neural network, and the system comprises: An original image acquisition unit, the original image acquisition unit is used to acquire the original image of the panel to be detected, and pre-process the original image of the panel to be detected; wherein the pre-processing includes performing interference fringe filtering and image sharpening enhancement on the original image of the panel to be detected; A neural network prediction unit is used to input the original image of the panel to be detected into the neural network for defect type prediction to obtain a panel defect type prediction result.

[0020] In a fourth aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the defect detection method based on a hybrid attention mechanism and category feature optimization.

[0021] In a fifth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the defect detection method based on a hybrid attention mechanism and category feature optimization is implemented.

[0022] The beneficial effects of the present invention are as follows: the present invention improves the structure of the neural network by adding a Transformer network, a cross attention network and a category feature optimization network. The Transformer network can make full use of its own powerful local fitting ability and global statistical information ability; at the same time, in order to solve the problems of artifacts caused by the window division of the Transformer network and the low connection efficiency of the moving window between windows, the mixed attention output result is sent to the subsequent superimposed cross attention network to enhance the interaction between adjacent window features; at the same time, in the multi-scale feature map fusion stage, due to the addition or multiplication operation to emphasize the features of the corresponding semantic category area in the feature map, all the features that may cause some errors in the area are emphasized, so a category-level category feature optimization network is introduced to improve the features, thereby improving the defect detection accuracy, and is not prone to missed detection and over-detection problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 is a schematic diagram of the computer device structure of the hardware operating environment described in the embodiment of the present invention; Figure 2 It is a schematic diagram of the structure of a neural network based on a hybrid attention mechanism and category feature optimization according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0026] In order to solve the problem of missed detection and false detection when the existing neural network is used for panel defect detection, this application provides a neural network, defect detection method and system based on hybrid attention mechanism and category feature optimization. Before introducing the specific technical solution of this application, the hardware operating environment involved in the embodiment of this application is first introduced.

[0027] See also Figure 1 , Figure 1A schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present application.

[0028] like Figure 1 As shown, the computer device may include: a processor, such as a central processing unit (CPU), a communication bus, a user interface, a network interface, and a memory. Among them, the communication bus is used to realize the connection and communication between these components. The user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), and optionally, the user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity interface). The memory may be a high-speed random access memory (Random Access Memory, RAM) or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory may optionally be a storage device independent of the aforementioned processor.

[0029] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine some components, or arrange the components differently.

[0030] like Figure 1 As shown, the memory as a storage medium may include an operating system, a network communication module, a user interface module and a data storage module.

[0031] exist Figure 1 In the computer device shown, the network interface is mainly used for data communication with the network server; the user interface is mainly used for data interaction with the user; the processor and memory in the computer device of the present application can be set in the computer device, and the computer device calls the software program stored in the data storage module in the memory through the processor, and executes the defect detection method based on the hybrid attention mechanism and category feature optimization provided in the embodiment of the present application.

[0032] Based on the hardware environment of the aforementioned embodiment, the embodiment of the present application first provides a neural network based on a hybrid attention mechanism and category feature optimization, see Figure 2 , Figure 2 It is a schematic diagram of the structure of the neural network, which includes a feature extraction network, a Transformer network, a cross attention network, a feature fusion network, a category feature optimization network and a fully connected layer.

[0033] The feature extraction network is used to perform shallow feature extraction and deep feature extraction on the original image to obtain a shallow texture feature map and a deep semantic feature map.

[0034] In an embodiment of the present invention, the feature extraction network includes but is not limited to a VGG16 backbone network, which is a classic convolutional neural network architecture in deep learning technology. The VGG16 backbone network is composed of multiple convolutional layers and maximum pooling layers stacked alternately. Among them, the convolutional layer includes five convolutional blocks, and each convolutional block contains 2 to 3 convolutional layers. The backbone network has a powerful feature extraction capability and takes a short time. Specifically, the shallow texture feature map is a feature map formed after the third convolutional block, and the deep semantic feature map is a feature map after the final maximum pooling layer.

[0035] The Transformer network is used to construct a dependency relationship between a shallow texture feature map and a deep semantic feature map to obtain a shallow region feature map and a deep region feature map.

[0036] In an embodiment of the present invention, the Transformer network includes a normalization layer, a channel attention mechanism, and a channel attention mechanism.

[0037] Specifically, the process of the Transformer network for constructing the dependency relationship between the shallow texture feature map and the deep semantic feature map is as follows: First, the shallow texture feature map and the deep semantic feature map are normalized.

[0038] Then, the window attention mechanism is used to divide the normalized shallow texture feature map and deep semantic feature map into multiple windows of fixed size, and self-attention is calculated in each window.

[0039] Finally, the channel attention mechanism is used to offset the position of the window, and the self-attention is adjusted in each window. The channel attention weight is calculated and the features are weighted to obtain the shallow area feature map and the deep area feature map.

[0040] The cross attention network is used to perform global pixel association on the shallow region feature map and the deep region feature map to obtain a shallow region association map and a deep region association map.

[0041] In an embodiment of the present invention, the criss-cross attention network includes a superimposed self-attention mechanism.

[0042] Specifically, the process of the cross attention network for global pixel association of the shallow region feature map and the deep region feature map is as follows: First, row self-attention calculation is performed on each pixel in the shallow region feature map and the deep region feature map to capture contextual information in the horizontal direction.

[0043] Then, column self-attention calculation is performed on the shallow area feature map and the deep area feature map containing horizontal context information to capture the context information in the vertical direction, and generate the shallow area association map and the deep area association map containing vertical context information.

[0044] The feature fusion network is used to fuse image features of the shallow region association map and the deep region association map to obtain a feature fusion map.

[0045] In the embodiment of the present invention, the image feature fusion is to perform feature map connection fusion or feature map addition fusion on the shallow region association map and the deep region association map.

[0046] Specifically, the feature fusion network performs feature map addition and fusion on the shallow region association map and the deep region association map to obtain a feature map with edge information and semantic information, and performs feature map connection and fusion on the image after the feature map addition and fusion and the deep region association map to obtain a feature fusion map with obvious blocking and edge feature information.

[0047] The category feature optimization network is used to perform feature information smoothing processing on the feature fusion graph to obtain a feature optimization graph.

[0048] In an embodiment of the present invention, the category feature optimization network includes Max-pool and Avg-pool pooling operations, a convolutional layer and an activation function.

[0049] Specifically, the process of the category feature optimization network for smoothing feature information of the feature fusion graph is as follows: First, the feature fusion map is pooled, convolved, and activated to obtain a smooth feature fusion map.

[0050] Then, the smoothed feature fusion map and the feature fusion map are multiplied pixel by pixel to obtain the feature optimization map.

[0051] The fully connected layer is used to perform category prediction on the feature optimization graph to obtain a category prediction result.

[0052] In the above embodiment, in order to activate more input pixels of the original image, the present invention combines channel attention and self-attention, fully utilizes their respective powerful local fitting capabilities and global statistical information capabilities, inputs shallow features and deep features into the Transformer network for dependency construction, so as to achieve mixed attention output; and in order to better aggregate cross-window information and solve the problems of artifacts caused by Transformer network window division and low connection efficiency of moving windows between windows, the mixed attention output result is sent to the subsequent superimposed cross-attention network to enhance the interaction between adjacent window features; at the same time, in the multi-scale feature map fusion stage, due to the addition or multiplication operation to emphasize the features of the corresponding semantic category area in the feature map, all features that may cause some errors in the area are emphasized, so a category-level category feature optimization network is introduced to improve the features, so as to improve the defect detection accuracy.

[0053] Based on the above neural network, an embodiment of the present application provides a defect detection method based on a hybrid attention mechanism and category feature optimization, the method comprising the following steps: (1) Acquire an original image of the panel to be inspected, and preprocess the original image of the panel to be inspected; wherein the preprocessing includes performing interference fringe filtering and image sharpening enhancement on the original image of the panel to be inspected.

[0054] In an embodiment of the present invention, the original image of the panel to be inspected is preprocessed, including interference fringe filtering and image sharpening enhancement. Interference fringe filtering can highlight the edge of the image, effectively reducing the impact of the horizontal and vertical lines inherent in image capture; and image sharpening enhancement can highlight the characteristics of gradient variation, wherein interference fringe filtering can use fast Fourier transform to achieve frequency domain filtering, and achieve frequency domain processing of the signal by removing or suppressing signal components within a specific frequency range, thereby eliminating weak vertical or horizontal lines in the picture. Secondly, image sharpening enhancement mainly refers to the use of a high-pass filter to enhance the high-frequency information in the image, thereby achieving a sharpening effect.

[0055] (2) The original image of the panel to be inspected is input into the neural network for defect type prediction to obtain the panel defect type prediction result.

[0056] In an embodiment of the present invention, before the original image of the panel to be inspected is input into the neural network for defect type prediction, the neural network needs to be trained. The process of the model training is as follows: ① Acquire the original image of the history panel, and preprocess the original image of the history panel, wherein the preprocessing includes performing interference fringe filtering and image sharpening enhancement on the original image of the history panel.

[0057] ② Input the original image of the historical panel into the neural network for binary cross entropy loss calculation to achieve model training.

[0058] In the above embodiment, the present invention adopts a binary cross entropy loss calculation method to perform model training, that is, the difference between the probability distribution predicted by the neural network and the actual training label can be measured by binary cross entropy loss calculation.

[0059] In summary, the present invention uses an improved neural network to predict the defect type of the original image of the panel to be inspected, with high detection accuracy and less prone to problems of missed detection and over-detection.

[0060] In addition, in one embodiment, based on the same inventive concept as the above embodiment, the embodiment of the present invention provides a defect detection system based on a hybrid attention mechanism and category feature optimization, the system corresponds one-to-one to the method, and the system includes: An original image acquisition unit, the original image acquisition unit is used to acquire the original image of the panel to be detected, and pre-process the original image of the panel to be detected; wherein the pre-processing includes performing interference fringe filtering and image sharpening enhancement on the original image of the panel to be detected; A neural network prediction unit is used to input the original image of the panel to be detected into the neural network for defect type prediction to obtain a panel defect type prediction result.

[0061] It should be noted that each unit in the defect detection system based on hybrid attention mechanism and category feature optimization in this embodiment corresponds one-to-one to each step in the defect detection method based on hybrid attention mechanism and category feature optimization in the aforementioned embodiment. Therefore, the specific implementation manner and technical effects achieved by this embodiment can refer to the implementation manner of the aforementioned defect detection method based on hybrid attention mechanism and category feature optimization, which will not be repeated here.

[0062] In addition, in one embodiment, the present application also provides a computer device, which includes a processor, a memory, and a computer program stored in the memory, and the computer program implements the method in the aforementioned embodiment when executed by the processor.

[0063] In addition, in one embodiment, the present application further provides a computer storage medium, on which a computer program is stored, and the computer program implements the method in the aforementioned embodiment when executed by a processor.

[0064] In some embodiments, the computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The computer may be various computing devices including intelligent terminals and servers.

[0065] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0066] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0067] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

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

[0069] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0070] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a multimedia terminal device (which can be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in each embodiment of the present application.

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

Claims

1. A neural network based on hybrid attention mechanism and category feature optimization, characterized in that: The neural network includes a feature extraction network, a Transformer network, a cross attention network, a feature fusion network, a category feature optimization network and a fully connected layer; The feature extraction network is used to perform shallow feature extraction and deep feature extraction on the original image to obtain a shallow texture feature map and a deep semantic feature map; The Transformer network is used to construct a dependency relationship between the shallow texture feature map and the deep semantic feature map to obtain a shallow region feature map and a deep region feature map; The cross attention network is used to perform global pixel association on the shallow region feature map and the deep region feature map to obtain a shallow region association map and a deep region association map; The feature fusion network is used to fuse image features of the shallow region association map and the deep region association map to obtain a feature fusion map; The category feature optimization network is used to perform feature information smoothing processing on the feature fusion graph to obtain a feature optimization graph; The fully connected layer is used to perform category prediction on the feature optimization graph to obtain a category prediction result.

2. A neural network based on hybrid attention mechanism and category feature optimization according to claim 1, characterized in that: The process of the Transformer network for constructing the dependency relationship between the shallow texture feature map and the deep semantic feature map is as follows: Normalize the shallow texture feature map and the deep semantic feature map; The window attention mechanism is used to divide the normalized shallow texture feature map and deep semantic feature map into multiple windows of fixed size, and self-attention is calculated in each window; The channel attention mechanism is used to offset the position of the window, and the self-attention is adjusted within each window. The channel attention weight is calculated and the features are weighted to obtain the shallow area feature map and the deep area feature map.

3. A neural network based on hybrid attention mechanism and category feature optimization according to claim 1, characterized in that: The process of the cross attention network for global pixel association of shallow region feature maps and deep region feature maps is as follows: Perform row self-attention calculation on each pixel in the shallow region feature map and the deep region feature map to capture contextual information in the horizontal direction; Column self-attention calculation is performed on the shallow region feature map and the deep region feature map containing horizontal context information to capture the context information in the vertical direction, and generate the shallow region association map and the deep region association map containing vertical context information.

4. A neural network based on hybrid attention mechanism and category feature optimization according to claim 1, characterized in that: The image feature fusion is to perform feature map connection fusion or feature map addition fusion on the shallow region association map and the deep region association map.

5. A neural network based on hybrid attention mechanism and category feature optimization according to claim 1, characterized in that: The process of the category feature optimization network for smoothing feature information of the feature fusion graph is as follows: Performing pooling, convolution and activation processing on the feature fusion map to obtain a smooth feature fusion map; The smoothed feature fusion map and the feature fusion map are multiplied pixel by pixel to obtain the feature optimization map.

6. A defect detection method based on hybrid attention mechanism and category feature optimization, characterized in that: The method uses the neural network based on the hybrid attention mechanism and category feature optimization according to any one of claims 1 to 5, and the method comprises the following steps: Acquire the original image of the panel to be detected, and pre-process the original image of the panel to be detected; wherein the pre-processing includes performing interference fringe filtering and image sharpening enhancement on the original image of the panel to be detected; The original image of the panel to be inspected is input into the neural network for defect type prediction to obtain the panel defect type prediction result.

7. The defect detection method based on hybrid attention mechanism and category feature optimization according to claim 6, characterized in that: Before inputting the original image of the panel to be inspected into the neural network for defect type prediction, the neural network needs to be trained. The process of model training is as follows: Acquire the original image of the history panel, and preprocess the original image of the history panel, wherein the preprocessing includes performing interference fringe filtering and image sharpening enhancement on the original image of the history panel; The original images of the history panel are input into the neural network for binary cross entropy loss calculation to achieve model training.

8. A defect detection system based on hybrid attention mechanism and category feature optimization, characterized in that: The system uses the neural network based on the hybrid attention mechanism and category feature optimization as described in any one of claims 1 to 5, and the system comprises: An original image acquisition unit, the original image acquisition unit is used to acquire the original image of the panel to be detected, and pre-process the original image of the panel to be detected; wherein the pre-processing includes performing interference fringe filtering and image sharpening enhancement on the original image of the panel to be detected; A neural network prediction unit is used to input the original image of the panel to be detected into the neural network for defect type prediction to obtain a panel defect type prediction result.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the defect detection method based on the hybrid attention mechanism and category feature optimization as described in any one of claims 6-7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the defect detection method based on a hybrid attention mechanism and category feature optimization as described in any one of claims 6-7 is implemented.

Citation Information

Patent Citations

  • Remote sensing image target detection method and system based on multi-module fusion

    CN112800964A

  • Welding joint defect detection method and device based on residual network

    CN113516651A

  • Fire detection model training method and detection method based on improved DETR

    CN114639007A

  • Defect detection method based on joint optimization and mixed attention feature fusion

    CN115294038A

  • Defect detection method and device, electronic equipment and computer readable storage medium

    CN115564778A

Cited By

  • Steel plate surface defect detection method based on Swin-Transform network structure and electronic equipment

    CN121353763A

  • Steel plate surface defect detection method based on swin-transformer network structure and electronic device

    CN121353763B