Radiographic image adaptive key frame feature fusion casting defect target detection method
Patent Information
- Application Number
- CN202510945446.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2045-07-09
AI Technical Summary
[0003]现有智能探测技术往往在处理缺陷区域模糊、对比度低、灰度变化小的铸件数字图像时,难以捕获图像丰富的特征信息,易丢失缺陷区域的局部细节特征,导致缺陷区域检测效果较差
[0033]一种射线图像自适应关键帧特征融合的铸造缺陷目标检测方法,结合人工评片过程中通过不断调节数字射线图像的对比度、清晰度等操作的缺陷评定领域知识,构建了基于伽马参数的提取网络,输出可以用于调整射线图像的亮度和对比度的伽马参数;构建基于基于伽马参数的关键帧序列分解模块,实现网络自适应输出对原始图像及其负片图像进行多图分解并形成关键帧序列;构建基于注意力与多尺度卷积的特征提取与融合模块,通过对图像中不同层次信息的有效捕获,实现有效的缺陷目标检测。本发明通过将AI技术与无损检测领域需求进行深度融合,提升了缺陷目标检测的准确性和可靠性。
Smart Images

Figure CN120894289B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital X-ray image defect detection technology, specifically relating to a casting defect target detection method based on adaptive keyframe feature fusion of X-ray images. Background Technology
[0002] In actual industrial production, internal defect detection in castings primarily employs radiographic testing. Currently, digital radiographic images are mainly evaluated manually, resulting in long processing times, high subjectivity, and poor consistency. Existing intelligent methods suffer from low accuracy and reliability, failing to meet the actual needs of enterprises and thus unable to assume quality responsibility. Therefore, developing defect target detection technology based on digital radiographic images to improve the accuracy and reliability of defect identification is a key research focus in the field of precision casting defect detection.
[0003] Existing intelligent detection technologies often struggle to capture rich feature information in digital images of castings with blurred defect areas, low contrast, and minimal grayscale variations. This leads to the loss of local details in defect areas and poor defect detection performance. Furthermore, current methods typically perform end-to-end "static" detection on a single input image, resulting in significant scale differences between defects and the background, leading to high rates of missed and false detections of low-semantic defects. Additionally, the selection of key image frames during single-image to multi-image conversion is a critical issue; otherwise, the model construction process will contain a large amount of redundant information. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a casting defect target detection method based on adaptive keyframe feature fusion of ray image, which addresses the shortcomings of the prior art. By constructing an adaptive keyframe extraction model, the method captures the change information of defects under dynamic conditions and uses the extracted dynamic features to detect the defects. This method is used to solve the technical problems of insufficient feature capture of blurred images, high false detection rate in static detection, and interference from redundant information in multiple frames.
[0005] The present invention adopts the following technical solution:
[0006] A method for detecting casting defects by adaptive keyframe feature fusion of ray images, characterized by the following steps:
[0007] A gamma parameter extraction network GPE-Net is constructed to obtain gamma parameters. Then, based on the gamma parameters, the original image I and its negative image O are decomposed into a multi-image sequence to form a keyframe sequence, thereby obtaining the gradient image set D.
[0008] A feature extraction module based on the SE-Net channel attention mechanism is constructed, assigning a weight ω to each feature map X in the keyframe sequence of the gradient image set D. iIt then performs channel-by-channel multiplication with the original input feature map to output the feature map.
[0009] feature map Input the constructed multi-scale convolutional module (MCM) and output the defect target detection results.
[0010] Preferably, the original image I from the casting ray inspection is bilinearly interpolated to a size of 512×512, and then input into the extraction network GPE-Net, which outputs 2n gamma parameters. The input image I and its negative O are then subjected to gamma transformation using the n gamma parameters to form keyframe sequences D1 and D2, which simulate dynamic image evaluation. D1 and D2 together form a continuous gradient image set D = (D1, D2).
[0011] Preferably, the extraction network GPE-Net initially extracts features from the concatenated feature map through convolution, and then introduces nonlinearity through normalization and ReLU activation function, outputting 8-channel 256-pixel × 256-pixel multi-channel data; three consecutive Conv-ResNetBlock modules are used to downsample the multi-channel data, and the resulting feature maps are fed into two fully connected layers, outputting gamma parameters (α1, α2, ..., α) located between (0.1, 1.9). n ) and (β1,β2,...,β n ).
[0012] Preferably, the pixel value O of the output image is:
[0013] O = c × I γ
[0014] Where I is the pixel value of the input image, c is a constant, and γ is the gamma value. When γ>1, the contrast of the high grayscale range increases; when 0<γ<1, the contrast of the low grayscale range increases; when γ=1, the gamma transformation has no effect on the image.
[0015] Preferably, the output feature map Specifically:
[0016] The feature map X from the gradient image set D is input into the squeeze-excitation module SE of the squeeze-excitation network SE-Net, and global average pooling is performed. C is the number of channels. Let H be the set of real numbers, and W be the height and width, respectively. The feature map is compressed into a vector containing channel information. A non-linear bottleneck structure is constructed using two fully connected layers to learn the weight ω of each channel. i Generate the final channel weights, complete the feature recalibration, and output the feature map.
[0017] Preferably, the output feature map for:
[0018]
[0019] Where gap(X) represents the global average pooling operation, W1 and W2 correspond to the weight matrices of the two fully connected layers, δ and σ represent the activation functions ReLU and sigmoid, respectively, and ⊙ represents channel-wise multiplication.
[0020] Preferably, the first fully connected layer introduces a non-linear mapping; the second fully connected layer restores the dimension to the original number of channels.
[0021] Preferably, the feature map The input is the constructed multi-scale convolutional module (MCM), and the output is the defect target detection result, specifically:
[0022] Each feature map The input multi-scale convolution module learns basic features through three parallel 1×1 convolutional kernels; then it learns further features through 1×1, 3×3, and 5×5 convolutional kernels. The 3×3 kernel is used for learning, with different spacing between adjacent weights (dilated convolution). The learned multi-channel features are concatenated and convolved, and the output is then processed through a ReLU activation function to introduce a non-linear mapping, which is then compared with the input feature map. After multiplication, the resulting detection feature map is output, thus completing the detection of the defect target.
[0023] Preferably, the detection feature map includes the original image, the detection type, and the defect target detection box.
[0024] Secondly, embodiments of the present invention provide a casting defect target detection system based on adaptive keyframe feature fusion of ray images, comprising:
[0025] The image module constructs a gamma parameter extraction network GPE-Net to obtain gamma parameters. Then, based on the gamma parameters, it performs multi-image decomposition on the original image I and its negative image O to form a keyframe sequence, thereby obtaining the gradient image set D.
[0026] The computation module constructs a feature extraction module based on the SE-Net channel attention mechanism, assigning a weight ω to each feature map X in the keyframe sequence of the gradient image set D. i It then performs channel-by-channel multiplication with the original input feature map to output the feature map.
[0027] The detection module will convert the feature map Input the constructed multi-scale convolutional module (MCM) and output the defect target detection results.
[0028] Thirdly, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for detecting casting defects by adaptive keyframe feature fusion of ray images.
[0029] Fourthly, embodiments of the present invention provide a computer-readable storage medium including a computer program, which, when executed by a processor, implements the steps of the above-described method for detecting casting defects by adaptive keyframe feature fusion of ray images.
[0030] Fifthly, a chip includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for detecting casting defects by adaptive keyframe feature fusion of ray images.
[0031] In a sixth aspect, embodiments of the present invention provide an electronic device, including a computer program, wherein when the computer program is executed by the electronic device, it implements the steps of the above-described method for detecting casting defects by adaptive keyframe feature fusion of ray images.
[0032] Compared with the prior art, the present invention has at least the following beneficial effects:
[0033] A method for detecting casting defects by adaptive keyframe feature fusion of X-ray images is proposed. This method incorporates knowledge from the defect assessment domain, gained through manual image evaluation by continuously adjusting the contrast and sharpness of digital X-ray images. A gamma-parameter-based extraction network is constructed, outputting gamma parameters that can be used to adjust the brightness and contrast of the X-ray image. A keyframe sequence decomposition module based on gamma parameters is built, enabling the network to adaptively decompose the original image and its negative image into a multi-image sequence and generate keyframe sequences. A feature extraction and fusion module based on attention and multi-scale convolution is constructed, effectively capturing information at different levels within the image to achieve effective defect detection. This invention improves the accuracy and reliability of defect detection by deeply integrating AI technology with the needs of the non-destructive testing field.
[0034] Furthermore, this invention utilizes gamma parameters obtained from a gamma parameter extraction network to perform continuous preprocessing on a single image, generating an image set D composed of several gradient images. An AI model is then used to learn the gradient image set D, thereby simulating the dynamic observation process of professional non-destructive testing personnel when detecting defects, which conforms to the statistical observation of a large number of X-ray images by human visual observation.
[0035] Furthermore, features are initially extracted through convolution, and the residual structure of ResNetBlock avoids gradient vanishing. The deep network captures global statistical features, providing a data foundation for gamma parameters. The downsampled features are mapped to the (0.1, 1.9) interval to ensure that the gamma value is within the effective enhancement range. Dynamic adjustments are made for different images to avoid the limitations of manually setting parameters. ResNetBlock solves gradient degradation and improves robustness to blurred and low-contrast images.
[0036] Furthermore, by dynamically selecting the enhancement direction based on γ, the problem of single transformation being unable to simultaneously address bright / dark defects is solved, preventing pixel overflow and ensuring output effectiveness.
[0037] Furthermore, to address the uneven grayscale distribution of digital ray images caused by uneven material thickness in different regions, a feature extraction and fusion module based on attention and multi-scale convolution is constructed to better focus on important features in the image, capture useful information in the image, and reduce noise interference in the image.
[0038] Furthermore, adaptive weighting is applied to each keyframe to highlight defect-related features, suppress redundant background information, suppress redundant feature channels, and enhance defect-related features.
[0039] Furthermore, ReLU is applied after dimensionality reduction to reduce the number of parameters while introducing nonlinearity, capturing complex relationships between channels, restoring the original number of channels, ensuring that the weights match the dimension of the input feature map, realizing channel-by-channel multiplication, compressing redundant information, improving computation speed, ensuring that the attention weights and feature maps are operable, and avoiding information loss.
[0040] Furthermore, after multi-scale feature fusion, ReLU is used to enhance the nonlinear expressive power, taking into account both the local details of small defects and the contextual information of large defects, reducing the false negative rate, and dilated convolution captures large region features at low computational cost.
[0041] Furthermore, by mapping defect categories through fully connected layers and regressing bounding box coordinates, defect areas are accurately located. Comparing the original image with the detection results improves the reliability of the results, clarifies the defect type and location, and meets the enterprise's quality responsibility traceability needs.
[0042] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.
[0043] In summary, this invention integrates dynamic image evaluation knowledge from the field of nondestructive testing, and combines attention mechanisms with feature extraction and fusion using multi-scale convolution to achieve defect target detection in digital X-ray images.
[0044] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0045] Figure 1 This is a flowchart of the method framework in this invention;
[0046] Figure 2 A schematic diagram of GPE-Net, a network for extracting gamma parameters;
[0047] Figure 3 This is a schematic diagram of the SE-Net attention mechanism module;
[0048] Figure 4 A schematic diagram of a multi-scale convolutional module (MCM);
[0049] Figure 5 A schematic diagram of a computer device provided in an embodiment of the present invention;
[0050] Figure 6 This is a block diagram of a chip provided according to an embodiment of the present invention.
[0051] Among them, 60. Computer equipment; 61. Processor; 62. Memory; 63. Computer program; 600. Electronic device; 610. Processing unit; 620. Storage unit; 6201. Random access memory unit; 6202. Cache memory unit; 6203. Read-only memory unit; 6204. Program / utility; 6205. Program module; 630. Bus; 640. Display unit; 650. Input / output interface; 660. Network adapter; 700. External device. Detailed Implementation
[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0053] In the description of this invention, it should be understood that the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0054] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0055] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this invention generally indicates that the preceding and following objects have an "or" relationship.
[0056] It should be understood that although terms such as first, second, third, etc., may be used in the embodiments of the present invention to describe the preset range, these preset ranges should not be limited to these terms. These terms are only used to distinguish the preset ranges from one another. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0057] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0058] The accompanying drawings illustrate various structural schematic diagrams according to embodiments disclosed in this invention. These drawings are not to scale, and some details have been enlarged for clarity, and some details may have been omitted. The shapes of the various regions and layers shown in the drawings, as well as their relative sizes and positional relationships, are merely exemplary and may deviate from reality due to manufacturing tolerances or technical limitations. Furthermore, those skilled in the art can design regions / layers with different shapes, sizes, and relative positions as needed.
[0059] This invention provides a casting defect target detection method based on adaptive keyframe feature fusion of X-ray images. Combining defect assessment knowledge gained from manual image evaluation by continuously adjusting the contrast and sharpness of digital X-ray images, a gamma parameter-based extraction network module is constructed to obtain gamma parameters that can be used to adjust the brightness and contrast of the X-ray image. A gamma parameter-based keyframe sequence decomposition module is also constructed to perform multi-image decomposition on the original image and its negative image, forming a keyframe sequence. Finally, a feature extraction and fusion module based on attention and multi-scale convolution is constructed to effectively capture information at different levels in the image, achieving casting defect target detection. This invention improves the accuracy and reliability of defect target detection by deeply integrating AI technology with dynamic image evaluation knowledge from the field of nondestructive testing.
[0060] Please see Figure 1 The present invention discloses a method for detecting casting defects by adaptive keyframe feature fusion of ray images, comprising the following steps:
[0061] S1. In order to integrate knowledge of nondestructive testing fields such as "dynamic image evaluation" into the AI model, it is first necessary to perform continuous preprocessing on a single image. According to the statistical observation of human visual observation of a large number of X-ray images, when the γ parameter is adjusted within the range of [0.1, 1.9], the dynamic change of image contrast can enrich image information and help to better capture and distinguish the details in the image after gamma transformation, thereby simulating the dynamic observation process of professional nondestructive testing personnel when evaluating images.
[0062] First, a Gamma Parameter Extraction Network (GPE-Net) needs to be designed to obtain gamma parameters; the specific steps are as follows:
[0063] S101. Adjust the digital ray image stitching feature map to 512 pixels × 512 pixels using bilinear interpolation and input it into GPE-Net;
[0064] S102. Preliminary feature extraction is performed by convolution on the spliced feature map, and nonlinearity is introduced by normalization and ReLU activation function to output multi-channel data of 256 pixels × 256 pixels in 8 channels.
[0065] S103. Three consecutive Conv-ResNetBlock modules are used to downsample the multi-channel data. The resulting feature maps are fed into two fully connected layers, outputting two sets of gamma parameters (α1, α2, ..., α) located between (0.1, 1.9). n ) and (β1,β2,...,β n ).
[0066] S2. Defect detection is performed by simulating "dynamic image evaluation" based on gamma parameters. This requires performing multiple gamma transforms on the original image to generate an image sequence. Multi-view information fusion yields richer detail capture capabilities. Dynamically adjusting the gamma value enhances subtle signals that are difficult to detect in the original image. Utilizing multi-frame image information effectively suppresses noise interference, improves the signal-to-noise ratio, and ensures clear presentation of defect features during detection. This method also better adapts to different types of defects, ensuring that each defect achieves optimal display under specific gamma transform conditions, thereby improving the robustness and generalization ability of the detection system. Please refer to [link to relevant documentation]. Figure 2 The specific steps are as follows:
[0067] For the 2n gamma parameters extracted in step S1, gamma transformation is performed on the input image I and its negative O using the n parameters respectively to form keyframe sequences D1 and D2, i.e., simulated dynamic image evaluation. D1 and D2 together form a continuous gradient image set D = (D1, D2).
[0068] O = c × I γ
[0069] Where O is the pixel value of the output image, I is the pixel value of the input image, c is a constant, and γ is the gamma value. When γ>1, the contrast in the high grayscale range increases; when 0<γ<1, the contrast in the low grayscale range increases; when γ=1, the gamma transformation has no effect on the image.
[0070] S3. To reduce computational burden and enhance the learning of key features, a channel attention mechanism based on Squeeze and Excitation Net (SE-Net) is used on the gradient image set D obtained in step S2. Each image X in the keyframe sequence is assigned a weight ω. i Then, a channel-wise multiplication operation is performed with the original input feature map to complete the feature recalibration. A feature extraction and fusion module based on attention and multi-scale convolution is constructed. The specific steps are as follows:
[0071] S301. Perform global average pooling on the squeeze-excitation module SE of the SE-Net squeeze-excitation network, which contains feature maps X in the gradient image set D. Where C is the number of channels, and H and W are the height and width, respectively, the feature map is compressed into a vector containing channel information. Channel attention can highlight important feature maps and reduce redundant information, especially for image frames containing more informational features or minor defect features. Please refer to [link to relevant documentation]. Figure 3 ;
[0072] S302. A non-linear bottleneck structure is constructed using two fully connected layers to learn the weights of each channel. The first fully connected layer reduces dimensionality by introducing a non-linear mapping; the second fully connected layer restores the dimensionality to the original number of channels, generating the final channel weights to complete feature recalibration and output the feature map. Its expression is:
[0073] Z = σ(W2δ(W1(gap(X))))
[0074]
[0075] Where gap(X) represents the global average pooling operation, W1 and W2 correspond to the weight matrices of the two fully connected layers, δ and σ represent the activation functions ReLU and sigmoid, respectively, and ⊙ represents channel-wise multiplication. The final output is the feature map after channel recalibration.
[0076] S4. Combine the various feature maps The input multi-scale convolution module (MCM) enables the model to learn features at multiple scales simultaneously, achieving defect target detection through more representative and discriminative dynamic features.
[0077] Please see Figure 4 By using convolutional kernels of different sizes and combining them with dilated convolution, the basic features are first learned through three parallel 1×1 convolutional kernels.
[0078] Secondly, features are further learned through 1×1, 3×3, and 5×5 convolutional kernels. Finally, a 3×3 convolutional kernel is used for learning, and different intervals are set between adjacent weights so that the model can learn features at multiple scales simultaneously.
[0079] Dilated convolution allows the convolutional kernel to skip a certain number of pixels on the input feature map for sampling. This increases the receptive field size while maintaining the same number of parameters and computational complexity, helping the network effectively expand its understanding of local regions and thus more easily identify subtle changes or defects. After concatenating and convolving the learned multi-channel inputs, the output is processed through a ReLU activation function to introduce a non-linear mapping, which is then compared with the input feature map. After multiplication, the resulting detection feature map is output, thus completing the detection of the defect target.
[0080] In another embodiment of the present invention, a casting defect target detection system based on adaptive keyframe feature fusion of ray images is provided. This system can be used to implement the above-mentioned casting defect target detection method based on adaptive keyframe feature fusion of ray images. Specifically, the casting defect target detection system based on adaptive keyframe feature fusion of ray images includes an image module, a computing module, and a detection module.
[0081] The image module constructs a gamma parameter extraction network GPE-Net to obtain gamma parameters, and then performs multi-image decomposition on the original image I and its negative image O according to the gamma parameters to form a keyframe sequence, thereby obtaining the gradient image set D.
[0082] The computation module constructs a feature extraction module based on the SE-Net channel attention mechanism, assigning a weight ω to each feature map X in the keyframe sequence of the gradient image set D.i It then performs channel-by-channel multiplication with the original input feature map to output the feature map.
[0083] The detection module will convert the feature map Input the constructed multi-scale convolutional module (MCM) and output the defect target detection results.
[0084] This invention provides a terminal device comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve a corresponding method flow or corresponding function. The processor described in this embodiment can be used in the operation of a casting defect target detection method based on adaptive keyframe feature fusion of X-ray images, including:
[0085] A gamma parameter extraction network, GPE-Net, is constructed to obtain gamma parameters. Then, based on the gamma parameters, multi-image decomposition is performed on the original image I and its negative image O to form a keyframe sequence, resulting in a gradient image set D. A feature extraction module based on the SE-Net channel attention mechanism is constructed to assign a weight ω to each feature map X in the keyframe sequence of the gradient image set D. i It then performs channel-by-channel multiplication with the original input feature map to output the feature map. feature map Input the constructed multi-scale convolutional module (MCM) and output the defect target detection results.
[0086] Please see Figure 5The terminal device is a computer device. In this embodiment, the computer device 60 includes a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When executed by the processor 61, the computer program 63 implements the method for estimating the concentration of radioactive iodine species in the containment vessel after an accident, as described in this embodiment. To avoid repetition, these details are not elaborated here. Alternatively, when executed by the processor 61, the computer program 63 implements the functions of each model / unit in the casting defect target detection system using adaptive keyframe feature fusion of X-ray images, as described in this embodiment. To avoid repetition, these details are not elaborated here.
[0087] Computer device 60 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. Computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will understand that... Figure 5 This is merely an example of computer device 60 and does not constitute a limitation on computer device 60. It may include more or fewer components than shown, or combine certain components, or different components. For example, computer device may also include input / output devices, network access devices, buses, etc.
[0088] The processor 61 may be a Central Processing Unit (CPU), or other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0089] The memory 62 can be an internal storage unit of the computer device 60, such as a hard disk or RAM of the computer device 60. The memory 62 can also be an external storage device of the computer device 60, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device 60.
[0090] Furthermore, the memory 62 may include both internal storage units of the computer device 60 and external storage devices. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 can also be used to temporarily store data that has been output or will be output.
[0091] Please see Figure 6 The terminal device is an electronic device 600, which is manifested in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including storage unit 620 and processing unit 610), a display unit 640, etc.
[0092] The storage unit stores program code, which can be executed by the processing unit 610 to perform the steps described in the method section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 610 can perform actions such as... Figure 1 The steps are shown in the figure.
[0093] Storage unit 620 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 6201 and / or cache memory 6202, and may further include a read-only memory (ROM) 6203.
[0094] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0095] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.
[0096] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem). This communication can be performed via input / output interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network, wide area network, and / or public network, such as the Internet) via network adapter 660. Network adapter 660 can communicate with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0097] Example 4
[0098] The present invention also provides a storage medium, specifically a computer-readable storage medium, which is a memory device in a terminal device for storing programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and extended storage media supported by the terminal device; it can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor, which can be one or more computer programs (including program code). More specific examples of the computer-readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical fiber, portable compact disk read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.
[0099] Computer-readable storage media also include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium can also be any readable medium other than a readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, radio frequency, etc., or any suitable combination thereof.
[0100] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0101] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the casting defect target detection method with adaptive keyframe feature fusion of ray images in the above embodiments; one or more instructions in the computer-readable storage medium are loaded and executed by the processor in the following steps:
[0102] A gamma parameter extraction network, GPE-Net, is constructed to obtain gamma parameters. Then, based on the gamma parameters, multi-image decomposition is performed on the original image I and its negative image O to form a keyframe sequence, resulting in a gradient image set D. A feature extraction module based on the SE-Net channel attention mechanism is constructed to assign a weight ω to each feature map X in the keyframe sequence of the gradient image set D. i It then performs channel-by-channel multiplication with the original input feature map to output the feature map. feature map Input the constructed multi-scale convolutional module (MCM) and output the defect target detection results.
[0103] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchain. The processors involved in the embodiments provided in this application may be, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc.
[0104] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0105] A typical casting radiographic image dataset was used. This dataset includes 10,000 radiographic images of castings, containing different types of casting defects, such as porosity, cracks, and inclusions. Experimental verification was conducted through the following steps:
[0106] 1.1 Data Preprocessing
[0107] Input image size: The original casting ray image is processed to a size of 512×512 through bilinear interpolation to ensure that the input image has a uniform size, which helps to improve the training efficiency and accuracy of the model.
[0108] Gamma parameter adjustment: The gamma parameters calculated by the extraction network GPE-Net are used to perform gamma transformation on the original image and its negative image to generate a keyframe sequence D (including D1 and D2) to simulate the dynamic evaluation process.
[0109] Generation of gradient image sets: By performing gamma transformation on the input image I, multiple gradient image sets are obtained to enhance the contrast and details of the images, making it easier for the model to identify subtle casting defects during defect detection.
[0110] 1.2 Feature Extraction and Weighting
[0111] By utilizing the SE-Net channel attention mechanism, a weighted operation is performed on each feature map X in the gradient image set. By assigning weights ωi to the feature maps of each channel, adaptive feature selection and fusion are achieved, improving the sensitivity to defect features.
[0112] The weighted feature map is fused with the original feature map through channel-by-channel multiplication, which further enhances the model's ability to learn complex features.
[0113] 1.3 Defect Target Detection
[0114] The weighted feature map is input into the multi-scale convolution module (MCM), which extracts multi-level features through convolution kernels of different scales.
[0115] In convolution operations, dilated convolution is combined with different convolution kernels to learn local and global features in the image, thereby enhancing the ability to detect different types of defects.
[0116] The final output feature map contains the original image, detection type, and defect target detection box, providing detailed defect information.
[0117] Overall performance comparison
[0118] Faster R-CNN 78.2 42.1 8 YOLOv5 (static) 85.6 28.7 45 This invention (GPE+SE+MCM) 93.4 9.3 38
[0119] mAP improved by 7.8%, and keyframe sequences effectively captured dynamic defect features (such as the gradual change process of pores), reducing missed detections in ambiguous areas.
[0120] The small defect false negative rate was reduced to 9.3%, and multi-scale void convolution (5×5 kernel + void ratio 2) enhanced the identification of micron-level cracks.
[0121] Key module ablation experiment
[0122] Baseline (YOLOv5 static) 85.6 7.1 +GPE-Net Dynamic Keyframes 88.9(+3.3) +0.32 +SE-Net channel attention 91.2(+2.3) +0.18
[0123] GPE-Net's function:
[0124] The adaptive gamma transform (γ∈[0.1,1.9]) increases the grayscale difference of low-contrast shrinkage defects by 3 times.
[0125] Negative image processing enhances the contrast of highlight areas (such as metallic inclusions) by 40%.
[0126] SE-Net and MCM in synergy:
[0127] The channel weighting mechanism (with a maximum weight of 0.92) suppresses 90% of texture background interference.
[0128] Multi-scale convolutional fusion of 1×1 / 3×3 / 5×5 features balances the recall rate of defects at different scales.
[0129] In summary, this invention presents a casting defect target detection method based on adaptive keyframe feature fusion of ray-images. By adaptively adjusting the gamma transform of the image, it improves image contrast and detail, making defects more prominent and easier to detect. The introduction of SE-Net enables the model to dynamically weight features from different channels, effectively enhancing the ability to capture complex features. The combination of multi-scale convolutional kernels and dilated convolutions extracts features at different scales, enhancing the ability to identify various defects. Through the combination of multiple technologies, the accuracy and efficiency of casting defect detection are improved. Experimental and practical application results show that this method can effectively improve the accuracy of defect detection, reduce manual intervention, and has high industrial application value.
[0130] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0131] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0132] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0133] In the embodiments provided by this invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0134] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0135] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0136] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random-access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0137] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0138] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0139] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0140] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.
Claims
1. A casting defect target detection method based on adaptive keyframe feature fusion of ray images, characterized in that, Includes the following steps: A gamma parameter extraction network GPE-Net is constructed to obtain gamma parameters. Then, based on the gamma parameters, the original image I and its negative image O are decomposed into a multi-image sequence to form a keyframe sequence, thereby obtaining the gradient image set D. The original image I from the casting ray detection process is bilinearly interpolated to a size of 512×512, then input into the extraction network GPE-Net, which outputs 2n gamma parameters. These n gamma parameters are used to perform a gamma transform on the input image I and its negative O, forming keyframe sequences D1 and D2, simulating dynamic image evaluation. D1 and D2 together form a continuous gradient image set D = (D1, D2). The extraction network GPE-Net initially extracts features from the concatenated feature map through convolution, and then normalizes and introduces nonlinearity using the ReLU activation function, outputting 8-channel 256×256 pixel multi-channel data. Three consecutive Conv-ResNetBlock modules are used to downsample the multi-channel data, and the resulting feature maps are fed into two fully connected layers, outputting gamma parameters between (0.1, 1.9). and ; A feature extraction module based on the SE-Net channel attention mechanism is constructed, assigning a weight ω to each feature map X in the keyframe sequence of the gradient image set D. i It then performs channel-by-channel multiplication with the original input feature map to output the feature map. Specifically: The feature map X from the gradient image set D is input into the squeeze-excitation module SE of the squeeze-excitation network SE-Net, and global average pooling is performed. , For the number of channels, For the set of real numbers, and The feature map is compressed by applying compression to its height and width, respectively, into a vector containing channel information. A non-linear bottleneck structure is then constructed using two fully connected layers to learn the weight ω for each channel. i Generate the final channel weights, complete the feature recalibration, and output the feature map. The first fully connected layer introduces a non-linear mapping; the second fully connected layer restores the dimension to the original number of channels. feature map The input is the constructed multi-scale convolutional module (MCM), and the output is the defect target detection result, specifically: Each feature map The input multi-scale convolution module learns basic features through three parallel 1×1 convolutional kernels; then it learns further features through 1×1, 3×3, and 5×5 convolutional kernels. The 3×3 kernel is used for learning, with different spacing between adjacent weights (dilated convolution). The learned multi-channel features are concatenated and convolved, and the output is then processed through a ReLU activation function to introduce a non-linear mapping, which is then compared with the input feature map. After multiplication, the resulting detection feature map is output, thus completing the detection of the defect target.
2. The method for detecting casting defects by adaptive keyframe feature fusion of ray images according to claim 1, characterized in that, Pixel values of the output image O for: in, I The pixel values of the input image. c It is a constant. γ For gamma value, when γ When the value is greater than 1, the contrast in the high grayscale range increases; when 0 < γ When <1, the contrast in the low grayscale range increases; when γ When the value is 1, the gamma transform has no effect on the image.
3. The casting defect target detection method based on adaptive keyframe feature fusion of ray images according to claim 1, characterized in that, Output feature map for: in, This represents the global average pooling operation. and These correspond to the weight matrices of the two fully connected layers, where δ and σ represent the activation functions ReLU and sigmoid, respectively. This indicates multiplication by channel.
4. The casting defect target detection method based on adaptive keyframe feature fusion of ray images according to claim 1, characterized in that, The detection feature map contains the original image, the detection type, and the defect target detection box.
5. A casting defect target detection system based on adaptive keyframe feature fusion of ray images, characterized in that, include: The image module constructs a gamma parameter extraction network GPE-Net to obtain gamma parameters. Then, based on the gamma parameters, it performs multi-image decomposition on the original image I and its negative image O to form a keyframe sequence, thereby obtaining the gradient image set D. The original image I from the casting ray detection process is bilinearly interpolated to a size of 512×512, then input into the extraction network GPE-Net, which outputs 2n gamma parameters. These n gamma parameters are used to perform a gamma transform on the input image I and its negative O, forming keyframe sequences D1 and D2, simulating dynamic image evaluation. D1 and D2 together form a continuous gradient image set D = (D1, D2). The extraction network GPE-Net initially extracts features from the concatenated feature map through convolution, and then normalizes and introduces nonlinearity using the ReLU activation function, outputting 8-channel 256×256 pixel multi-channel data. Three consecutive Conv-ResNetBlock modules are used to downsample the multi-channel data, and the resulting feature maps are fed into two fully connected layers, outputting gamma parameters between (0.1, 1.9). and ; The computation module constructs a feature extraction module based on the SE-Net channel attention mechanism, assigning a weight ω to each feature map X in the keyframe sequence of the gradient image set D. i It then performs channel-by-channel multiplication with the original input feature map to output the feature map. Specifically: The feature map X from the gradient image set D is input into the squeeze-excitation module SE of the squeeze-excitation network SE-Net, and global average pooling is performed. , For the number of channels, For the set of real numbers, and The feature map is compressed by applying compression to its height and width, respectively, into a vector containing channel information. A non-linear bottleneck structure is then constructed using two fully connected layers to learn the weight ω for each channel. i Generate the final channel weights, complete the feature recalibration, and output the feature map. The first fully connected layer introduces a non-linear mapping; the second fully connected layer restores the dimension to the original number of channels. The detection module will convert the feature map The input is the constructed multi-scale convolutional module (MCM), and the output is the defect target detection result, specifically: Each feature map The input multi-scale convolution module learns basic features through three parallel 1×1 convolutional kernels; then it learns further features through 1×1, 3×3, and 5×5 convolutional kernels. The 3×3 kernel is used for learning, with different spacing between adjacent weights (dilated convolution). The learned multi-channel features are concatenated and convolved, and the output is then processed through a ReLU activation function to introduce a non-linear mapping, which is then compared with the input feature map. After multiplication, the resulting detection feature map is output, thus completing the detection of the defect target.