Method and apparatus for grain size rating of polycrystalline materials
By automatically determining the grain profile of polycrystalline materials using a convolutional neural network model and combining it with the evaluation mechanism, the problem of relying on manual experience for grain size detection in existing technologies is solved, and efficient and accurate grain size rating is achieved.
Patent Information
- Application Number
- CN202010914631.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-03
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2040-09-03
AI Technical Summary
In existing technologies, the grain size detection of polycrystalline materials relies on human experience, which leads to the test results being greatly affected by subjective factors, resulting in low efficiency and low detection accuracy.
A contour extraction model based on a convolutional neural network is used to process the grain images, automatically determine the grain contours, and combine them with preset evaluation mechanisms and rules to achieve a grain size rating.
It reduces reliance on human experience, improves the efficiency and accuracy of grain size rating, and achieves objective grain size detection.
Smart Images

Figure CN114140370B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence (AI), and more particularly, to a method and device for grain size rating of a polycrystalline material. BACKGROUND
[0002] Artificial intelligence (AI) is a branch of computer science that studies the design principles and implementation methods of various intelligent machines, so that the machines have perception, reasoning and decision-making functions like humans.
[0003] Computer vision is an implementation of artificial intelligence, which is applied in various application fields such as manufacturing, inspection, document analysis, medical diagnosis, and military fields. It is a discipline about how to use cameras and computers to obtain the data and information we need. In a figurative way, it is to install eyes (cameras) and brains (algorithms) on computers to replace human eyes to identify, track and measure targets, so that computers can perceive the environment. In general, computer vision is to use various imaging systems (such as cameras) to replace visual organs to obtain input information, and then use computers to replace brains to process and interpret the input information.
[0004] Polycrystalline materials such as steel need to be tested for multiple quality before leaving the factory, among which, metallographic testing has a huge demand. Grain size testing is part of metallographic testing. The number of images to be tested by grain size testing is huge every year.
[0005] According to the grain image, the contour of the grain can be determined to achieve relatively accurate grain size detection. However, in the process of determining the grain contour, the tester needs to set parameters according to experience, so the test result is greatly affected by the subjective factors of the tester, and the test efficiency is low. An intelligent rating scheme is urgently needed that can quickly perform grain size rating and the rating process is objective and the grain size result is accurate. SUMMARY
[0006] The present application provides a method and device for grain size rating of a polycrystalline material, which can determine the grain contour according to the grain image, avoiding the dependence on artificial experience.
[0007] In a first aspect, a method for grain size rating of a polycrystalline material is provided, which can be executed by an electronic device. Specifically, a grain image can be obtained, and a contour extraction model can be used to process the grain image to determine the grain contour of the grain image. Finally, according to the grain contour, the grain size level of the grain image is determined.
[0008] The grain image is processed by the contour extraction model to determine the grain contour for grain size rating, which can reduce the dependence on manual experience in the grain size rating process and improve the efficiency of grain size rating while achieving high rating accuracy.
[0009] In some possible implementation manners, in combination with the first aspect, the grain image is processed by the contour extraction model to determine the grain contour of the grain image, including: inputting the grain image to the contour extraction model, where the contour extraction model is a pre-trained artificial intelligence (AI) model; and extracting the grain contour of the grain image according to the contour extraction model to obtain the grain contour of the grain image.
[0010] The AI model is used to extract the grain contour of the grain image, which reduces the dependence on manual experience in the grain size rating process and improves the efficiency of grain size rating.
[0011] In some possible implementation manners, in combination with the first aspect, the method further includes: obtaining a labeled contour of the grain size image; extracting a first feature of the labeled contour and a second feature of the grain contour by using a feature extraction model; and adjusting parameters of the contour extraction model according to a difference between the first feature and the second feature.
[0012] The first feature of the labeled contour can reflect the spatial structure of the labeled contour, and the second feature of the grain contour can reflect the spatial structure of the grain contour. According to the difference between the spatial structures of the first feature and the second feature, the parameters of the contour extraction model are adjusted, so that the spatial structure of the grain contour output by the contour extraction model is more accurate, thereby making the grain size detection result based on the grain contour more accurate.
[0013] In some possible implementation manners, in combination with the first aspect, the labeled contour is obtained by adjusting the grain contour.
[0014] The grain contour output by the contour extraction model can be manually determined for defects, and the first training contour is modified to obtain the labeled contour in the case of defects. The workload of manual labeling is reduced, and as the parameter adjustment of the contour extraction model is performed, the workload of manual labeling is also continuously reduced.
[0015] In some possible implementation manners, in combination with the first aspect, the contour extraction model includes an encoder and a decoder, and the feature extraction model includes the encoder.
[0016] The encoder can be used to extract features of the input grain image, and the decoder is used to process the features output by the encoder to obtain the grain contour.
[0017] The encoder of the contour extraction model is used as a feature extraction model, without the need to retrain the feature extraction model, thereby reducing the difficulty of the training process.
[0018] In some possible implementation manners, according to the first aspect, the determining of the grain size level of the grain image according to the grain contour includes: determining the grain size level of the grain image according to the grain contour by using a preset evaluation mechanism and / or rule; or determining the grain size level of the grain image by comparing the grain contour with a standard rating map.
[0019] The preset evaluation mechanism and / or rule may be, for example, a national standard, an enterprise standard, or the like. The determination of the grain size level by using the preset evaluation mechanism and / or rule can further reduce the dependence on artificial experience in the grain size level detection process. The comparison of the grain contour with the standard rating map is also an effective way for determining the grain size level.
[0020] In some possible implementation manners, according to the first aspect, the method includes: obtaining a training grain image and a labeled contour of the training grain image; inputting the training grain image into an initial contour extraction model to obtain a training contour of the training grain image; and adjusting parameters of the initial contour extraction model according to a difference between the labeled contour and the training contour, to obtain the contour extraction model.
[0021] In a second aspect, a grain size rating device of a polycrystalline material is provided. The grain size rating device of the polycrystalline material may be an electronic device. The grain size rating device of the polycrystalline material includes an obtaining module and a processing module. The obtaining module is configured to obtain a grain image, the grain image being used to represent a grain distribution of the polycrystalline material. The processing module is configured to process the grain image by using a contour extraction model to determine a grain contour of the grain image. The processing module is further configured to determine a grain size level of the grain image according to the grain contour.
[0022] In some possible implementation manners, according to the second aspect, the processing module is further configured to input the grain image into the contour extraction model, where the contour extraction model is a pre-trained artificial intelligence (AI) model. The processing module is further configured to extract the grain contour of the grain image according to the contour extraction model, to obtain the grain contour of the grain image.
[0023] In some possible implementation manners of the second aspect, the obtaining module is further configured to obtain a labeled contour of the grain size image. The processing module is further configured to extract first features of the labeled contour and extract second features of the grain contour by using the feature extraction model. The processing module is further configured to adjust parameters of the contour extraction model according to a difference between the first features and the second features.
[0024] In some possible implementation manners of the second aspect, the labeled contour is obtained by adjusting the grain contour.
[0025] In some possible implementation manners of the second aspect, the contour extraction model includes an encoder and a decoder, and the feature extraction model includes the encoder.
[0026] In some possible implementation manners of the second aspect, the processing module is further configured to determine a grain size level of the grain image according to the grain contour by using a preset evaluation mechanism and / or rule, or determine the grain size level of the grain image by comparing the grain contour with a standard rating map.
[0027] In some possible implementation manners of the second aspect, the obtaining module is further configured to obtain a training grain image and a labeled contour of the training grain image. The processing module is further configured to input the training grain image into an initial contour extraction model to obtain a training contour of the training grain image. The processing module is further configured to adjust parameters of the initial contour extraction model according to a difference between the labeled contour and the training contour, to obtain the contour extraction model.
[0028] In a third aspect, an electronic device is provided, including a memory and a processor, the memory is configured to store program instructions; when the program instructions are executed in the processor, the processor is configured to execute the method in the first aspect.
[0029] The processor in the third aspect can be a central processing unit (CPU), or a combination of a CPU and a neural network operation processor. The neural network operation processor can include a graphics processing unit (GPU), a neural-network processing unit (NPU), and the like.
[0030] In a fourth aspect, a computer readable medium is provided, which stores program codes for execution by a device. When the program codes are executed by the device, the device executes the method in any one of the implementation manners of the first aspect.
[0031] In a fifth aspect, a computer program product including instructions, which when executed on a computer, cause the computer to perform the method in any one of the implementation forms of the first aspect.
[0032] In a sixth aspect, a chip is provided, which includes a processor and a data interface, the processor reads instructions stored on a memory through the data interface, and performs the method in any one of the implementation forms of the first aspect.
[0033] Optionally, as an implementation form, the chip can further include a memory, the memory stores instructions, and the processor is configured to execute the instructions stored on the memory, and when the instructions are executed, the processor is configured to perform the method in any one of the implementation forms of the first aspect.
[0034] The chip can be a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 is a schematic structural diagram of a grain size detection system provided by an embodiment of the present application.
[0036] Figure 2 is a schematic diagram of a measurement grid.
[0037] Figure 3 is a schematic flowchart of a training method of a neural network model required by a grain size detection system provided by an embodiment of the present application.
[0038] Figure 4 is an original training grain image collected by a microscope.
[0039] Figure 5 is a training grain image after preprocessing.
[0040] Figure 6 is a grain boundary marked on a training grain image by a line of a specified color.
[0041] Figure 7 is a marking contour of a training grain image.
[0042] Figure 8 is a schematic diagram of a loss value calculation method.
[0043] Figure 9 is a schematic flowchart of a grain size rating method of a polycrystalline material provided by an embodiment of the present application.
[0044] Figure 10 is a contrast schematic diagram of the grain size detection result.
[0045] Figure 11 is a schematic structural diagram of a grain size rating device for a polycrystalline material provided by an embodiment of the present application.
[0046] Figure 12 is a schematic structural diagram of another grain size rating device for a polycrystalline material provided by an embodiment of the present application.
[0047] Figure 13 is a schematic structural diagram of a neural network training device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0049] Before leaving the factory, steel needs to be subjected to multiple quality detections, and metallographic examination is an important part thereof. Through metallographic examination, the structure inside the metal can be analyzed, and the performance of the metal can be evaluated.
[0050] Grain size detection is a way of metallographic examination. Grain size represents the size of the grain size. The grain size of the metal has a great influence on many properties of the metal. The influence of the grain size is essentially the influence of the grain boundary area. The finer the grain, the larger the grain boundary area, and the greater the influence on the performance. For the mechanical properties of the metal at room temperature, generally, the finer the grain, the higher the strength and hardness, and the better the plasticity and toughness. During the grain size detection process, the grain size of the sample is generally divided into multiple levels according to the average size of the crystal in the corresponding image of the sample. Generally, grain size detection can also be referred to as grain size rating.
[0051] Due to the complex production process of steel and the differences in products and production processes of various manufacturers, the grain structure morphology and images thereof of various manufacturers have different degrees of difference. The corresponding grain size detection national standards only give the detection method on the standard image, and do not give the detection details for the differences between images in actual production. The related method relies on artificial subjective experience in grain size level determination, and the detection result is greatly affected by the subjective factors of the detector, has low accuracy, and has low artificial rating efficiency.
[0052] The grain image is an image of the collected polycrystalline material to be detected. The grain image can reflect the distribution of the grains in the polycrystalline material.
[0053] A crystal is a solid having a regular geometric shape formed by a crystallization process. In a crystal, atoms or molecules are arranged periodically in space according to certain rules. If a crystal material is composed of many crystal grains, the crystal material is a polycrystalline material. If a crystal material is composed of only one crystal grain, the crystal material is a single crystal material. That is, a polycrystalline material is composed of many small crystal grains arranged in disorder.
[0054] For a polycrystalline material, a grain boundary refers to a very narrow region that transitions from one crystal direction to another crystal direction, thereby separating adjacent crystal grains. In a grain image, the closed line of grain boundaries around a crystal direction can be understood as the outline of a crystal grain.
[0055] A grain refers to the entire region enclosed by grain boundaries. That is, the area observed on a two-dimensional surface within the range of original grain boundaries, or the volume enclosed on a three-dimensional object within the range of original grain boundaries.
[0056] Grain size refers to a measure of the size of a crystal grain. The size of a crystal grain is usually evaluated or measured using different methods such as length, area, volume, or grain size level number.
[0057] The grain size of a polycrystalline material corresponding to a grain image is usually detected and rated according to the grain size level number, so as to evaluate the performance of the polycrystalline material.
[0058] A method for rating grain size can set a chain code length threshold, and chain codes with a length greater than the chain code length threshold represent grain boundaries, so as to determine the grain size level. Chain codes are used to represent the boundaries of continuous regions with a gray value greater than or equal to a preset value in a grain image. Specifically, steps S110 to S150 can be performed.
[0059] S110, binarizing a grain image according to a gray threshold to obtain a binarized image.
[0060] The gray threshold can be a preset value, or can be obtained by iterative calculation according to the gray of the grain image.
[0061] S120, removing salt and pepper noise in the binarized image.
[0062] A four-neighbor pixel template can be selected to process the binarized image. In the four-neighbor pixel template, the value of the center pixel is opposite to that of the other pixels. The binarized image is traversed with the four-neighbor pixel template. When a pixel is taken as the center pixel, and the pixels around the center pixel meet the four-neighbor template, the value of the center pixel is modified to be the same as that of the surrounding pixels.
[0063] S130, representing grain boundaries according to chain codes with a length greater than a chain code length threshold.
[0064] Generally, the width of the grain boundary in the grain image is several pixels. A center pixel hollowing method can be used, and each line greater than or equal to 3 pixels wide is represented by two single-pixel wide curves on the left and right. The line can be a strip-shaped region formed by a region in the grain image with a gray value greater than or equal to a certain preset gray value. The single-pixel curve can be referred to as a chain code.
[0065] By setting a chain code length threshold, small components such as impurities in the grain image can be excluded when calculating the number of grains. Thus, only chain codes greater than or equal to the chain code length threshold can be retained to represent the grain boundaries (i.e., the grain outlines in the grain image).
[0066] S140, according to the chain code representation of the grain boundary, the number of grains is counted.
[0067] Each closed chain code corresponds to a connected region, which is determined as a grain. Thus, the number of grains in the grain image can be counted.
[0068] S150, according to the number of grains in the image, the grain size level is determined.
[0069] In the process of determining the grain size level of the grain image, the size of the chain code length threshold seriously affects the accuracy of the grain size detection. The chain code length threshold needs to be set manually according to the situation of the grain image, which depends on human experience.
[0070] The number of images to be detected for steel grain size inspection is huge every year, and the test results are greatly affected by human subjective factors. At the same time, the rating efficiency is low.
[0071] Grain size detection is a computer vision problem. Deep learning technology has developed rapidly in recent years and has made major breakthroughs and significant achievements in the field of computer vision.
[0072] Another method of grain size detection can input the grain image into a neural network model. The neural network model can be a convolutional neural network (CNN) for processing the grain image to obtain the grain size level of the grain image.
[0073] The grain size level is used to represent the size of the grain density calculated by the number of grains per unit area. The grain density is a continuous value. For example, when the grain density is less than a, the grain size level is level 1; when the grain density is greater than or equal to a and less than b, the grain size level is level 2; and when the grain density is greater than or equal to b, the grain size level is level 3. When the grain density in the grain image is near a or b, the neural network model cannot accurately determine the grain size level.
[0074] Since the grain size detection can be applied to various industries, there is an urgent need for an intelligent grain size detection scheme that can quickly perform grain size detection and has an objective detection process and accurate detection results.
[0075] The embodiment of the present application provides a grain size detection system.
[0076] Figure 1 is a schematic structural diagram of a grain size detection system provided by the embodiment of the present application.
[0077] The grain size detection system 400 can be used for processing the grain size image and determining the level of the grain size corresponding to the grain size image.
[0078] The grain size detection system 400 can include a contour extraction module 410 and a rating module 420.
[0079] The contour extraction module 410 in the grain size detection system 400 can include an artificial intelligence (AI) model for grain contour extraction of the grain image, referred to as a contour extraction model, or the contour extraction module 410 can call the contour extraction model through an interface to realize the function of grain contour extraction of the input image on the grain. The contour extraction model can be a pre-trained neural network model, for example, a convolutional neuron network (CNN) model.
[0080] The convolutional neuron network (CNN) is a deep neural network with a convolutional structure. The convolutional neuron network includes a feature extractor composed of a convolutional layer and a subsampling layer, which can be regarded as a filter. The convolutional layer refers to the neuron layer in the convolutional neuron network for convolution processing on the input signal. In the convolutional layer of the convolutional neuron network, a neuron can be connected only with part of the adjacent layer neurons. A convolutional layer usually includes several feature planes, and each feature plane can be composed of some rectangular arranged neural units. The neural units in the same feature plane share weights, and the shared weights are convolution kernels. The shared weights can be understood as the way of extracting image information regardless of the position. The convolution kernel can be initialized in the form of a matrix with a random size, and the convolution kernel can obtain reasonable weights through learning in the training process of the convolutional neuron network. In addition, the direct benefit of shared weights is to reduce the connection between layers of the convolutional neuron network, and at the same time, to reduce the risk of overfitting.
[0081] Preferably, the contour extraction model can be a CNN model comprising an encoder and a decoder. The encoder is used for feature extraction of the input image to obtain image features. The encoder is used for decoding the image features extracted by the encoder to obtain a contour image.
[0082] The CNN model comprising an encoder and a decoder can be understood as a symmetric structure of codec structure, which is widely used and has good effect in image denoising and semantic segmentation. In the process of grain size detection, it is necessary to identify the grain contour in the grain image to realize semantic segmentation, and it is also necessary to distinguish impurities and grains to realize image denoising. Therefore, the contour extraction model adopts the CNN model comprising an encoder and a decoder, which can accurately identify the grain contour.
[0083] The grain image is input into the contour extraction module 410. Through the processing of the grain image by the contour extraction module 410, the grain contour in the grain image can be obtained.
[0084] The rating module 420 determines the grain size level according to the grain contour by using the evaluation mechanism and rules.
[0085] The grain size level G has the following relationship with the grain density:
[0086] G-1
[0087] N 100 =2
[0088] Wherein, N 100 represents the number of grains within 645.16 square millimeters (mm 2 ) under 100 times.
[0089] The evaluation mechanism and rules of grain size detection can refer to the national standards GB / T 24177-2009, GB / T 6394-2017, etc. Metal average grain size determination method.
[0090] Specifically, the area method or the intercept method can be used to determine the grain size level.
[0091] The area method is to determine the grain size by counting the number of grains N in a given area grid.
[0092] Select a grain image with appropriate magnification M. Place a circular or rectangular measurement grid with a known area A (usually an area of 5000 square millimeters) on the grain image, then count the number of grains N 内 that fall completely within the grid and the number of grains N 交 cut by the grid.
[0093] For a circular measurement grid, the number of grains N in the area A can be expressed as:
[0094]
[0095] For a rectangular measurement grid, N 交 Excluding the grains at the four corners. The number of grains N within this area A can be expressed as:
[0096]
[0097] By measuring the number of grains N within the grid and the magnification M of the grain image, the number of grains N per square millimeter on the actual sample test surface (1x magnification) can be calculated. A :
[0098]
[0099] Finally, the grain size level G can be calculated:
[0100] G = 3.321928lgN A -2.954
[0101] The intercept method determines grain size by counting the number of intersections between a given length of measurement line segment (or grid) and the grain profile. Compared to the area method, the intercept method is simpler for determining grain size levels.
[0102] Intercept method includes straight line intercept method and circular intercept method, etc. For example, you can use... Figure 2 The measurement grid shown is 500 mm.
[0103] The measurement grid consists of three concentric circles and two pairs of perpendicular straight line segments. All three concentric circles and four straight line segments are test lines. One pair of perpendicular straight line segments intersects at the center of the three concentric circles; each line segment is 100 mm long. The other pair of perpendicular straight line segments is located outside the three concentric circles; each line segment is 150 mm long. The angle between the 100 mm and 150 mm line segments is 45 degrees. The total length of the lines is 500 mm. The total circumference of the three concentric circles is 250 + 166.7 + 83.3 = 500 mm. The diameters of the three concentric circles are 79.58 mm, 53.05 mm, and 26.53 mm, respectively.
[0104] Through with Figure 2 The number N of the line segments in the measurement grid that intersect the grain profile. i The magnification M of the grain image, the length L of the test line in the measurement grid, and the number of intercepts N per unit length are calculated. L :
[0105]
[0106] Or, through with Figure 2The number of intercepts P of the line segments in the measurement grid intersecting the grain profile in the grain image i and the magnification M of the grain image, the length L of the test line in the measurement grid, the number of intercepts P per unit length is calculated:
[0107]
[0108] Finally, the average grain size G can be calculated:
[0109] G = 6.643856 lgN L - 3.288, or G = 6.643856 lgP L - 3.288
[0110] The rating module 420 can be configured to select appropriate rating methods and rules according to the specific grain image.
[0111] In some embodiments, the grain size detection system 400 can also not include the rating module 420. After determining the grain profile in the grain image, the grain level can also be determined by comparison method.
[0112] The comparison method is to evaluate the average grain size by comparing with the standard rating chart. It is suitable for evaluating recrystallized materials with equiaxed grains.
[0113] Generally, the same magnification as the corresponding standard series rating chart is used for direct comparison. By manual selection, the standard rating chart level or grain diameter closest to the grain profile of the grain image can be selected, and the evaluation result is recorded.
[0114] When evaluating the grain size by the comparison method, there is generally a certain deviation (± 0.5 level), and the detection personnel is required to be higher.
[0115] Figure 3 is a schematic flow chart of a training method 500 of a contour extraction model provided by an embodiment of the present application.
[0116] In S510, a training data set is obtained, and the training data set includes a plurality of training grain images and a labeled contour of each training grain image.
[0117] The training grain image can be an image of a polycrystalline material under a microscope collected by an image collection device. For example, Figure 4 As shown, it is an original training grain image collected by a microscope.
[0118] The grain images collected by different materials (such as different steel grades) and different production stages of polycrystalline materials can have large differences. The training data set can include training grain images of different materials and different production stages.
[0119] Optionally, since the original grain images have problems such as high noise, blurred grain outlines, and large gray-level differences between images, the original training grain images can be preprocessed to remove Gaussian noise and salt-and-pepper noise and enhance the crystal outline.
[0120] In other words, the training grain images in the training dataset can also be obtained by preprocessing the original acquired training grain images. Preprocessing can include the removal of salt-and-pepper noise and Gaussian noise, as well as image smoothing and grain boundary enhancement.
[0121] Salt and pepper noise, also known as impulse noise, is a common type of noise in images. It consists of randomly appearing white or black dots, which may be black pixels in bright areas or white pixels in dark areas.
[0122] Median filters can be used to remove salt-and-pepper noise. For example, a median filter with a 3×3 kernel can be used.
[0123] Gaussian noise is a type of noise whose probability density function follows a Gaussian distribution (i.e., a normal distribution).
[0124] A 5×5 Gaussian kernel can be used, with its standard deviation in the horizontal and vertical directions of the training grain image set to 0, to remove Gaussian noise.
[0125] Adaptive histogram equalization can be used to smooth gray-level differences between images and enhance grain boundaries. Histogram equalization is used to increase the global contrast of many images. When the contrast of useful data in images is quite similar, histogram equalization allows brightness to be better distributed across the histogram. This can be used to enhance local contrast without affecting the overall contrast. Histogram equalization can be achieved by effectively expanding commonly used brightness levels.
[0126] right Figure 4 The original training grain image shown can be preprocessed to obtain, as shown below. Figure 5 The image shown is a preprocessed training grain image.
[0127] The labeled contours of each training grain image can be manually labeled. That is, the labeled contours of each training grain image can be obtained by manually labeling the training grain images before or after preprocessing. It should be understood that the labeled contours can be image data.
[0128] Grain boundaries can be marked on the training grain image using lines of a specified color. For example... Figure 6 As shown, artificial in Figure 4The original training grain image shown is marked with a grain contour. Then, the position of the specified color in the training grain image with the grain boundary marked is determined, so as to determine Figure 7 The marked contour is shown.
[0129] In S520, the training grain image in the training data set is input into the contour extraction model, and the contour extraction model processes the training grain image to obtain a first training contour of the training grain image.
[0130] In S530, the parameters of the contour extraction model are adjusted according to the first training contour of the training grain image and the marked contour, so as to minimize the loss value.
[0131] In the process of training the deep neural network, because it is desired that the output of the deep neural network is as close as possible to the value that is really wanted to be predicted, the weight vector of each layer of the neural network can be updated according to the difference between the prediction value of the current network and the target value that is really wanted to be predicted (of course, there is usually an initialization process before the first update, that is, the parameters of each layer of the deep neural network are pre-configured), for example, if the prediction value of the network is too high, the weight vector is adjusted to make it predict lower, and the adjustment is continuously made until the deep neural network can predict the target value that is really wanted to be predicted or a value very close to it. Therefore, it is necessary to define in advance "how to compare the difference between the prediction value and the target value", which is the loss function or the objective function, which is an important equation for measuring the difference between the prediction value and the target value. Taking the loss function as an example, the higher the output value (loss) of the loss function (also known as the loss value or loss), the greater the difference, and then the training of the deep neural network becomes a process of trying to minimize this loss.
[0132] The neural network can use the back propagation (BP) algorithm to correct the size of the parameters in the initial neural network model in the training process, so that the reconstruction error loss of the neural network model becomes smaller and smaller. Specifically, the forward propagation of the input signal until the output produces an error loss, and the initial neural network model parameters are updated by back propagating the error loss information, so as to make the error loss converge. The back propagation algorithm is a back propagation movement dominated by error loss, aiming to obtain the optimal parameters of the neural network model, such as the weight matrix.
[0133] The loss value is determined according to the first training contour and the marked contour.
[0134] At S540, the adjusted contour extraction model is used to return to continue performing S520 and S530 until the obtained loss value gradually converges, that is, a trained contour extraction model is obtained.
[0135] The artificially labeled label contour and the first training contour output by the contour extraction model are compared at the pixel level to obtain a loss value. The loss is propagated to each layer of the encoder and the decoder through back propagation, and the parameters of the contour extraction model are adjusted so that the encoder and the decoder have the ability of grain contour extraction.
[0136] Optionally, the loss value can be determined according to the difference between the first training contour and the labeled contour of the training grain image.
[0137] The loss value L can be equal to L1, and L1 can be represented as:
[0138]
[0139] Wherein, N Y represents the number of image pixels of the labeled contour; The value of each of the N Y pixels in the image including the labeled contour, is used to represent the value of one pixel of the image of the labeled contour, p t The value of each of the N Y pixels in the image including the first training contour, is used to represent the value of one pixel of the image of the first training contour, The value of each pixel in the image of the labeled contour can be "0" or "1", that is, the value of each pixel is used to represent whether the pixel is on the contour of the grain.
[0140] Optionally, the loss value can be determined according to the difference between the first training contour and the labeled contour of the training grain image, and the difference between the image features of the first training contour and the labeled contour of the training grain image.
[0141] At S530, as Figure 8 shown, the first training contour of the training grain image can be input into the feature extraction model to obtain the feature of the first training contour; and the labeled contour of the training grain image can be input into the feature extraction model to obtain the feature of the labeled contour.
[0142] The feature extraction model can be a pre-trained neural network model, and the feature extraction model can be a CNN model.
[0143] The loss value L can be represented as L2 or L1+L2, wherein L2 is determined according to the difference between the image features of the first training contour and the labeled contour of the training grain image.
[0144] The feature extraction model processes the first training contour and the labeled contour of the training grain image. The output of one or more layers of the feature extraction model can be compared. That is, L2 can be determined according to the difference between the image features of the first training contour and the image features of the labeled contour according to the output of one or more layers of the feature extraction model.
[0145] The feature extraction model can be trained. Before performing the method 500, the feature extraction model can be trained.
[0146] A training data set of the feature extraction model can be obtained. The training data set of the feature extraction model includes a plurality of training grain images and a labeled contour of each training grain image. The training data set of the feature extraction model can be the same as or different from the training data set of the contour extraction model obtained in S510.
[0147] The training grain image in the training data set of the feature extraction model can be input into an initial neural network model. The initial neural network is used to process the training grain image to obtain a second training contour of the training grain image.
[0148] The initial neural network model is a CNN model including an encoder and a decoder. The initial neural network model can have the same number of layers as or a different number of layers from the initial contour extraction model. The initial neural network model can have the same parameters as or different parameters from the initial contour extraction model.
[0149] The parameters of the initial neural network model can be adjusted according to the second training contour and the labeled contour of the training grain image to minimize the difference between the second training contour and the labeled contour. It should be understood that the difference between the second training contour and the labeled contour is the difference in pixels.
[0150] The adjusted initial neural network model can be used to continue processing the training grain images in the training data set until the difference between the second training contour of the training grain image and the labeled contour converges, that is, the trained neural network model is obtained.
[0151] Generally, in the process of performing S530, the difference between the image features of the first training contour and the labeled contour of the training grain image can be represented as the difference between the image features of the first training contour output by one or more layers of the feature extraction model and the image features of the labeled contour output by the one or more layers of the feature extraction model during the process of the feature extraction model processing the first training contour and the labeled contour. The one or more layers do not include the output layer of the feature extraction model.
[0152] That is, the trained feature extraction model can be a sub-network model of the initial feature extraction model after parameter adjustment, the sub-network model including the first n layers of the initial feature extraction model after parameter adjustment, n being a preset positive integer. The first training contour of the training grain image is input into the sub-network model, and the output of one or more layers of the sub-network model is the image features of the first training contour and the image features of the labeled contour.
[0153] The labeled contour of the training grain image is input into the sub-network model, and the output of the one or more layers of the sub-network model is the image features of the labeled contour. Thus, the difference between the image features of the first training contour and the image features of the labeled contour of the training grain image can be obtained.
[0154] In some embodiments, the one or more layers can include all layers of the sub-network model.
[0155] Preferably, the training grain image can be input into the initial contour extraction model. The loss value can be calculated according to the difference between the first training contour and the labeled contour of the training grain image, the parameters of the contour extraction model are adjusted, and the pre-training of the contour extraction model is completed.
[0156] Then, the training grain image is processed by using the contour extraction model obtained by pre-training, and the labeled contour and the first training contour output by the contour extraction model obtained by training are input into the feature extraction model. The loss value can be calculated according to the difference between the features of the first training contour and the features of the labeled contour of the training grain image, the parameters of the contour extraction model are adjusted, and the training of the contour extraction model is completed to obtain the trained contour extraction model.
[0157] Of course, the loss value can be determined only according to the difference between the features of the first training contour and the features of the labeled contour. Alternatively, the loss value can be determined according to the difference between the features of the first training contour and the features of the labeled contour, and the difference between the first training contour and the labeled contour of the training grain image.
[0158] Further, in the process of adjusting the parameters of the contour extraction model obtained by pre-training, the labeled contour can be determined in a semi-supervised manner.
[0159] After the training grain image is processed by using the contour extraction model obtained by pre-training to obtain the first training contour, it can be determined by human whether the first training contour has defects, and the first training contour is modified in the case of defects to obtain the labeled contour.
[0160] This semi-supervised labeling method can greatly reduce the workload of manual labeling, and the workload of manual correction in the process of adjusting the parameters of the contour extraction model obtained by pre-training will also be reduced.
[0161] The labeled image and the first training contour output by the contour extraction model are used as inputs to the feature extraction model. The feature maps of the labeled image and the first training contour in each layer of the feature extraction model are compared, and the difference between the feature map of the labeled image and the feature map of the first training contour is used as the loss.
[0162] Image features can include spatial relationship features, among others. Spatial relationship features are used to represent the spatial positions or relative orientations between multiple targets segmented from an image.
[0163] Since the training process of the feature extraction model focuses on the contours of the grain image, the features extracted by the feature extraction model can reflect the spatial position or relative orientation relationship between the lines corresponding to the contours of multiple grains.
[0164] By adjusting the parameters of the contour extraction model based on the difference between the spatial relationship features of the first and second features, the spatial structure of the grain contour output by the parameter-adjusted contour extraction model can be made more accurate, thereby making the grain size detection results based on the grain contour more accurate.
[0165] When there is a small offset in the contour of a certain grain between the labeled image and the first training contour, a comparison of the pixels of the labeled image and the first training contour shows a large difference between them. However, a comparison of the first feature of the labeled image and the second feature of the first training contour may show a smaller difference between them.
[0166] The contour extraction model processes the grain image and outputs the grain contour of the grain image. Small distance positional deviations of the grain contour have almost no impact on the grain size detection results.
[0167] Based on the differences between the features extracted by the feature extraction model from the labeled image and the first training contour, the parameters of the contour extraction model are adjusted so that the trained contour extraction model does not destroy the spatial structure of the input grain image when processing it. This reduces the need to adjust the parameters of the contour extraction model during training based on the differences in image features between the first training contour and the labeled contour of the training grain image, thereby improving the accuracy of the grain size detection system 400.
[0168] To achieve the same detection result accuracy, in the training process of the contour extraction model, compared with the way of adjusting the parameters of the contour extraction model only according to the difference between the first training contour and the labeled contour, the way of first adjusting the parameters of the contour extraction model according to the difference between the first training contour and the labeled contour, and then adjusting the parameters of the contour extraction model according to the difference between the first feature and the second feature, requires fewer training grain images, and can be applied in a small sample scene.
[0169] Further, the feature extraction model can also include all or part of the layers in the encoder of the contour extraction model. The part of the layers can be the input layer of the encoder and one or more layers after the input layer.
[0170] For example, after the pre-training of the contour extraction model is completed, the encoder of the contour extraction model obtained by pre-training can be used as the feature extraction model. Thus, the training data required for training the contour extraction model can be reduced, and the time required for training the contour extraction model can be reduced.
[0171] In the case where the feature extraction model includes the encoder of the contour extraction model, in the process of adjusting the parameters of the pre-trained contour extraction model to obtain the trained contour extraction model, the parameters of the feature extraction model can remain unchanged and be the same as the parameters of the encoder of the pre-trained contour extraction model. Alternatively, the encoder of the contour extraction model after adjusting the parameters can also be used as the feature extraction model for the next processing of the input data.
[0172] It should be understood that the training data set obtained in S510 can include training grain images obtained by collecting a plurality of polycrystalline materials. Thus, the contour extraction model trained through S510 to S540 has strong robustness and can be applied to the scene of extracting the grain contours of different polycrystalline materials.
[0173] Through the above steps S510 to S540, the contour extraction model in the grain size detection system can be trained. The trained grain size detection system can be used to perform Figure 9 the method shown in the figure.
[0174] Figure 9 is a schematic flowchart of a polycrystalline material grain size rating method provided by an embodiment of the present application. The polycrystalline material grain size rating method 1200 includes steps S1210 to S1230. Figure 9 The method shown in the figure can be performed by the grain size detection system 400.
[0175] The grain size detection system 400 can use the feature extraction model obtained according to the foregoing Figure 3The method shown obtains a pre-trained contour extraction model or a trained contour extraction model.
[0176] At S1210, a grain image is obtained, the grain image being used to represent a grain distribution of the polycrystalline material.
[0177] The grain image can be an image of the polycrystalline material under a microscope. The grain image can be an image collected by an image collection device on the polycrystalline material under the microscope. The grain image should include a plurality of grains.
[0178] The polycrystalline material can be randomly imaged to obtain the grain image.
[0179] The polycrystalline material can be cut, and the grain image can be collected at a plane (or an approximately plane) obtained by the cutting. The collection of the grain image should avoid areas affected by shearing and heating of the grain structure. The cutting can be performed using a method that does not affect the grain structure.
[0180] The number and position of the cutting of the polycrystalline material can be determined according to product standards or technical conditions. If the product standards or technical conditions are not specified, the polycrystalline material can be cut at a radius or side length of 1 / 2.
[0181] At S1220, the contour extraction model is used to process the grain image to determine a grain contour of the grain image.
[0182] The contour extraction model can be an AI model trained.
[0183] The contour extraction model can be a CNN model including an encoder and a decoder. The encoder is used to extract features of an input image to obtain features of the input image. The decoder is used to decode the features output by the encoder to obtain the grain contour in the input image.
[0184] The decoder is used to decode the features output by the encoder, which can also be understood as restoring the image to obtain an image of the grain contour.
[0185] Through S1210 to S1220, the contour extraction model is used to process the grain image to obtain the grain contour of the grain image, thereby avoiding the dependence on artificial experience in determining the grain contour.
[0186] It should be understood that the contour extraction model can be an AI model trained or an AI model pre-trained.
[0187] At S1230, a grain size level of the grain image can be determined according to the grain contour.
[0188] The evaluation of the grain size level can rely on the evaluation mechanism and / or rules in the national standard.
[0189] The grain size evaluation method of the polycrystalline material provided by the embodiment of the application can combine artificial intelligence with grain size evaluation rules and apply the combination in the grain size evaluation process. The grain size level is determined by processing the grain image through the contour extraction model and combining the grain size evaluation rules. Thus, the grain size evaluation does not need to rely on artificial experience, realizes automatic grain size detection, and improves the efficiency of grain size identification. In addition, the grain size level is determined according to the grain contour, and the detection result of the grain size has high accuracy.
[0190] Specifically, the grain size evaluation rules can refer to the description of the evaluation module 420 in the method for evaluating the grain size of a polycrystalline material. Figure 1
[0191] Of course, the grain contour can also be output, and the grain size level of the grain image is determined by comparing the grain contour with the standard evaluation map.
[0192] The grain size level of the grain image can be determined by comparing the grain contour with the standard evaluation map through artificial means. Since the grain contour can be clearly displayed in the image of the grain contour, the influence of impurities and the like in the grain image on the determination of the grain size level by artificial means can be reduced, so that the result of the grain size evaluation is more accurate.
[0193] When the grain size level of the polycrystalline material is detected, a plurality of grain images can be randomly collected. For each grain image, the grain contour of each grain image can be obtained by performing the processing of step S1220. Then, the grain size level of the grain image can be determined according to the image of each grain contour. The grain size levels of the plurality of grain images can be averaged or taken as the median value, as the grain size level of the polycrystalline material.
[0194] The random collection of the grain images of the polycrystalline material can be realized by moving the field of view without intention. Since the plurality of grain images are randomly collected, the grain size level of the polycrystalline material determined is more representative, and the detection result is more accurate.
[0195] When the contour extraction model is a pre-trained AI model, after S1220, the parameters of the contour extraction model can be further adjusted according to the grain contour, so that the contour extracted by the contour extraction model is more accurate.
[0196] The labeled contour of the grain size image can be obtained. The first feature of the labeled contour can be extracted by using a feature extraction model, and the second feature of the grain contour can be extracted. The parameters of the contour extraction model can be adjusted according to the difference between the first feature and the second feature.
[0197] The features of the image can include spatial relationship features, etc. The spatial relationship features are used to represent the mutual spatial positions or relative direction relationships between the multiple targets segmented in the image.
[0198] According to the difference between the spatial relationship features of the first features and the second features, the parameters of the contour extraction model are adjusted, so that the spatial structure of the grain contour output by the contour extraction model after the parameter adjustment is more accurate, thereby making the grain size detection result based on the grain contour more accurate.
[0199] Before S1210, the contour extraction model can be obtained.
[0200] The contour extraction model can be received. Alternatively, the training of the neural network model can be performed to obtain the contour extraction model.
[0201] The training data can be obtained. The training data can include training grain images and labeled contours of the training grain images.
[0202] The training grain images can be input into the initial contour extraction model to obtain the second training contour of the training grain images.
[0203] According to the difference between the labeled contour and the training contour, the parameters of the initial contour extraction model are adjusted to obtain the contour extraction model.
[0204] The training data can include multiple training grain images and the labeled contour of each training grain image. After processing a training grain image using the initial contour extraction model and adjusting the parameters of the initial contour extraction model, the initial contour extraction model with the adjusted parameters can be used to process other training grain images, and the parameters of the initial contour extraction model are further adjusted, so as to finally obtain the contour extraction model.
[0205] After obtaining the contour extraction model, S1210 to S1220 can be performed. Then, the parameters of the contour extraction model are further adjusted. The encoder in the contour extraction model can be used as the feature extraction model, or the feature extraction model can be obtained or trained.
[0206] Using the encoder in the contour extraction model as the feature extraction model, the feature extraction model does not need to be retrained, thereby reducing the difficulty of the training process.
[0207] After S1220, the grain contour can be input into the feature extraction model to obtain the second feature of the grain contour. The labeled contour of the grain image can be input into the feature extraction model to obtain the first feature of the labeled contour. The difference between the first feature and the second feature can be used to further adjust the parameters of the contour extraction model.
[0208] The features of the image can include spatial relationship features, etc. The spatial relationship features are used to represent the mutual spatial positions or relative direction relationships between the multiple targets segmented in the image.
[0209] According to the difference between the spatial relationship features of the first features and the second features, the parameters of the contour extraction model are adjusted, so that the spatial structure of the grain contours output by the contour extraction model after parameter adjustment is more accurate, thereby making the grain size detection result based on the grain contours more accurate.
[0210] The labeled contour can be obtained by manually processing the grain image. Alternatively, the labeled contour can also be obtained by manually processing the grain contour output by the contour extraction model.
[0211] For the case of obtaining the labeled contour according to the grain contour output by the contour extraction model, it can be determined by manual whether the grain contour output by the contour extraction model has defects, and the first training contour is modified in the case of defects to obtain the labeled contour. Thus, the workload of manual labeling can be reduced, and as the parameters of the contour extraction model are adjusted, the output result of the contour extraction model becomes more and more accurate, and the workload of manual labeling will also be reduced.
[0212] Figure 10 A result comparison diagram of grain size detection is shown.
[0213] There are 150 grain size images, and the grain size images are preprocessed. The size of the grain image is 384 pixels x 512 pixels. Various schemes are used to process the grain size images to determine the grain size level corresponding to the grain image.
[0214] Scheme 1 uses the method as shown in Figure 1 to detect the grain image, and the accuracy rate of the grain level obtained is 63.20%.
[0215] Scheme 2 uses the measurement grid as shown in Figure 2 to detect the grain image, and the accuracy rate of the grain level obtained is 30.70%.
[0216] This scheme uses method 1300 to detect the grain image.
[0217] The contour extraction model adopts a full convolutional encoder-decoder composed of 5 convolutional layers and 5 transposed convolutional layers. In the network, the convolution kernel size is 3x3, the step is 2, the activation function is relu, the weight and bias initialization method is the truncated normal distribution related to the input and output node number, and the dropout parameter is 0.7 to prevent overfitting. The output channel numbers of each layer of the contour extraction model are (64, 128, 256, 512, 1024, 512, 256, 128, 64, 1).
[0218] In the process of training the contour extraction model, the training grain image is input into the contour extraction model to obtain the first training contour of the training grain image. The loss of the contour extraction model can include the pixel-level mean square error between the first training contour of the training grain image and the labeled contour of the training grain image.
[0219] That is, the purpose of training the contour extraction model is to reduce the difference between the first training contour and the labeled contour.
[0220] In addition, considering the spatial structure of the crystal contour, the feature extraction model can be used to process the first training contour of the training grain image and the labeled contour of the training grain image respectively to obtain the features of the first training contour and the labeled contour. For example, the loss of the contour extraction model can include the pixel-level loss of the feature map of the first training contour and the feature map of the labeled contour output by each layer of the feature extraction model.
[0221] When determining the loss of the contour extraction model, considering the difference in spatial structure between the first training contour output by the contour extraction model and the labeled contour, the contour extraction model can more accurately reflect the spatial structure of the grain image. Based on the grain contour output by the contour extraction model, the accuracy of the detection result can be improved, and the amount of data required for training can be reduced.
[0222] First, 60% of the grain images can be used as pre-training grain images, and the labeled contour of each pre-training grain image can be determined by manual. The pre-training grain image can be input into the contour extraction model, and the parameters of the contour extraction model can be adjusted according to the difference between the first training contour of the pre-training grain image output by the contour extraction model and the labeled contour of the pre-training grain image. The contour extraction model after adjusting the parameters can be used to process other pre-training grain images.
[0223] Then, 20% of the grain images can be taken as training grain images. The pre-trained grain image can be input into the contour extraction model to obtain a second training contour of the pre-trained grain image. The second training contour can be corrected by manual work to obtain a labeled contour of the pre-trained grain image. The encoder in the contour extraction model can be taken as a feature extraction network to extract features of the first training contour and the labeled contour. According to a difference between the features of the first training contour and the labeled contour, parameters of the contour extraction model can be adjusted to obtain a trained contour extraction model.
[0224] Finally, the remaining 20% of the grain images can be taken as test grain images. The labeled contour of each test grain image can be determined by manual work.
[0225] The measurement grid as shown in Figure 2 can be used, and according to the labeled contour of the test grain image, an actual grain size level of the test grain image can be determined.
[0226] The trained contour extraction model can be used to process the test grain image to obtain a test grain contour of the test grain image. The measurement grid as shown in Figure 2 can be used, and according to the test grain contour of the test grain image, a test grain size level of the test grain image can be determined.
[0227] The accuracy rate of the test grain size level compared with the actual grain size level is 92.4%.
[0228] The grain size rating method of the polycrystalline material provided in the embodiments of the present application can be used to determine the grain contour, so as to perform grain size rating, and a relatively accurate grain size rating result can be achieved.
[0229] The grain size rating method of the polycrystalline material provided in the embodiments of the present application can realize training of the contour extraction model according to less training data (i.e., a small sample), so that the grain size detection result of the grain contour processed by the contour extraction model based on the training is relatively accurate. By combining the grain contour extraction of the contour extraction model on the grain image with the grain size rating rule and method, the accuracy of the grain size detection is improved.
[0230] The grain size detection system, the training method of the AI model required in the grain size detection system, and the grain size rating method of the polycrystalline material provided in the embodiments of the present application are described above in combination with Figures 1 to 10 . The device embodiment of the embodiments of the present application is described below in combination with Figures 11 to 13 . It should be understood that the description of the grain size detection system, the training method of the AI model required in the grain size detection system, and the grain size rating method of the polycrystalline material corresponds to the description of the device embodiment, and therefore, the parts not described in detail can be referred to the description above.
[0231] Figure 11 Fig. 30 is a schematic structural diagram of a grain size rating device for polycrystalline material provided by an embodiment of the present application.
[0232] The grain size rating device 3000 for polycrystalline material comprises an acquisition module 3010 and a processing module 3020.
[0233] The acquisition module 3010 is configured to acquire a grain image, wherein the grain image is used to represent a grain distribution of the polycrystalline material.
[0234] The processing module 3020 is configured to determine a grain contour of the grain image by processing the grain image by using a contour extraction model.
[0235] The processing module 3020 is further configured to determine a grain size level of the grain image according to the grain contour.
[0236] Optionally, the processing module is further configured to input the grain image into the contour extraction model, wherein the contour extraction model is a pre-trained artificial intelligence (AI) model.
[0237] The processing module is further configured to extract the grain contour of the grain image according to the contour extraction model to obtain the grain contour of the grain image.
[0238] Optionally, the acquisition module 3010 is further configured to acquire a labeled contour of the grain size image.
[0239] The processing module 3020 is further configured to extract a first feature of the labeled contour and extract a second feature of the grain contour by using a feature extraction model.
[0240] The processing module 3020 is further configured to adjust parameters of the contour extraction model according to a difference between the first feature and the second feature.
[0241] Optionally, the labeled contour is obtained by adjusting the grain contour.
[0242] Optionally, the contour extraction model comprises an encoder and a decoder, and the feature extraction model comprises the encoder.
[0243] Optionally, the processing module is further configured to determine the grain size level of the grain image according to the grain contour by using a preset evaluation mechanism and / or rule, or determine the grain size level of the grain image by comparing the grain contour with a standard rating image.
[0244] Optionally, the acquisition module 3010 is further configured to acquire a training grain image and a labeled contour of the training grain image.
[0245] The processing module 3020 is further configured to input the training grain image into the initial contour extraction model to obtain a training contour of the training grain image.
[0246] The processing module 3020 is further configured to adjust parameters of the initial contour extraction model according to a difference between the labeled contour and the training contour to obtain the contour extraction model.
[0247] Figure 12 FIG. 4 is a schematic diagram of a hardware structure of a polycrystalline material grain size rating device according to an embodiment of the present application. Figure 12 The polycrystalline material grain size rating device 4000 shown includes a memory 4001, a processor 4002, a communication interface 4003, and a bus 4004. The memory 4001, the processor 4002, and the communication interface 4003 are in communication connection with each other through the bus 4004.
[0248] The memory 4001 can be a ROM, a static storage device, and a RAM. The memory 4001 can store a program, and when the program stored in the memory 4001 is executed by the processor 4002, the processor 4002 and the communication interface 4003 are configured to perform each step of the polycrystalline material grain size rating method according to an embodiment of the present application.
[0249] The processor 4002 can be a general-purpose CPU, a microprocessor, an ASIC, a GPU, or one or more integrated circuits, configured to execute a related program to implement the functions required to be performed by the units in the polycrystalline material grain size rating device according to an embodiment of the present application, or to execute the polycrystalline material grain size rating method according to the method embodiment of the present application.
[0250] The processor 4002 can also be an integrated circuit chip with signal processing capability, and in the implementation process, each step of the polycrystalline material grain size rating method according to an embodiment of the present application can be completed through the integrated logic circuit or the instruction in the form of software in the processor 4002.
[0251] The processor 4002 described above can also be a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 4001. The processor 4002 reads the information in memory 4001 and, in conjunction with its hardware, completes the functions required by the units included in the polycrystalline material grain size rating device of the embodiments of this application, or executes the polycrystalline material grain size rating method of the method embodiments of this application.
[0252] The communication interface 4003 uses a transceiver device, such as, but not limited to, a transceiver, to enable communication between the device 4000 and other devices or communication networks. For example, an image to be processed can be acquired through the communication interface 4003.
[0253] Bus 4004 may include a pathway for transmitting information between various components of device 4000 (e.g., memory 4001, processor 4002, communication interface 4003).
[0254] Figure 13 This is a schematic diagram of the hardware structure of a neural network training device according to an embodiment of this application. Similar to devices 3000 and 4000 described above, Figure 13 The neural network training device 5000 shown includes a memory 5001, a processor 5002, a communication interface 5003, and a bus 5004. The memory 5001, processor 5002, and communication interface 5003 are interconnected via the bus 5004.
[0255] It can be done Figure 13 The neural network training device 5000 shown trains the neural network, and the trained neural network can then be used to execute the grain size rating method for polycrystalline materials according to the embodiments of this application. This neural network model is a contour extraction model.
[0256] Specifically, Figure 13 The device shown can acquire training data and the neural network to be trained from the outside through the communication interface 5003, and then the processor trains the neural network to be trained according to the training data.
[0257] It should be noted that although the apparatus 4000 and the apparatus 5000 are only shown as having a memory, a processor, and a communication interface, in actual implementation, those skilled in the art should understand that the apparatus 4000 and the apparatus 5000 can also include other devices necessary for normal operation. Meanwhile, according to specific requirements, those skilled in the art should understand that the apparatus 4000 and the apparatus 5000 can also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the apparatus 4000 and the apparatus 5000 can also only include devices necessary for implementing the embodiments of the present application, and do not have to include all the devices shown in FIGS. 4 and 5. Figure 12 and Figure 13
[0258] It should be understood that the processor in the embodiments of the present application can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0259] It should also be understood that the memory in the embodiments of the present application can be a volatile memory or a nonvolatile memory, or can include both volatile and nonvolatile memory. Among them, the nonvolatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example, and not limitation, many forms of random access memory (RAM) are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0260] The above-described embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, the above-described embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are wholly or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server, or data center to another via wired (for example, infrared, wireless, microwave, etc.) or wireless means. The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, or the like, which includes one or a set of available media. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state disk.
[0261] It should be understood that the term "and / or" herein merely describes an association relationship of associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after it, but it can also represent an "and / or" relationship. The specific meaning can be understood according to the context before and after it.
[0262] In this application, "at least one" means one or more, and "multiple" means two or more. "At least one of the following" or the like means any combination of the items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.
[0263] It should be understood that in various embodiments of the present application, the size of the sequence number of the above-described processes does not mean the order of execution, and the execution order of the processes should be determined according to their functions and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0264] Those skilled in the art can clearly understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed 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 implementation should not be considered beyond the scope of the present application.
[0265] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
[0266] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0267] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0268] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically independently, or two or more units can be integrated into one unit.
[0269] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0270] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for grading the grain size of polycrystalline materials, characterized in that, The method includes: Acquire a grain image, which is used to represent the grain distribution of the polycrystalline material; The grain image is processed using a contour extraction model to determine the grain contour of the grain image. The contour extraction model includes an encoder and a decoder with a symmetrical structure. The encoder is used to extract features from the grain image to obtain image features, and the decoder is used to decode the image features to obtain the image of the grain contour. Based on the grain profile, determine the grain size level of the grain image; The method further includes: Obtain the labeled outline of the grain image; Using a feature extraction model, a first feature of the labeled contour is extracted, and a second feature of the grain contour is extracted. The feature extraction model includes the encoder. After obtaining the parameters of the contour extraction model through pre-training, the parameters of the encoder in the contour extraction model obtained through pre-training are used as the parameters of the encoder in the feature extraction model. The parameters of the contour extraction model are adjusted based on the difference between the first feature and the second feature.
2. The method according to claim 1, characterized in that, The step of processing the grain image using a contour extraction model to determine the grain contour of the grain image includes: The grain image is input into the contour extraction model, wherein the contour extraction model is a pre-trained artificial intelligence (AI) model; The grain contour of the grain image is extracted according to the contour extraction model to obtain the grain contour of the grain image.
3. The method according to claim 1 or 2, characterized in that, The labeled profile is obtained by adjusting the grain profile.
4. The method according to claim 1 or 2, characterized in that, Determining the grain size level of the grain image based on the grain profile includes: The grain size level of the grain image is determined based on the grain profile using a preset evaluation mechanism and / or rules; or, the grain size level of the grain image is determined by comparing the grain profile with a standard rating chart.
5. A grain size rating device for polycrystalline materials, characterized in that, include: Acquisition module and processing module; The acquisition module is used to acquire a grain image, which is used to represent the grain distribution of the polycrystalline material. The processing module is used to process the grain image using a contour extraction model to determine the grain contour of the grain image. The contour extraction model includes an encoder and a decoder with a symmetrical structure. The encoder is used to extract features from the grain image to obtain image features, and the decoder is used to decode the image features to obtain an image of the grain contour. The processing module is further configured to determine the grain size level of the grain image based on the grain profile; The acquisition module is further configured to acquire the labeled outline of the grain image; The processing module is further configured to extract a first feature of the labeled contour and a second feature of the grain contour using a feature extraction model, wherein the feature extraction model includes the encoder, and after obtaining the parameters of the contour extraction model through pre-training, the parameters of the encoder in the contour extraction model obtained through pre-training are used as the parameters of the encoder in the feature extraction model. The processing module is further configured to adjust the parameters of the contour extraction model based on the difference between the first feature and the second feature.
6. The apparatus according to claim 5, characterized in that, The processing module is further configured to input the grain image into the contour extraction model, wherein the contour extraction model is a pre-trained artificial intelligence (AI) model. The processing module is further configured to extract the grain contour of the grain image according to the contour extraction model, and obtain the grain contour of the grain image.
7. The apparatus according to claim 5 or 6, characterized in that, The labeled profile is obtained by adjusting the grain profile.
8. The apparatus according to claim 5 or 6, characterized in that, The processing module is further configured to determine the grain size level of the grain image based on the grain profile using a preset evaluation mechanism and / or rules; or to determine the grain size level of the grain image by comparing the grain profile with a standard rating chart.
9. An electronic device, characterized in that, Including processor and memory, The memory stores computer instructions; The processor executes the computer instructions to perform the method as described in any one of claims 1-4.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code for execution by the device, which, when executed by the device, enables the device to perform the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Image annotation method and device, equipment and medium
CN111259772A
Grain boundary extraction method and device and grain boundary extraction model generation method and device
CN111325706A