A valve body weld X-ray image denoising method, system and device
By obtaining the valve body part model and optimizing the X-ray power, combined with the image quality and noise model for denoising, the problem of noise and artifacts in the X-ray image of the valve body weld is solved, and the credibility of the image and the welding quality are improved. Accuracy of judgment.
Patent Information
- Application Number
- CN202111652372.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In the X-ray image inspection of valve body welds, due to the large thickness of the valve body parts, a large dose of X-ray is required, which leads to image noise and artifacts, reducing clarity and credibility. Welding defects and noise are difficult to distinguish, affecting the welding quality. judge.
Determine the thickness of the detection position by obtaining the valve body part model, select appropriate X-ray power for irradiation, perform denoising based on the trained image quality model and noise model, and use the encoder-decoder coupled denoising model and Bayesian Sri Lanka algorithm optimizes the weight coefficient and improves image quality.
It reduces image artifacts, improves the credibility of X-ray images, accurately judges welding quality, evaluates weld image quality through multi-dimensional features, and achieves comprehensive scoring of weld image quality.
Smart Images

Figure CN114332030B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of X-ray image denoising, and more specifically, relates to a valve body weld X-ray image denoising method, system and device. Background Art
[0002] The valve body is an important component in the piping system and is widely used in many industries such as energy, electricity, water conservancy, and chemical industry. Many valve bodies have been in service for a long time in harsh environments. Once damaged, it will cause catastrophic accidents, which puts very high demands on the manufacturing quality of the valve body. Welding is the main method for manufacturing valve bodies. In order to ensure the safety of the valve body, the welding quality of the valve body has extremely high requirements. All welds must be X-rayed to ensure that there are no excessive welding defects.
[0003] When using X-rays to detect the image of valve body welds, on the one hand, due to the large thickness of valve body parts, a large dose of X-rays is often required to penetrate the welds. The use of large doses of X-rays introduces more noise and artifacts to the image, which reduces the clarity and credibility of the X-ray image. On the other hand, valve body welding relies on multi-layer and multi-pass welding by manual arc welding, and the welding quality is difficult to control. During welding, there are many densely distributed tiny welding defects in the overlap area between passes. These tiny welding defects overlap with the noise distribution and are difficult to distinguish, which poses a challenge to the accurate judgment of the valve body welding quality.
[0004] Therefore, a valve body weld X-ray image denoising method is urgently needed to improve the credibility of valve body weld X-ray images. Summary of the invention
[0005] In view of the above defects or improvement needs of the prior art, the present invention provides a valve body weld X-ray image denoising method, system and device, which aims to reduce the noise data in the valve body weld X-ray image and improve the credibility of the X-ray image.
[0006] To achieve the above object, according to a first aspect of the present invention, a valve body weld X-ray image denoising method is proposed, comprising the following steps:
[0007] S1, obtaining a valve body part model, and determining the part thickness at a current detection position based on the valve body part model;
[0008] S2, selecting an X-ray with a corresponding power according to the thickness of the part to irradiate at the current detection position, and obtaining a first detection image of the current detection position;
[0009] S3. Determine feature values of one or more quality features in the first detection image based on the trained picture quality model;
[0010] S4, judging whether the first detection image meets a preset condition based on the characteristic values of the one or more quality characteristics, and not performing subsequent processing on the first detection image that meets the preset condition; and proceeding to step S5 on the first detection image that does not meet the preset condition;
[0011] S5, characterizing the thickness of the part and the selected X-ray power to obtain a noise constraint vector;
[0012] S6. Based on the trained noise model and the noise constraint vector, the first detection image that does not meet the preset conditions is processed to obtain a denoised second detection image; wherein the trained noise model is an encoder-decoder coupled denoising model, the encoder converts the input first detection image into first detection data, and the decoder converts the first detection data into a denoised second detection image based on the first detection data under the constraint of the noise constraint vector.
[0013] As further preferably, judging whether the first detection image meets a preset condition based on the feature values of the one or more quality features includes:
[0014] Obtaining a weight coefficient of each quality feature of the one or more quality features;
[0015] Determining a quality assessment value of the first detection image based on the weight coefficient and feature values of one or more quality features of the first detection image;
[0016] Determine whether the quality evaluation value of the first detection image meets a preset condition.
[0017] As further preferred, obtaining a weight coefficient of each quality feature of the one or more quality features includes:
[0018] Acquire a first test picture set, wherein the first test picture set includes a plurality of first sample pictures with quality assessment labels, wherein the quality assessment labels are used to reflect whether the first sample pictures are suitable for X-ray picture quality assessment;
[0019] Obtaining an initial weight coefficient of each quality feature of the one or more quality features;
[0020] Acquire sample feature values of one or more quality features of each first sample image based on the trained image quality model;
[0021] determining an optimized weight coefficient for each of the one or more quality features based on a Bayesian algorithm and the initial weight coefficient, wherein the optimized weight coefficient makes the quality estimate of each first sample image close to its quality assessment label,
[0022] The quality estimation value of each first sample picture is obtained based on the sample feature value of one or more quality features of the first sample picture and the optimization weight coefficient.
[0023] As further preferred, the trained picture quality model is obtained by the following steps:
[0024] Get the initial model;
[0025] Acquire a first training picture set, where the first training picture set includes a plurality of first sample pictures having label values of the one or more quality features;
[0026] The initial model is trained based on the first training picture set to obtain a trained picture quality model.
[0027] As further preferred, the one or more quality features in the first detection image include a norm, and a label value of the norm is determined according to a trained image analysis model.
[0028] As a further preference, the image quality model and the image analysis model are trained convolutional network models.
[0029] As a further preference, the image quality model and the image analysis model share at least part of the convolutional layers.
[0030] As further preferred, the quality features of the first detection image include one or more of the following features: blurriness of the image, defect superposition ratio in the image, brightness of the image, and shooting angle of the image.
[0031] According to a second aspect of the present invention, a valve body weld X-ray image denoising system is provided, comprising a part thickness acquisition module, a first detection image acquisition module, a quality feature determination module, a feature value judgment module, a noise constraint vector acquisition module, and a second detection image acquisition module, wherein:
[0032] The part thickness acquisition module is used to acquire a valve body part model, and determine the part thickness at the current detection position based on the valve body part model;
[0033] The first detection image acquisition module is used to select X-rays with corresponding power for irradiation according to the thickness of the part at the current detection position to acquire a first detection image of the current detection position;
[0034] The quality feature determination module is used to determine the feature values of one or more quality features in the first detection image based on the trained picture quality model;
[0035] The feature value judgment module is used to judge whether the first detection image meets a preset condition based on the feature values of the one or more quality features;
[0036] The noise constraint vector acquisition module is used to characterize the part thickness and the selected X-ray power to acquire the noise constraint vector;
[0037] The second detection image acquisition module is used to process the first detection image that does not meet the preset conditions based on the trained noise model and the noise constraint vector to obtain a denoised second detection image; wherein the trained noise model is an encoder-decoder coupled denoising model, the encoder converts the input first detection image into first detection data, and the decoder converts the first detection data into a denoised second detection image based on the first detection data under the constraint of the noise constraint vector.
[0038] According to a third aspect of the present invention, a valve body weld X-ray image denoising device is provided, comprising a processor, wherein the processor is used to execute a valve body weld X-ray image denoising method.
[0039] In general, the above technical solution conceived by the present invention has the following technical advantages compared with the prior art:
[0040] 1. The present invention calls out the most appropriate X-ray exposure intensity based on the thickness of the detection position, reduces the exposure dose, and eliminates image artifacts; and evaluates the detection image to be processed according to the eigenvalue, and then encodes the part thickness and the X-ray power of the corresponding power in the form of vectors and eigenvalues and inputs them into the noise model as auxiliary conditions for denoising to perform denoising processing, thereby obtaining a more accurate denoising processing result.
[0041] 2. The present invention optimizes the weight coefficients through the Bayesian algorithm to obtain the most accurate combination of weight coefficients, and then obtains a quality evaluation value based on the combination of weight coefficients to intuitively judge the image quality.
[0042] 3. Based on the image quality model, quality features of multiple dimensions can be output to more accurately measure the quality of the inspection image. At the same time, the norm value is used to intuitively reflect the quality of the image, and then the quality of the weld image is evaluated in multiple different dimensions. That is, the comprehensive scoring of the weld image quality can be achieved by setting the norm. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a schematic diagram of an exemplary application scenario of non-destructive testing of valve body parts after welding according to some embodiments of the present invention;
[0044] Figure 2is a system block diagram of an exemplary valve body weld X-ray image denoising system according to some embodiments of the present invention;
[0045] Figure 3 is a schematic flow chart of a valve body weld X-ray image denoising method according to some embodiments of the present invention;
[0046] Figure 4 is an exemplary flow chart of training a picture quality model according to some embodiments of the present invention;
[0047] Figure 5 is an exemplary flow chart of determining weight coefficients corresponding to quality features according to some embodiments of the present invention;
[0048] Figure 6 It is a model architecture diagram of an image analysis model and an image quality model according to some embodiments of the invention.
[0049] In all the drawings, the same figure numbers are used to represent the same elements or structures, wherein: 110-valve body, 110-1-weld, 120-processing equipment, 120-2-storage device, 130-X-ray transmitter, 140-X-ray receiver, 210-part thickness acquisition module, 220-first detection image acquisition module, 230-quality feature determination module, 240-feature value judgment module, 250-noise constraint vector acquisition module, 260-second detection image acquisition module. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0051] Figure 1 It is a schematic diagram of an exemplary application scenario of post-weld non-destructive testing of valve body parts according to some embodiments of this specification.
[0052] like Figure 1 As shown, the application scenario of post-weld non-destructive testing of valve body parts may include a valve body 110 (with a weld 110 - 1 on the valve body 110 ), a processing device 120 , an X-ray transmitter 130 , and an X-ray receiver 140 .
[0053] In some embodiments, the scene 100 further includes a first motion mechanism (not shown in the figure) and a second motion mechanism (not shown in the figure). The first motion mechanism can be used to connect to the X-ray transmitter 130 to control the X-ray irradiation position. The second motion mechanism can be used to connect to the X-ray receiver and remain opposite to the X-ray transmitter to receive the X-ray signal.
[0054] In some embodiments, the first motion mechanism and the second motion mechanism can be any motion structure. For example, the first motion mechanism can be a 6-axis robot. It should be noted that the motion mechanisms (such as the first motion mechanism and the second motion mechanism) mentioned in one or more embodiments of this specification can be any mechanism that can perform motion / rotation known to those skilled in the art. For example, the first motion mechanism and the second motion mechanism can be 3-axis, 4-axis, 5-axis, 6-axis, and 7-axis robot arms. For another example, the first motion mechanism and the second motion mechanism can be movable mechanisms such as gantry structures and truss structures. For another example, the first motion mechanism and the second motion mechanism can be integrated or independently arranged. In some embodiments, the first motion mechanism and the second motion mechanism can be the same structure or different structures. Such changes are still within the scope of protection of this specification.
[0055] The processing device 120 can be connected to other components in the scene 100 (such as one or more of the X-ray transmitter 130, the X-ray receiver 140, the first motion mechanism, and the second motion mechanism) to obtain and process data and / or information. For example, the processing device 120 can obtain a valve body part model, and determine the thickness of the part at the current detection position based on the valve body part model. For another example, the processing device 120 can select an X-ray of corresponding power for irradiation according to the part thickness at the current detection position, and obtain a first detection image of the current detection position. For another example, the processing device 120 can feature the part thickness and the X-ray power of the selected power, obtain a noise constraint vector, and process the first detection image based on the trained noise model and the noise constraint vector to obtain a denoised second detection image.
[0056] In some embodiments, the processing device 120 may be an independent server or server group. The server group may be centralized or distributed (e.g., the processing device may be a distributed system). In some embodiments, the processing device 120 may be local or remote. In some embodiments, the processing device 120 may be executed on a cloud platform. For example, the cloud platform may include one or any combination of a private cloud, a public cloud, a hybrid cloud, a community cloud, a decentralized cloud, an internal cloud, etc.
[0057] In some embodiments, the processing device 120 may further include a storage device 120-2, and the storage device 120-2 may store data and / or instructions. In some embodiments, the storage device 120-2 may store operation instruction information. In some embodiments, the storage device 120-2 may also store a trained noise model. In some embodiments, the storage device 120-2 may store data and / or instructions used by the processing device 120 to execute or use to complete the exemplary method described in this specification. In some embodiments, the storage device 120-2 may include a large capacity memory, a removable memory, a volatile read-write memory, a read-only memory (ROM), etc. or any combination thereof. Exemplary large capacity storage may include a magnetic disk, an optical disk, a solid state disk, etc.
[0058] In some embodiments, scene 100 may also include a network (not shown). The network may be connected to one or more components in scene 100 to facilitate the exchange of information and / or data. In some embodiments, the network may be any form of wired or wireless network or any combination thereof. By way of example only, the network may include a cable network, a wired network, a fiber optic network, a telecommunications network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a wide area network (WAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, a near field communication (NFC) network, a global system for mobile communications (GSM) network, a code division multiple access (CDMA) network, a time division multiple access (TDMA) network, a general packet radio service (GPRS) network, an enhanced data rate GSM Evolution (EDGE) network, Wideband Code Division Multiple Access (WCDMA) network, High Speed Downlink Packet Access (HSDPA) network, Long Term Evolution (LTE) network, User Datagram Protocol (UDP) network, Transmission Control Protocol / Internet Protocol (TCP / IP) network, Short Message Service (SMS) network, Wireless Application Protocol (WAP) network, Ultra-Wideband (UWB) network, mobile communication (1G, 2G, 3G, 4G, 5G) network, Wi-Fi, Li-Fi, Narrowband Internet of Things (NB-IoT), etc. or any combination thereof.
[0059] Figure 2 2 is a system block diagram of an exemplary valve body weld X-ray image denoising system according to some embodiments of the present specification. In some embodiments, the system 200 may be specifically disposed on the processing device 120 .
[0060] like Figure 2As shown, the system 200 may include: a part thickness acquisition module 210, a first detection image acquisition module 220, a quality feature determination module 230, a feature value judgment module 240, a noise constraint vector acquisition module 250, and a second detection image acquisition module 260. In some embodiments, the system 200 may be provided on the processing device 120.
[0061] A part thickness acquisition module 210 is used to acquire a valve body part model and determine the part thickness at a current detection position based on the valve body part model;
[0062] The first detection image acquisition module 220 is used to select X-rays with corresponding power according to the thickness of the part at the current detection position to irradiate and obtain a first detection image at the current detection position;
[0063] A quality feature determination module 230, configured to determine feature values of one or more quality features in the first detection image based on the trained picture quality model;
[0064] A feature value judgment module 240 is used to judge whether the first detection image meets a preset condition based on the feature values of one or more quality features;
[0065] A noise constraint vector acquisition module 250 is used to characterize the thickness of the part and the X-ray power of the selected power to acquire a noise constraint vector;
[0066] The second detection image acquisition module 260 is used to process the first detection image that does not meet the preset conditions based on the trained noise model and the noise constraint vector to obtain a denoised second detection image; wherein the trained noise model is an encoder-decoder coupled denoising model, the encoder converts the input first detection image into first detection data, and the decoder converts the first detection data into a denoised second detection image based on the first detection data under the constraint of the noise constraint vector.
[0067] In some embodiments, one or more quality features in the first detection image include a norm, and the trained image quality model is obtained by the following steps: obtaining an initial model; obtaining a first training image set, the first training image set including multiple first sample images with label values of one or more quality features, wherein the label value of the norm is determined according to the trained image analysis model; and training the initial model based on the first training image set to obtain a trained image quality model.
[0068] In some embodiments, the picture quality model and the picture analysis model are trained CNNs (convolutional network models).
[0069] In some embodiments, the picture quality model and the picture analysis model share at least some convolutional layers.
[0070] In some embodiments, the feature value judgment module 240 is also used to: obtain a weight coefficient for each quality feature of one or more quality features; determine a quality assessment value of the first detection image based on the weight coefficient and the feature values of one or more quality features of the first detection image; and determine whether the quality assessment value of the first detection image meets a preset condition.
[0071] In some embodiments, the feature value judgment module 240 is also used to: obtain a first test image set, the first test image set includes multiple first sample images with quality assessment labels, the quality assessment labels are used to reflect whether the first sample images are suitable for X-ray image quality assessment; obtain an initial weight coefficient for each quality feature in one or more quality features; obtain sample feature values of one or more quality features of each first sample image based on a trained image quality model; and determine an optimized weight coefficient for each quality feature in one or more quality features based on a Bayesian algorithm and the initial weight coefficient, the optimized weight coefficient makes the quality estimate of each first sample image close to its quality assessment label, wherein the quality estimate of each first sample image is obtained based on the sample feature values of one or more quality features of the first sample image and the optimized weight coefficient.
[0072] In some embodiments, the quality features of the first detection image include one or more of the following features: blurriness of the image, defect superposition ratio in the image, brightness of the image, and shooting angle of the image.
[0073] It should be understood that the system and its modules in one or more implementations of this specification can be implemented in various ways. For example, in some embodiments, the system and its modules can be implemented by hardware, software, or a combination of software and hardware. Among them, the hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or a dedicated design hardware. Those skilled in the art will understand that the above methods and systems can be implemented using computer executable instructions and / or included in processor control codes, such as such as carrier media such as disks, CDs or DVD-ROMs, programmable memories such as read-only memories (firmware), or data carriers such as optical or electronic signal carriers. Such codes are provided on. The system and its modules of this specification can not only be implemented by hardware circuits such as ultra-large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., but can also be implemented by software such as executed by various types of processors, and can also be implemented by a combination of the above hardware circuits and software (e.g., firmware).
[0074] Figure 3300 is a schematic flow chart of a valve body weld X-ray image denoising method according to some embodiments of the present specification. In some embodiments, the method 300 may be performed by the processing device 120. In some embodiments, the method 300 may be further performed by the system 200.
[0075] Step 310 (ie S1 ), obtaining a valve body part model, and determining the part thickness at the current detection position based on the valve body part model.
[0076] In some embodiments, step 310 may be performed by the part thickness acquisition module 210 .
[0077] The part thickness acquisition module 210 can acquire the current detection position of the X-ray emitter 130, and then determine the part thickness at the current detection position in combination with the valve body part model. In some embodiments, the current detection position can be acquired by an external device / equipment. For example, the part thickness acquisition module 210 can acquire the relative position of the X-ray emitter 130 with respect to the valve body part through an external CCD, camera, rangefinder or other measuring component, and then obtain the current detection position of the X-ray emitter 130.
[0078] In some embodiments, the X-ray transmitter can automatically measure all welds of the entire valve body based on a preset trajectory. In an embodiment of this scenario, the current detection position can be obtained through the trajectory program of the mechanical motion device connected to the X-ray transmitter. For example, assuming that the X-ray transmitter 130 moves based on a 6-axis robot, and the 6-axis robot realizes the motion trajectory of the X-ray generator based on a set program, at this time, the part thickness acquisition module 210 can determine the current detection position based on the execution section of the current robot program, and then retrieve the part thickness based on the current detection position combined with the part digital model.
[0079] Step 320 (ie S2), select X-rays with corresponding power according to the thickness of the part to irradiate at the current detection position, and obtain a first detection image of the current detection position.
[0080] In some embodiments, step 320 may be performed by the first detection image acquisition module 220 .
[0081] The first detection image acquisition module 220 can call the X-ray of corresponding power to irradiate the part according to the thickness of the part obtained in step 310. It can be understood that when the X-ray power is too low, the X-ray cannot penetrate the valve body part, and an accurate X-ray detection image cannot be obtained; and when the X-ray power is too high, an excessive dose of X-ray will not only cause safety hazards to the human body, but also bring more image artifacts and image noise to the captured image, making it impossible for the staff to accurately judge the welding defects in the X-ray image.
[0082] Therefore, in some embodiments, the first detection image acquisition module 220 can retrieve a suitable X-ray power range through the part thickness at the current detection position obtained in step 310, and notify the X-ray transmitter 130 to execute it. After the execution is completed, the X-ray receiver 140 will send the received image data to the first detection image acquisition module 220, and the first detection image acquisition module 220 will then obtain the first detection image by image reproduction based on the image data. In this way, the first detection image acquisition module 220 can use different X-ray powers for parts with different thicknesses to minimize artifacts and noise in the captured image.
[0083] Step 330 (ie, S3), determining feature values of one or more quality features in the first detection image based on the trained picture quality model.
[0084] In some embodiments, step 330 may be performed by the quality characteristic determination module 230 .
[0085] The picture quality model refers to a model used to determine the quality of the first detected image. In some embodiments, the picture quality model can be a machine learning model. Preferably, the picture quality model can be a convolutional neural network model (CNN).
[0086] In some embodiments, the image quality model may output corresponding quality features of multiple dimensions based on the input first detection image. Quality features refer to features used to measure the quality of an image. In some embodiments, the quality features of the first detection image may include one or more of the following features: blurriness D1 of the image, defect superposition ratio D2 in the image, brightness D3 of the image, and shooting angle D4 of the image.
[0087] The blurriness D1 of the image refers to the blurriness of the weld contour when the image is taken. The blurriness of the image is negatively correlated with the image quality. The higher the blurriness of the first detection image, the blurrier the first detection image, the lower the clarity, and the lower the image quality.
[0088] The defect superposition ratio D2 in the image refers to the ratio of the occlusion area between defects and / or the overlap between defects and noise relative to the total area. The defect superposition ratio in the image is negatively correlated with the image quality. The higher the defect superposition ratio in the first detection image, the greater the probability that the defects in the first detection image are blocked and the lower the image quality.
[0089] Brightness refers to the brightness of the image D3. The brightness of the image is positively correlated with the image quality. The greater the brightness of the first detection image, the greater the brightness of the first detection image and the higher the image quality.
[0090] The shooting angle D4 refers to the angle of the X-generating device 130 relative to the weld (i.e., the acquisition angle of the first detection image). The shooting angle may include a yaw angle and a pitch angle. The yaw angle and the pitch angle refer to the angles between the image acquisition device and the acquisition target area on the horizontal plane and perpendicular to the horizontal plane, respectively. Usually, the yaw angle and the pitch angle of the shooting angle facing the acquisition target area can be set to 0°. In the technical field of image analysis, the smaller the shooting angle, the more accurate the feature points collected by the image acquisition device, and the better the quality of the picture; conversely, the larger the picture shooting angle, the greater the impact on the picture quality. In other words, the picture shooting angle is negatively correlated with the picture quality.
[0091] In some embodiments, the quality feature also includes a norm D5. The norm refers to a norm function, which can be calculated by any two or more quality features mentioned above. In the embodiments of the present application, the norm can be understood as the length of two or more quality features from the origin in the vector space, which can be used to comprehensively evaluate the quality of the first detection image.
[0092] As an example only, the norm D5 can be calculated by two quality features: the blurriness D1 of the first sample image and the defect superposition ratio D2 in the image. The calculation formula is as follows:
[0093]
[0094] In the embodiment of this scenario, the norm is the distance between the blur and the occlusion ratio in the vector space and the zero point. Obviously, the larger the norm, the greater the blur of the image or the greater the defect superposition ratio in the image, and the worse the image quality. Obviously, the norm value can be used to intuitively reflect the quality of the image, and then the quality of the weld image can be evaluated in multiple different dimensions. In other words, the comprehensive scoring of the weld image quality is achieved by setting the norm.
[0095] Step 340 (ie S4), judging whether the first detection image meets a preset condition based on the characteristic values of one or more quality characteristics.
[0096] In some embodiments, step 340 may be performed by the feature value determination module 240 .
[0097] In some embodiments, the feature value judgment module 240 can judge whether the first detection image meets the preset conditions based on the feature value of a quality feature. For example, the feature value judgment module 240 can compare the feature value of the first detection image with the preset threshold to judge whether the first detection image meets the preset conditions. As an example only, the feature value judgment module 240 can obtain the quality feature of the first detection image as the defect superposition ratio in the image. Assuming that the feature value of the quality feature is 85% and the preset threshold is 80%, since the quality feature is positively correlated with the image quality, the feature value of the first detection image is greater than the preset threshold, and it can be determined that the first detection image meets the preset conditions.
[0098] In some embodiments, the feature value judgment module 240 can judge whether the first detection image meets the preset conditions based on the feature values of multiple quality features. For example, the feature value judgment module 240 can judge based on the two quality features of the defect superposition ratio in the picture and the blurriness of the picture. Continuing with the previous example, the feature value of the defect superposition ratio in the picture is 85%, which meets the requirements. The feature value judgment module 240 can obtain the blurriness of the picture as 20. Assuming that the preset threshold corresponding to the blurriness of the picture is 5, it means that the feature value of the quality feature does not meet the requirements. Therefore, the feature value judgment module 240 can judge that the first detection image does not meet the preset conditions through the feature values of the above two quality features. In this way, the feature values of multiple quality features can be used to jointly determine whether the first detection image meets the preset conditions, so that the feature value judgment module 240 can make a more comprehensive and accurate judgment.
[0099] In some embodiments, the feature value judgment module 240 can obtain the quality evaluation value K based on the multiple quality features corresponding to the first detection image by giving different quality features corresponding weight coefficients w1-w5. The calculation formula is as follows:
[0100] K=w1×D1+w2×D2+w3×D3+w4×D4+w5×D5;
[0101] For example, the first detection image may include three quality features, and the picture quality model may give weight values of 0.5, 0.3, and 0.2 to the above three quality features respectively to obtain the quality evaluation value K.
[0102] In actual operation, since different quality features have different effects on the quality of the image, in some embodiments, the weights w1-w5 corresponding to the multiple quality features may be different to reflect the importance of each quality feature. Taking the quality features including the defect superposition ratio and the image brightness in the image as an example, for the above two quality features, the effect of the defect superposition ratio D2 in the image on the weld quality judgment is greater than the effect of the image brightness D3 on the weld quality judgment, and the weight value w2 of the defect superposition ratio should be greater than the weight value w3 of the image brightness.
[0103] In some embodiments, a Bayesian search algorithm may be used to obtain weights w1-w5 corresponding to different features. A Bayesian search algorithm refers to an algorithm that uses Bayesian statistical theory to search. For example, a Bayesian search algorithm may be used to quickly and accurately determine the weights of multiple quality features on image quality. For more details on using a Bayesian algorithm to obtain weights corresponding to different features, see Figure 5 And the related description will not be repeated here.
[0104] Step 350 (ie S5), characterize the thickness of the part and the selected X-ray power to obtain a noise constraint vector.
[0105] In some embodiments, step 350 may be performed by the noise constraint vector acquisition module 250 .
[0106] In some embodiments, the noise constraint vector can be encoded in a vector, eigenvalue, or the like. For example, binary encoding, embedding encoding, or the like. Preferably, the noise constraint vector can be obtained by one-hot encoding. One-hot encoding can be used to convert the part thickness and the selected X-ray power into a vector of fixed length, so that the noise constraint vector can be directly spliced into the decoder input.
[0107] It can be understood that during the X-ray detection process, when the material of the valve body and the external lighting conditions are similar, the intensity and distribution of the noise mainly depend on the X-ray irradiation intensity and the thickness of the current detection position. In other words, for two welds of the same thickness and the same irradiation intensity, the noise level and noise distribution of the obtained image should be similar. Therefore, the noise constraint vector acquisition module 350 can encode the part thickness and the selected power of the X-ray power in the form of vectors and eigenvalues and input them into the noise model as auxiliary conditions for denoising to perform denoising processing.
[0108] Step 360 (ie, S6), the first detection image is processed based on the trained noise model and the noise constraint vector to obtain a denoised second detection image.
[0109] In some embodiments, step 360 may be performed by the second detection image acquisition module 360 .
[0110] The trained noise model is an encoder-decoder coupled denoising model. The encoder converts the input first detection image into first detection data, and the decoder converts the first detection data into a denoised second detection image based on the first detection data under the constraint of a noise constraint vector.
[0111] Specifically, correcting the first detection image based on the noise model includes the following steps:
[0112] 1) Obtain the eigenvector in the first detection image through the encoder part in the noise model. It can be understood that the encoder is equivalent to a machine model that converts a picture into an eigenvector or a matrix. Specifically, the encoder can encode based on the picture features such as picture boundaries, pixels, colors, etc. in the first detection image to obtain the eigenvector (or matrix) corresponding to the first detection image. As an example only, the eigenvector obtained by the encoder includes rows and columns, and each matrix element in the vector can have a different assignment; then correspondingly, the row of the eigenvector can correspond to the length of the first detection image, the column of the eigenvector can correspond to the width of the first detection image, and the assignment of the matrix elements in the eigenvector represents the grayscale or color value of the image.
[0113] 2) Input the feature vector in the first detection image output by the encoder into the decoder to obtain the second detection image output by the generator that satisfies the noise constraint vector. It can be understood that the work of the decoder is opposite to that of the encoder, and it actually generates a detection image from a feature vector (or matrix). The difference is that before the decoder obtains the image based on the feature vector, it needs to recompile the feature vector corresponding to the first detection image output by the encoder according to the noise constraint vector. It can be understood that the recompiling process is a matrix transformation process based on the noise constraint vector. After the transformation is completed, the feature vector (or matrix) corresponding to the second weld image is generated. Further, based on the feature vector (or matrix) corresponding to the second detection image, the corresponding rows, columns and matrix elements in the feature vector (or matrix) are decoded into the picture features such as the boundary, pixel, color, etc. of the picture, and the second detection image can be obtained. In some embodiments, before the feature vector corresponding to the first detection image is recompiled, the noise constraint vector needs to be reshaped so that the feature vector corresponding to the noise constraint vector is the same size as the feature vector corresponding to the first detection image.
[0114] Figure 4 This is an exemplary flowchart for training the image quality model according to some embodiments of this specification.
[0115] Step 410, obtaining an initial model.
[0116] The initial model refers to the initial picture quality model, including initialized model parameters and a complete model structure. In some embodiments, the initial model can be an untrained convolutional neural network or an untrained convolutional neural network. Each layer of the initial model can be set with initial parameters, and the parameters can be continuously adjusted during the training process until the training is completed.
[0117] Step 420: Obtain a first training picture set.
[0118] The first training picture set refers to a training sample set used to train the initial model. In some embodiments, the first training picture set may include multiple first sample pictures with one or more quality feature label values. As mentioned above, the quality feature may include one or more of the blurriness D1 of the picture, the defect superposition ratio D2 in the picture, the brightness D3 of the picture, and the shooting angle D4 of the picture. In some embodiments, the first sample picture also includes a norm label value. For the calculation method of the norm, see Figure 3 The corresponding description is not repeated here.
[0119] The label values in the training sample set can be manually annotated. For example, the blurriness D1 and brightness D3 of the first sample image are manually annotated. In some embodiments, the first training image set can also be automatically annotated by the corresponding machine learning model. Exemplarily, the norm value label can be obtained by a trained image analysis model. Specifically, the image analysis model can be a trained convolutional neural network model (CNN model), and the image analysis model can be trained based on the manually annotated norm label value, so as to directly establish a mapping relationship between the norm value and the input image; compared with the image quality model, the image analysis model has a smaller structure and higher training efficiency.
[0120] Step 430: Train the initial model based on the first training picture set to obtain a trained picture quality model.
[0121] In some embodiments, the image quality model is a convolutional neural network model. In some embodiments, the image analysis model and the image quality model share some convolutional layers. The model architecture of the image analysis model and the image quality model is as follows: Figure 6 shown.
[0122] The image analysis model and the image quality model can share some convolutional layers (such as Figure 6 In the convolution layers 1 to i) shown in FIG. 1 , for example, the shared part of the convolution layers may be feature extraction layers. The feature extraction layer may correspond to a feature sub-image in the output image based on the input image matrix. The image analysis model and the image quality model further perform forward propagation based on the feature sub-images to obtain different prediction results.
[0123] Specifically, the input of the feature extraction layer can be a picture matrix corresponding to the pictures in the first training picture set. For example, the rows of the picture matrix can correspond to the height of the weld picture, the columns of the picture matrix can correspond to the width of the weld picture, and the elements of the picture matrix can correspond to the pixels of the weld picture. In some embodiments, when the picture is a grayscale picture, the elements of the picture matrix can correspond to the grayscale values of the grayscale picture. In some other embodiments, when the picture is a color picture, the elements of the picture matrix correspond to the RGB (Red Green Blue) values of the color picture. The feature extraction layer further converts the input picture matrix into feature sub-images corresponding to several local features.
[0124] Furthermore, the image analysis model performs forward propagation based on the convolutional layers c, ...k, j to obtain the label value of the norm; while the image quality model performs processing based on different convolutional layers m, ..., f, g to output the blur prediction value, defect overlay ratio prediction value, brightness prediction value, shooting angle prediction value and norm prediction value respectively.
[0125] Furthermore, the fully connected layer can connect all the obtained fuzziness prediction values, defect superposition ratio prediction values, brightness prediction values, shooting angle prediction values, and norm prediction values, and use activation functions (such as sigmoid, tanh, etc.) to compress the prediction results to obtain the total prediction result H. During back propagation, the label value should also be compressed according to the activation function to obtain Based on Constructing a loss function. In some embodiments, different loss functions can be selected according to the type of model, such as using a mean square error loss function or a cross entropy loss function as a loss function, etc., which is not limited in this specification.
[0126] After obtaining the loss value Loss, the back propagation algorithm can be used to determine the update amplitude of each weight of the model. In other words, the back propagation algorithm can determine the change of the loss function relative to each weight (also called gradient or error derivative), which is recorded as Furthermore, the gradient back propagation algorithm can pass the value of the loss function through the output layer, back propagate to the hidden layer and the input layer layer by layer, and determine the correction value (or gradient) of the model parameters of each layer in turn. Among them, the correction value (or gradient) of the model parameters of each layer includes multiple matrix elements (such as gradient elements), which correspond to the model parameters one by one, and each gradient element reflects the correction direction (increase or decrease) and correction amount of the parameter.
[0127] In this way, the parameters set for each layer of the initial model can be continuously updated through sample images in the first training image set until the updated convolutional neural network model can characterize the correspondence between the images in the first training image set and the quality features, thereby obtaining a trained image quality model.
[0128] Figure 5 It is an exemplary flow chart of determining weight coefficients corresponding to quality features according to some embodiments of this specification.
[0129] Step 510: Obtain a first test picture set.
[0130] In some embodiments, the first test image set may include multiple second sample images with quality assessment labels. The quality assessment label refers to a label in the second sample image that indicates the image quality, which can be used to reflect whether the second sample image is suitable for weld assessment. Specifically, the quality assessment label can be a number between 0 and 1, and the larger the number of the quality assessment label, the more suitable the second sample image with the quality assessment label is for weld assessment.
[0131] Step 520: Obtain an initial weight coefficient of each quality feature in the one or more quality features.
[0132] The initial weight coefficient can reflect the importance of each quality feature among multiple quality features for the image to be suitable for weld assessment. For example, for the two quality features of defect superposition ratio in the image and image brightness, the importance of defect superposition ratio in the image to weld assessment is greater than that of image brightness. Therefore, the initial weight coefficient corresponding to defect superposition ratio in the image is relatively greater than the initial weight coefficient corresponding to image brightness.
[0133] Step 530: Obtain sample feature values of one or more quality features of each second sample image based on the trained image quality model.
[0134] The sample feature value is used to represent the specific value of each quality feature in the second sample image, which can be obtained based on the trained image quality model. For more information about quality features, see Figure 3 The corresponding description will not be repeated here.
[0135] Step 540 : determining an optimized weight coefficient of each quality feature of the one or more quality features based on the Bayesian algorithm and the initial weight coefficient.
[0136] To obtain the optimized weight coefficient, the optimized weight value can be obtained through Bayesian search based on the sample feature value obtained in the second sample image, wherein the optimized weight value makes the quality assessment value obtained based on the sample feature value and the optimized weight value close to the quality assessment label of the training sample.
[0137] In some embodiments, the optimization weight coefficient can be linear. In some embodiments, the sum of the weight coefficients corresponding to multiple quality features can be set to 1. As an example only, the optimization weight coefficients corresponding to the three quality features of image brightness, image blur, and defect superposition ratio in the image can be searched based on the Bayesian algorithm, and the optimization weight coefficients corresponding to the three can be set to 0.2, 0.4, and 0.4. Obviously, the sum of the three is 1. When the sum of the weight coefficients is set to 1, it is convenient to calculate and determine the quality estimate based on the weight coefficients. In some alternative embodiments, the optimization weight coefficients can also be set nonlinearly.
[0138] In some embodiments, the optimized weight coefficient of each quality feature in one or more quality features can be determined based on the Bayesian algorithm and the initial weight coefficient. Specifically, the following steps are included: 1) pre-dividing the weight coefficient into a high probability area, a medium probability area and a low probability area, and then constructing a Bayesian search path, which can start from the high probability area, pass through the medium probability area, and finally search the low probability area; 2) inputting a set of weights in the Bayesian search path, and returning the accuracy of this set of weights on the first test picture set; 3) updating the allocation of the high probability area, the medium probability area and the low probability area initially divided based on the change of the accuracy in the previous step, and performing the next set of weights based on the Bayesian search path; 4) repeating steps 2 to 3 multiple times until the probability change is less than a certain threshold, and then the optimal weight combination form is obtained.
[0139] It can be understood that the optimized weight coefficient can make the quality estimation value of the second sample picture in the first test picture set as close as possible to its quality assessment label. Specifically, the quality estimation value of the second sample picture can be summed based on the optimized weight coefficient corresponding to each quality feature multiplied by its corresponding sample feature value.
[0140] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A valve body weld X-ray image denoising method, characterized in that: The steps include: S1, obtaining a valve body part model, and determining the part thickness at a current detection position based on the valve body part model; S2, selecting an X-ray with a corresponding power according to the thickness of the part to irradiate at the current detection position, and obtaining a first detection image of the current detection position; S3. Determine feature values of one or more quality features in the first detection image based on the trained picture quality model; S4, judging whether the first detection image meets a preset condition based on the characteristic values of the one or more quality characteristics, and not performing subsequent processing on the first detection image that meets the preset condition; and proceeding to step S5 on the first detection image that does not meet the preset condition; S5, characterizing the thickness of the part and the selected X-ray power to obtain a noise constraint vector; S6. Based on the trained noise model and the noise constraint vector, the first detection image that does not meet the preset conditions is processed to obtain a denoised second detection image; wherein the trained noise model is an encoder-decoder coupled denoising model, the encoder converts the input first detection image into first detection data, and the decoder converts the first detection data into a denoised second detection image based on the first detection data under the constraint of the noise constraint vector.
2. The valve body weld X-ray image denoising method according to claim 1, characterized in that: Judging whether the first detection image meets a preset condition based on the feature values of the one or more quality features includes: Obtaining a weight coefficient of each quality feature of the one or more quality features; Determining a quality assessment value of the first detection image based on the weight coefficient and feature values of one or more quality features of the first detection image; Determine whether the quality evaluation value of the first detection image meets a preset condition.
3. The valve body weld X-ray image denoising method according to claim 2, characterized in that: Obtaining a weight coefficient of each quality feature of the one or more quality features includes: Acquire a first test picture set, wherein the first test picture set includes a plurality of first sample pictures with quality assessment labels, wherein the quality assessment labels are used to reflect whether the first sample pictures are suitable for X-ray picture quality assessment; Obtaining an initial weight coefficient of each quality feature of the one or more quality features; Acquire sample feature values of one or more quality features of each first sample image based on the trained image quality model; determining an optimized weight coefficient for each of the one or more quality features based on a Bayesian algorithm and the initial weight coefficient, wherein the optimized weight coefficient makes the quality estimate of each first sample image close to its quality assessment label, The quality estimation value of each first sample picture is obtained based on the sample feature value of one or more quality features of the first sample picture and the optimization weight coefficient.
4. The valve body weld X-ray image denoising method according to claim 1, characterized in that: The trained picture quality model is obtained by the following steps: Get the initial model; Acquire a first training picture set, where the first training picture set includes a plurality of first sample pictures having label values of the one or more quality features; The initial model is trained based on the first training picture set to obtain a trained picture quality model.
5. The valve body weld X-ray image denoising method according to claim 4, characterized in that: The one or more quality features in the first detection image include a norm, and a label value of the norm is determined according to a trained image analysis model.
6. The valve body weld X-ray image denoising method according to claim 5, characterized in that: The picture quality model and the picture analysis model are trained convolutional network models.
7. The valve body weld X-ray image denoising method according to claim 6, characterized in that: The picture quality model and the picture analysis model share at least some convolutional layers.
8. The valve body weld X-ray image denoising method according to any one of claims 1 to 7, characterized in that: The quality features of the first detection image include one or more of the following features: blurriness of the image, defect superposition ratio in the image, brightness of the image, and shooting angle of the image.
9. A valve body weld X-ray image denoising system, characterized in that: It includes a part thickness acquisition module, a first detection image acquisition module, a quality feature determination module, a feature value judgment module, a noise constraint vector acquisition module, and a second detection image acquisition module, wherein: The part thickness acquisition module is used to acquire a valve body part model, and determine the part thickness at the current detection position based on the valve body part model; The first detection image acquisition module is used to select X-rays with corresponding power for irradiation according to the thickness of the part at the current detection position to acquire a first detection image of the current detection position; The quality feature determination module is used to determine the feature values of one or more quality features in the first detection image based on the trained picture quality model; The feature value judgment module is used to judge whether the first detection image meets a preset condition based on the feature values of the one or more quality features; The noise constraint vector acquisition module is used to characterize the part thickness and the selected X-ray power to acquire the noise constraint vector; The second detection image acquisition module is used to process the first detection image that does not meet the preset conditions based on the trained noise model and the noise constraint vector to obtain a denoised second detection image; wherein the trained noise model is an encoder-decoder coupled denoising model, the encoder converts the input first detection image into first detection data, and the decoder converts the first detection data into a denoised second detection image based on the first detection data under the constraint of the noise constraint vector.
10. A valve body weld X-ray image denoising device, characterized in that: It includes a processor, which is used to execute the valve body weld X-ray image denoising method as described in any one of claims 1-8.
