Evaluation management method and system for metallographic image analysis software
Through preprocessing of metallographic images and convolutional neural network segmentation, combining area method and cross-section method, the error and speed problems of traditional software evaluation methods are solved, and high accuracy and fast metallographic image analysis software evaluation is achieved.
Patent Information
- Application Number
- CN202411471796.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2024-11-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional software evaluation methods have large errors, slow processing speed, and no high-tech technologies, such as neural networks, resulting in unconvincing evaluation results and failure to effectively evaluate software performance.
By acquiring the initial metallographic image, performing grayscale, histogram equalization and mean filtering, training convolutional neural networks for grain boundary and grain segmentation, calculating the grain size level with the area method and the cross-section method, setting the threshold value Compare error and accuracy to realize the evaluation of metallographic image analysis software.
Effectively avoid uneven image distribution and noise interference, improve evaluation accuracy, quickly identify grain boundaries, reduce errors, and ensure the reliability of grain size rating assessment.
Smart Images

Figure CN118982544A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software evaluation, and in particular to an evaluation management method and system for metallographic image analysis software. Background Art
[0002] Chinese patent application CN109522203A discloses a method and device for evaluating a software product, the method specifically comprising: obtaining a user session set, wherein the session set includes operation events of multiple operations performed by the user on the software product in one session; secondly, based on the connection between the preset operation events and the semantic tags, determining the semantic tags corresponding to the operation events in the user session set, and obtaining the event tag queue corresponding to the user session set; then obtaining the operation events of the software product to be evaluated, and obtaining an event tree composed of semantic tags corresponding to the operation events of the software product to be evaluated according to the association relationship and the conversion relationship of the operation events of the software product to be evaluated; finally, matching the event tag queue corresponding to the user session set with the event tree of the software product to be evaluated to obtain a matching result, calculating the conversion rate between the semantic tags of the software product to be evaluated according to the matching result, and analyzing the conversion rate to obtain an evaluation result. This method does not evaluate the performance of the software product, and the evaluation result has limitations.
[0003] Traditional software evaluation methods have brought troubles to software evaluation due to errors in evaluation data and untimely processing of evaluation data. Moreover, during the software evaluation process, traditional software evaluation methods often process evaluation data slowly and do not use high-tech technologies such as neural networks, so the evaluation results are not convincing. Summary of the invention
[0004] In view of the problems in the related art, the present invention provides an evaluation management method and system for metallographic image analysis software to overcome the above technical problems existing in the existing related art.
[0005] In order to solve the above technical problems, the present invention is achieved through the following technical solutions: The present invention is a method for evaluating and managing metallographic image analysis software, comprising the following steps: S1, obtaining an initial metallographic image set, generating an initial metallographic image matrix, performing grayscale processing, histogram equalization processing and mean filtering processing on the pixels in the initial metallographic image matrix to obtain a pre-processed metallographic image, and then performing manual annotation and image cropping and expansion to obtain a processed metallographic image set; S2, training a convolutional neural network to obtain a convolutional neural network model, segmenting the grain boundaries and grains of the processed metallographic images in the processed metallographic image set, and outputting the model segmented metallographic image set; S3, converting the model segmentation metallographic images in the model segmentation metallographic image set into a matrix of metallographic images to be connected, and after performing binarization processing, skeletonization operation, endpoint extraction and burr removal, connecting the missing areas to obtain a final metallographic image set; S4. Use metallographic image analysis software to analyze the initial metallographic images in the initial metallographic image set, and then calculate the grain size grade of the final metallographic image in the final metallographic image set based on the area method and the intercept method. By setting thresholds to compare errors and accuracy, the metallographic image analysis software can be evaluated.
[0006] The invention obtains an initial metallographic image, generates an initial metallographic image matrix, grayscales the pixels in the initial metallographic image matrix, reduces the amount of calculation and facilitates subsequent processing, and then performs histogram equalization processing, which can effectively avoid the problem of uneven distribution in the image. After mean filtering, noise interference is reduced to obtain a pre-processed metallographic image, and manual annotation and image cropping and expansion are performed to effectively improve the evaluation accuracy and avoid the problem of too few sample images; secondly, a convolutional neural network is trained to obtain a convolutional neural network model, and the grain boundaries and grains in the processed metallographic image are segmented to express the image with fewer image samples. The data features are fast in recognition speed and high in accuracy. The large law is then used for binarization. The skeletonization operation retains the skeleton points by deleting the contour points and eliminating redundant information to facilitate endpoint detection. After the endpoints are extracted, the connection is further simplified. The burr removal operation is then performed to effectively enhance the image, reduce the error, and facilitate the grain size assessment. Finally, the metallographic image analysis software is used to analyze the initial metallographic image, and the area method and the intercept method are used to calculate the grain size grade. The threshold is set, and the reliability of the software analysis results is judged by comparing the error and accuracy of the software analysis results with the grain size grade, and the evaluation of the metallographic image analysis software is completed.
[0007] Preferably, the S1 comprises the following steps: S11, obtaining a metallographic sample, grinding, polishing and etching the metallographic sample to obtain a processed metallographic sample, using an inverted metallographic microscope to obtain an image of the processed metallographic sample, recorded as an initial metallographic image, and forming an initial metallographic image set; selecting m×n sample points on the initial metallographic image in the initial metallographic image set, the sample points being pixel points, and quantizing the sample points to generate an initial metallographic image matrix A as follows: ; in, Indicates the mth horizontal and nth vertical pixel on the initial metallographic image; The three color component values of the initial metallographic images in the initial metallographic image set are set to be r, g and b respectively, the initial metallographic images in the initial metallographic image set are grayscaled, and the initial metallographic image matrix is converted into a grayscale metallographic image matrix. The calculation formula is as follows: ; in, Represents the grayscale value of the pixel in the grayscale metallographic image matrix; S12, after performing histogram equalization processing and mean filtering processing on the pixel points in the grayscale metallographic image matrix, a pre-processed metallographic image matrix is obtained, and the specific steps are as follows: S121, set the pixel points in the grayscale metallographic image matrix to be in the interval [0,255] The grayscale pixels are recorded as , and the gray level is The number of pixels is , the histogram discrete function is established as follows: ; in, represents the histogram discrete function; The pixel points in the grayscale metallographic image matrix are normalized using the histogram discrete function to obtain the pixel point frequency, and the calculation formula is as follows: ; Among them, the number of pixels in the grayscale metallographic image matrix is , the gray level is The frequency of the pixel point is ; Calculating a cumulative histogram of pixel points in a grayscale metallographic image matrix according to the pixel point frequencies, performing equalization processing on the grayscale metallographic image matrix to obtain an equalized metallographic image matrix; S122, there is a filter template in the equalized metallographic image matrix, and the size of the filter template is set to , select a pixel point in the equalized metallographic image matrix, record it as the first pixel point, take the first pixel point as the center of the filter template, calculate the average value of the pixel values of all the pixel points in the filter template, record it as the first mean value, and use the first mean value to replace the pixel value of the first pixel point; then select a second pixel point from the equalized metallographic image matrix, take the second pixel point as the center of the filter template, calculate the average value of the pixel values of all the pixel points in the filter template, record it as the second mean value, and use the second mean value to replace the pixel value of the second pixel point; repeat S122 until the mean filtering of all the pixels in the equalized metallographic image matrix is completed, and obtain the preprocessed metallographic image matrix; S13, generating preprocessed metallographic images according to the preprocessed metallographic image matrix to form a preprocessed metallographic image set, manually annotating the preprocessed metallographic images in the preprocessed metallographic image set, setting image labels to obtain labeled metallographic images; and binarizing the labeled metallographic images to obtain binary labeled metallographic images to form a binary labeled metallographic image set; Set the size of the binary labeled metallographic image in the binary labeled metallographic image set to , every The binary labeled metallographic images in the binary labeled metallographic image set are divided into pixels to achieve cropping and expansion, and the size is obtained. The cropped and expanded metallographic image is a processed metallographic image, and a processed metallographic image set is obtained.
[0008] The invention obtains an initial metallographic image, generates an initial metallographic image matrix, and performs grayscale processing, histogram equalization processing and mean filtering on the pixels in the initial metallographic image matrix. This can effectively avoid the problem of uneven distribution in the image, reduce noise interference, expand sample images to avoid the problem of too few sample images, and facilitate subsequent processing.
[0009] Preferably, S2 comprises the following steps: S21. The convolutional neural network includes an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer. The training sample image is input into the input layer and reaches the convolution layer. The training sample image is regarded as a two-dimensional array. A sliding window is set. The convolution kernel in the convolution layer performs sliding window processing on the two-dimensional array with a set step size and order, and performs weighted summation on the two-dimensional array in the sliding window, and then fills the two-dimensional array to obtain a convolution sample image; the convolution sample image enters the pooling layer, and the pooling layer performs dimensionality reduction processing on the convolution sample image to obtain a pooled sample image; the pooled sample image enters the fully connected layer, and the fully connected layer extracts the feature information of the previous layer of the network and maps it to the sample space. After feature integration, the activation function is input to complete the classification operation; S22, obtaining a group of new metallographic images, recorded as sample metallographic images, to form a sample metallographic image set, the sample metallographic images in the sample metallographic image set are preprocessed, manually labeled, and image cropped and expanded to obtain a sample metallographic image set, and the sample metallographic image set is divided into a sample training set and a sample test set; setting the convolutional neural network to use the stochastic gradient descent method, the optimization method is the Adam optimizer, and the learning rate is , the activation function is the Tanh function, the loss function is the mean square error loss function, the sample training set is input into the convolutional neural network, and it is continuously iterated until the convolutional neural network converges to obtain a trained convolutional neural network; then the sample test set is input into the trained convolutional neural network, and the accuracy threshold is set to , when the output accuracy is less than the accuracy threshold, the convolutional neural network model is obtained; otherwise, the network weight parameters are adjusted until the output accuracy is less than the accuracy threshold; The processed metallographic image set is input into the convolutional neural network model, the convolutional neural network model segments the processed metallographic images in the processed metallographic image set, and the output images of the convolutional neural network model are spliced to obtain model-segmented metallographic images, wherein the label in the model-segmented metallographic image is 0 to represent the grain boundary, and the label in the model-segmented metallographic image is 1 to represent the grain, thereby realizing the segmentation of grain boundaries and grains and obtaining the model-segmented metallographic image set.
[0010] The invention obtains a convolutional neural network model by training a convolutional neural network, which can segment the grain boundaries and grains in the processed metallographic images, avoid the breakage and blurring of the grain boundaries, and express the data characteristics with fewer image samples. The neural network has a fast recognition speed and high accuracy.
[0011] Preferably, S3 comprises the following steps: S31, selecting on the model segmentation metallographic image in the model segmentation metallographic image set Sample points, quantify the sample points and generate the metallographic image matrix to be connected as follows: ; in, Indicates the horizontal , vertical pixels; Use the big law to binarize the pixels in the metallographic image matrix to be connected to obtain a binary metallographic image matrix. The specific steps are as follows: S311, record the pixel points whose grayscale values of the pixels in the metallographic image matrix to be connected are less than the grayscale threshold as foreground pixels, and record the pixel points whose grayscale values of the pixels in the metallographic image matrix to be connected are greater than or equal to the grayscale threshold as background pixels; calculate the ratio of the foreground pixels and the background pixels to the pixel points in the metallographic image matrix to be connected, and record them as foreground ratios respectively. Ratio to background ; Then calculate the average gray value of the foreground pixel and the background pixel, and record it as the foreground gray value and background grayscale value ; The average gray value of the pixels in the metallographic image matrix to be connected is , establish an objective function according to the average gray value, when the objective function takes a maximum value, the maximum value is the gray threshold; S312, if the grayscale value of the pixel point in the metallographic image matrix to be connected is less than the grayscale threshold, the grayscale value of the corresponding pixel point is set to 0, otherwise the grayscale value of the corresponding pixel point is set to 1, and the binarization process is completed to obtain a binarized metallographic image matrix; S32, select a pixel point in the binary metallographic image matrix, record it as the eight-neighborhood center pixel point, and record the pixel points around the eight-neighborhood center pixel point as the eight-neighborhood pixel points, ensure that the number of eight-neighborhood pixel points is greater than or equal to 2 and less than or equal to 6, and record the grayscale values of adjacent pixel points in the eight-neighborhood pixel points as 0 and 1 respectively as 01 mode. When the eight-neighborhood pixel points are in 01 mode, delete the connectivity of the current pixel point to complete the first screening; keep the grayscale value of the pixel points separated by the eight-neighborhood pixel points as 0, and when the number of pixel points corresponding to the eight-neighborhood pixel points in 01 mode is 1, delete the current pixel point to complete the second screening, until all the pixel points in the binary metallographic image matrix are screened, and obtain the skeletonized metallographic image matrix; The pixel points in the skeletonized metallographic image matrix are judged. If the gray value of the central pixel point of the eight neighborhoods is 1 and the gray value of the pixel points of the eight neighborhoods is 1, the central pixel point of the eight neighborhoods is recorded as an endpoint, the endpoint is extracted, and added to the endpoint queue; S33, extracting an endpoint from the endpoint queue, setting a glitch threshold value , for the endpoints in the skeletonized metallographic image matrix, at the 8 The burrs are removed in the neighborhood; when The gray value of the pixel in the neighborhood is 1, and +1 When the gray value of the pixel in the neighborhood is not 1, The pixel points corresponding to the gray value of 1 in the neighborhood are recorded as burr pixels, and the burr pixels are deleted; If the gray value of the pixel in the neighborhood is not 1, continue searching until 8 After the grayscale values of the pixels in the neighborhood are searched, all the burr pixels are deleted to obtain the burr-removed metallographic image matrix; S34, converting the burr-removed metallographic image matrix into a burr-removed metallographic image, calculating the distance between the endpoints in the burr-removed metallographic image matrix, and setting the distance threshold to When the distance between two endpoints in the burr-removed metallographic image matrix is less than a distance threshold, the two endpoints in the burr-removed metallographic image are connected until all endpoints in the endpoint queue are connected, thereby achieving missing area connectivity and obtaining a final metallographic image set.
[0012] The invention performs binarization, skeletonization, endpoint extraction and burr removal operations on the model segmentation metallographic image, deletes contour points and retains skeleton points, eliminates redundant information, facilitates subsequent simplification of connections, and enhances the image, which can reduce errors and facilitate grain size grade assessment.
[0013] Preferably, S4 comprises the following steps: S41, inputting the initial metallographic image set into the metallographic image analysis software, the metallographic image analysis software analyzes the average grain size of the initial metallographic images in the initial metallographic image set, and obtains the software evaluation area method grain size grade and the software evaluation intercept method grain size grade respectively; the final metallographic image is calculated using the area method and the intercept method respectively, and the specific steps are as follows: S411, select a final metallographic image from the final metallographic image set, place a rectangular measurement grid on the final metallographic image, and enlarge the final metallographic image, and set the number of grains in the rectangular measurement grid to , the number of grains divided by the rectangular measurement grid is , then the calculation formula for the total number of grains d in the rectangular measurement grid is as follows: ; Set the final metallographic image magnification to , the area of the rectangular measurement grid is , then the total number of grains in the final metallographic image is , then the grain size grade of the area metallographic image ; S412, placing the circular measurement grid on the final metallographic image, and setting the intercepts and intercept points, setting the number of intercepts to , set the number of cutoff points to , the mean intercept The calculation formula is as follows: ; The average grain size of the final metallographic image , the average grain size of the intercept point of the final metallographic image , the average intercept average grain size of the final metallographic image Calculate the average grain size of the final metallographic image, the average grain size of the final metallographic image, and the average intercept average grain size of the final metallographic image to obtain the grain size grade of the metallographic image by the intercept method. ; S42, setting the first error threshold to The absolute value of the difference between the area method grain size grade evaluated by the software and the area method metallographic image grain size grade is less than the software evaluation area method grain size grade corresponding to the first error threshold, which is recorded as the first error sample; the second error threshold is set to , the absolute value of the difference between the software-evaluated intercept method grain size grade and the intercept method metallographic image grain size grade is less than the software-evaluated intercept method grain size grade corresponding to the second error threshold, which is recorded as the second error sample; the ratio of the first error sample and the second error sample to the initial metallographic image set is calculated, which is recorded as the evaluation accuracy rate, and the evaluation threshold is set to When the evaluation accuracy is greater than or equal to the evaluation threshold, the metallographic image analysis software evaluation meets the requirements; otherwise, the metallographic image analysis software evaluation does not meet the requirements, and the evaluation management of the metallographic image analysis software is completed.
[0014] The invention analyzes the initial metallographic image through metallographic image analysis software, uses the area method and the intercept method to calculate the grain size grade, and by setting a threshold, compares the error and accuracy of the software analysis results and the grain size grade, thereby judging the reliability of the software analysis results and realizing the evaluation management of the metallographic image analysis software.
[0015] The present invention also discloses a system for the evaluation and management method of metallographic image analysis software, which specifically includes: an initial metallographic image manual processing module, a metallographic image grain boundary and grain segmentation module, a metallographic image missing area connection module and a metallographic image analysis software evaluation module; The initial metallographic image manual processing module is used to pre-process, manually annotate, and crop and expand the initial metallographic image; The metallographic image grain boundary and grain segmentation module is used to segment the metallographic image grain boundary and grain based on a convolutional neural network; The metallographic image missing region connecting module is used to repair the model segmentation metallographic image and fill the missing region in the image; The metallographic image analysis software evaluation module is used to compare the error and accuracy of the grain size grade of the final metallographic image with the threshold value to complete the evaluation management.
[0016] The present invention has the following beneficial effects: 1. The invention performs grayscale processing, histogram equalization processing and mean filtering on the pixels in the initial metallographic image matrix, thereby effectively avoiding the problem of uneven distribution in the image and reducing noise interference, while expanding the sample images to avoid the problem of too few sample images.
[0017] 2. The invention realizes the segmentation of grain boundaries and grains in processed metallographic images based on a convolutional neural network model, thereby avoiding the problems of grain boundary fracture and blurring, and expressing data features with fewer image samples. The neural network has a fast recognition speed and high accuracy.
[0018] 3. The invention performs binarization, skeletonization, endpoint extraction and burr removal operations on the model segmentation metallographic image, deletes contour points and retains skeleton points, eliminates redundant information, and enhances the image, which can reduce errors and facilitate grain size grade assessment.
[0019] 4. The invention analyzes the initial metallographic image through metallographic image analysis software, uses the area method and the intercept method to calculate the grain size grade, and sets a threshold to compare the error and accuracy of the software analysis results and the grain size grade, thereby judging the reliability of the software analysis results. The method is objective and accurate.
[0020] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying creative work.
[0022] Figure 1 A schematic diagram of the process of evaluating and managing metallographic image analysis software by an evaluation and management system for metallographic image analysis software provided by the present invention. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating orientation or positional relationship are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.
[0025] Example 1 The present invention is a method for evaluating and managing metallographic image analysis software, comprising the following steps: S1, obtaining an initial metallographic image set, generating an initial metallographic image matrix, performing grayscale processing, histogram equalization processing and mean filtering processing on the pixels in the initial metallographic image matrix to obtain a pre-processed metallographic image, and then performing manual annotation and image cropping and expansion to obtain a processed metallographic image set; The S1 comprises the following steps: S11, obtaining a metallographic sample, grinding, polishing and etching the metallographic sample to obtain a processed metallographic sample, using an inverted metallographic microscope to obtain an image of the processed metallographic sample, recorded as an initial metallographic image, and forming an initial metallographic image set; selecting m×n sample points on the initial metallographic image in the initial metallographic image set, the sample points being pixel points, and quantizing the sample points to generate an initial metallographic image matrix A as follows: ; in, Indicates the mth horizontal and nth vertical pixel on the initial metallographic image; The three color component values of the initial metallographic images in the initial metallographic image set are set to be r, g and b respectively, the initial metallographic images in the initial metallographic image set are grayscaled, and the initial metallographic image matrix is converted into a grayscale metallographic image matrix. The calculation formula is as follows: ; in, Represents the grayscale value of the pixel in the grayscale metallographic image matrix; S12, after performing histogram equalization processing and mean filtering processing on the pixel points in the grayscale metallographic image matrix, a pre-processed metallographic image matrix is obtained, and the specific steps are as follows: S121, set the pixel points in the grayscale metallographic image matrix to be in the interval [0,255] The grayscale pixels are recorded as , and the gray level is The number of pixels is , the histogram discrete function is established as follows: ; in, represents the histogram discrete function; The pixel points in the grayscale metallographic image matrix are normalized using the histogram discrete function to obtain the pixel point frequency, and the calculation formula is as follows: ; Among them, the number of pixels in the grayscale metallographic image matrix is , the gray level is The frequency of the pixel point is ; Calculating a cumulative histogram of pixels in a grayscale metallographic image matrix according to the pixel frequency, performing equalization processing on the grayscale metallographic image matrix to obtain an equalized metallographic image matrix; S122, there is a filter template in the equalized metallographic image matrix, and the size of the filter template is set to , select a pixel point in the equalized metallographic image matrix, record it as the first pixel point, take the first pixel point as the center of the filter template, calculate the average value of the pixel values of all the pixel points in the filter template, record it as the first mean value, and use the first mean value to replace the pixel value of the first pixel point; then select a second pixel point from the equalized metallographic image matrix, take the second pixel point as the center of the filter template, calculate the average value of the pixel values of all the pixel points in the filter template, record it as the second mean value, and use the second mean value to replace the pixel value of the second pixel point; repeat S122 until the mean filtering of all the pixels in the equalized metallographic image matrix is completed, and obtain the preprocessed metallographic image matrix; S13, generating preprocessed metallographic images according to the preprocessed metallographic image matrix to form a preprocessed metallographic image set, manually annotating the preprocessed metallographic images in the preprocessed metallographic image set, setting image labels to obtain labeled metallographic images; and binarizing the labeled metallographic images to obtain binary labeled metallographic images to form a binary labeled metallographic image set; Set the size of the binary labeled metallographic image in the binary labeled metallographic image set to , every The binary labeled metallographic images in the binary labeled metallographic image set are divided into pixels to achieve cropping and expansion, and the size is obtained. The cropped and expanded metallographic images are processed metallographic images, so as to obtain a set of processed metallographic images; S2, training a convolutional neural network to obtain a convolutional neural network model, segmenting the grain boundaries and grains of the processed metallographic images in the processed metallographic image set, and outputting the model segmented metallographic image set; The S2 comprises the following steps: S21. The convolutional neural network includes an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer. The training sample image is input into the input layer and reaches the convolution layer. The training sample image is regarded as a two-dimensional array. A sliding window is set. The convolution kernel in the convolution layer performs sliding window processing on the two-dimensional array with a set step size and order, and performs weighted summation on the two-dimensional array in the sliding window, and then fills the two-dimensional array to obtain a convolution sample image; the convolution sample image enters the pooling layer, and the pooling layer performs dimensionality reduction processing on the convolution sample image to obtain a pooled sample image; the pooled sample image enters the fully connected layer, and the fully connected layer extracts the feature information of the previous layer of the network and maps it to the sample space. After feature integration, the activation function is input to complete the classification operation; S22, obtaining a group of new metallographic images, recorded as sample metallographic images, to form a sample metallographic image set, the sample metallographic images in the sample metallographic image set are preprocessed, manually labeled, and image cropped and expanded to obtain a sample metallographic image set, and the sample metallographic image set is divided into a sample training set and a sample test set; setting the convolutional neural network to use the stochastic gradient descent method, the optimization method is the Adam optimizer, and the learning rate is , the activation function is the Tanh function, the loss function is the mean square error loss function, the sample training set is input into the convolutional neural network, and it is continuously iterated until the convolutional neural network converges to obtain a trained convolutional neural network; then the sample test set is input into the trained convolutional neural network, and the accuracy threshold is set to , when the output accuracy is less than the accuracy threshold, the convolutional neural network model is obtained; otherwise, the network weight parameters are adjusted until the output accuracy is less than the accuracy threshold; Inputting the processed metallographic image set into a convolutional neural network model, the convolutional neural network model segments the processed metallographic images in the processed metallographic image set, splicing the convolutional neural network model output images to obtain model-segmented metallographic images, wherein a label of 0 in the model-segmented metallographic image represents a grain boundary, and a label of 1 in the model-segmented metallographic image represents a grain, thereby achieving grain boundary and grain segmentation and obtaining a model-segmented metallographic image set; S3, converting the model segmentation metallographic images in the model segmentation metallographic image set into a matrix of metallographic images to be connected, and after performing binarization processing, skeletonization operation, endpoint extraction and burr removal, connecting the missing areas to obtain a final metallographic image set; The S3 comprises the following steps: S31, selecting on the model segmentation metallographic image in the model segmentation metallographic image set Sample points, quantify the sample points and generate the metallographic image matrix to be connected as follows: ; in, Indicates the horizontal , vertical pixels; Use the big law to binarize the pixels in the metallographic image matrix to be connected to obtain a binary metallographic image matrix. The specific steps are as follows: S311, record the pixel points whose grayscale values of the pixels in the metallographic image matrix to be connected are less than the grayscale threshold as foreground pixels, and record the pixel points whose grayscale values of the pixels in the metallographic image matrix to be connected are greater than or equal to the grayscale threshold as background pixels; calculate the ratio of the foreground pixels and the background pixels to the pixel points in the metallographic image matrix to be connected, and record them as foreground ratios respectively. Ratio to background ; Then calculate the average gray value of the foreground pixel and the background pixel, and record it as the foreground gray value and background grayscale value ; The average gray value of the pixels in the metallographic image matrix to be connected is , establish an objective function according to the average gray value, when the objective function takes a maximum value, the maximum value is the gray threshold; S312, if the grayscale value of the pixel point in the metallographic image matrix to be connected is less than the grayscale threshold, the grayscale value of the corresponding pixel point is set to 0, otherwise the grayscale value of the corresponding pixel point is set to 1, and the binarization process is completed to obtain a binarized metallographic image matrix; S32, select a pixel point in the binary metallographic image matrix, record it as the eight-neighborhood center pixel point, and record the pixel points around the eight-neighborhood center pixel point as the eight-neighborhood pixel points, ensure that the number of eight-neighborhood pixel points is greater than or equal to 2 and less than or equal to 6, and record the grayscale values of adjacent pixel points in the eight-neighborhood pixel points as 0 and 1 respectively as 01 mode. When the eight-neighborhood pixel points are in 01 mode, delete the connectivity of the current pixel point to complete the first screening; keep the grayscale value of the pixel points separated by the eight-neighborhood pixel points as 0, and when the number of pixel points corresponding to the eight-neighborhood pixel points in 01 mode is 1, delete the current pixel point to complete the second screening, until all the pixel points in the binary metallographic image matrix are screened, and obtain the skeletonized metallographic image matrix; The pixel points in the skeletonized metallographic image matrix are judged. If the gray value of the central pixel point of the eight neighborhoods is 1 and the gray value of the pixel points of the eight neighborhoods is 1, the central pixel point of the eight neighborhoods is recorded as an endpoint, the endpoint is extracted, and added to the endpoint queue; S33, extracting an endpoint from the endpoint queue, setting a glitch threshold value , for the endpoints in the skeletonized metallographic image matrix, at the 8 The burrs are removed in the neighborhood; when The gray value of the pixel in the neighborhood is 1, and +1 When the gray value of the pixel in the neighborhood is not 1, The pixel points corresponding to the gray value of 1 in the neighborhood are recorded as burr pixels, and the burr pixels are deleted; If the gray value of the pixel in the neighborhood is not 1, continue searching until 8 After the grayscale values of the pixels in the neighborhood are searched, all the burr pixels are deleted to obtain the burr-removed metallographic image matrix; S34, converting the burr-removed metallographic image matrix into a burr-removed metallographic image, calculating the distance between the endpoints in the burr-removed metallographic image matrix, and setting the distance threshold to , when the distance between two endpoints in the burr-removed metallographic image matrix is less than a distance threshold, the two endpoints in the burr-removed metallographic image are connected until all endpoints in the endpoint queue are connected, thereby achieving missing area connectivity and obtaining a final metallographic image set; S4, using metallographic image analysis software to analyze the initial metallographic images in the initial metallographic image set, and then calculating the grain size grade of the final metallographic image in the final metallographic image set based on the area method and the intercept method, and comparing the error and accuracy by setting a threshold value to achieve the evaluation of the metallographic image analysis software; The S4 comprises the following steps: S41, inputting the initial metallographic image set into the metallographic image analysis software, the metallographic image analysis software analyzes the average grain size of the initial metallographic images in the initial metallographic image set, and obtains the software evaluation area method grain size grade and the software evaluation intercept method grain size grade respectively; the final metallographic image is calculated using the area method and the intercept method respectively, and the specific steps are as follows: S411, select a final metallographic image from the final metallographic image set, place a rectangular measurement grid on the final metallographic image, and enlarge the final metallographic image, and set the number of grains in the rectangular measurement grid to , the number of grains divided by the rectangular measurement grid is , then the calculation formula for the total number of grains d in the rectangular measurement grid is as follows: ; Set the final metallographic image magnification to , the area of the rectangular measurement grid is , then the total number of grains in the final metallographic image is , then the grain size grade of the area metallographic image ; S412, placing the circular measurement grid on the final metallographic image, and setting the intercepts and intercept points, setting the number of intercepts to , set the number of cutoff points to , the mean intercept The calculation formula is as follows: ; The average grain size of the final metallographic image , the average grain size of the intercept point of the final metallographic image , the average intercept average grain size of the final metallographic image Calculate the average grain size of the final metallographic image, the average grain size of the final metallographic image, and the average intercept average grain size of the final metallographic image to obtain the grain size grade of the metallographic image by the intercept method. ; S42, setting the first error threshold to The absolute value of the difference between the area method grain size grade evaluated by the software and the area method metallographic image grain size grade is less than the software evaluation area method grain size grade corresponding to the first error threshold, which is recorded as the first error sample; the second error threshold is set to , the absolute value of the difference between the software-evaluated intercept method grain size grade and the intercept method metallographic image grain size grade is less than the software-evaluated intercept method grain size grade corresponding to the second error threshold, which is recorded as the second error sample; the ratio of the first error sample and the second error sample to the initial metallographic image set is calculated, which is recorded as the evaluation accuracy rate, and the evaluation threshold is set to When the evaluation accuracy is greater than or equal to the evaluation threshold, the metallographic image analysis software evaluation meets the requirements; otherwise, the metallographic image analysis software evaluation does not meet the requirements, and the evaluation management of the metallographic image analysis software is completed.
[0026] Example 2 The present invention also discloses a system for the evaluation and management method of metallographic image analysis software, which specifically includes: an initial metallographic image manual processing module, a metallographic image grain boundary and grain segmentation module, a metallographic image missing area connection module and a metallographic image analysis software evaluation module; The initial metallographic image manual processing module is used to pre-process, manually annotate, and crop and expand the initial metallographic image; The metallographic image grain boundary and grain segmentation module is used to segment the metallographic image grain boundary and grain based on a convolutional neural network; The metallographic image missing region connecting module is used to repair the model segmentation metallographic image and fill the missing region in the image; The metallographic image analysis software evaluation module is used to compare the error and accuracy of the grain size grade of the final metallographic image with the threshold value to complete the evaluation management.
[0027] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0028] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.
Claims
1. A method for evaluating and managing metallographic image analysis software, characterized in that: The steps include: S1, obtaining an initial metallographic image set, generating an initial metallographic image matrix, performing grayscale processing, histogram equalization processing and mean filtering processing on the pixels in the initial metallographic image matrix to obtain a pre-processed metallographic image, and then performing manual annotation and image cropping and expansion to obtain a processed metallographic image set; S2, training a convolutional neural network to obtain a convolutional neural network model, segmenting the grain boundaries and grains of the processed metallographic images in the processed metallographic image set, and outputting the model segmented metallographic image set; S3, converting the model segmentation metallographic images in the model segmentation metallographic image set into a matrix of metallographic images to be connected, and after performing binarization processing, skeletonization operation, endpoint extraction and burr removal, connecting the missing areas to obtain a final metallographic image set; S4. Use metallographic image analysis software to analyze the initial metallographic images in the initial metallographic image set, and then calculate the grain size grade of the final metallographic image in the final metallographic image set based on the area method and the intercept method. By setting thresholds to compare errors and accuracy, the metallographic image analysis software can be evaluated.
2. The evaluation management method for metallographic image analysis software according to claim 1, characterized in that: The S1 comprises the following steps: S11, acquiring a metallographic sample, obtaining an initial metallographic image set, generating an initial metallographic image matrix, and converting the initial metallographic image matrix into a grayscale metallographic image matrix; S12, performing histogram equalization processing and mean filtering processing on the pixel points in the grayscale metallographic image matrix to obtain a pre-processed metallographic image matrix; S13, generating a preprocessed metallographic image according to the preprocessed metallographic image matrix, manually annotating the preprocessed metallographic image, and then segmenting the preprocessed metallographic image to achieve cropping and expansion, so as to obtain a processed metallographic image set.
3. The evaluation management method for metallographic image analysis software according to claim 2, characterized in that: The S12 comprises the following steps: S121, establishing a histogram discrete function according to the pixel points in the grayscale metallographic image matrix, and calculating the pixel point frequency according to the histogram discrete function to obtain a cumulative histogram, completing equalization processing, and obtaining a balanced metallographic image matrix; S122, performing mean filtering processing on the pixel points in the equalized metallographic image matrix to obtain a preprocessed metallographic image matrix.
4. The evaluation management method for metallographic image analysis software according to claim 3, characterized in that: The S2 comprises the following steps: S21. The convolutional neural network includes an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer. The training sample image is input into the input layer and reaches the convolution layer. The training sample image is regarded as a two-dimensional array. A sliding window is set. The convolution kernel in the convolution layer performs sliding window processing on the two-dimensional array with a set step size and order, and performs weighted summation on the two-dimensional array in the sliding window, and then fills the two-dimensional array to obtain a convolution sample image; the convolution sample image enters the pooling layer, and the pooling layer performs dimensionality reduction processing on the convolution sample image to obtain a pooled sample image; the pooled sample image enters the fully connected layer, and the fully connected layer extracts the feature information of the previous layer of the network and maps it to the sample space. After feature integration, the activation function is input to complete the classification operation; S22, obtaining a group of new metallographic images, recorded as sample metallographic images, to form a sample metallographic image set, the sample metallographic images in the sample metallographic image set are preprocessed, manually labeled, and image cropped and expanded to obtain a sample metallographic image set, and the sample metallographic image set is divided into a sample training set and a sample test set; setting the convolutional neural network to use the stochastic gradient descent method, the optimization method is the Adam optimizer, and the learning rate is , the activation function is the Tanh function, the loss function is the mean square error loss function, the sample training set is input into the convolutional neural network, and it is continuously iterated until the convolutional neural network converges to obtain a trained convolutional neural network; then the sample test set is input into the trained convolutional neural network, and the accuracy threshold is set to , when the output accuracy is less than the accuracy threshold, the convolutional neural network model is obtained; otherwise, the network weight parameters are adjusted until the output accuracy is less than the accuracy threshold.
5. The evaluation management method for metallographic image analysis software according to claim 4, characterized in that: The processed metallographic image set is input into the convolutional neural network model, the convolutional neural network model segments the processed metallographic images in the processed metallographic image set, and the output images of the convolutional neural network model are spliced to obtain model-segmented metallographic images, wherein the label in the model-segmented metallographic image is 0 to represent the grain boundary, and the label in the model-segmented metallographic image is 1 to represent the grain, thereby realizing the segmentation of grain boundaries and grains and obtaining the model-segmented metallographic image set.
6. The evaluation management method for metallographic image analysis software according to claim 5, characterized in that: The S3 comprises the following steps: S31, generating a matrix of metallographic images to be connected according to the model segmented metallographic images in the model segmented metallographic image set; binarizing the pixels in the matrix of metallographic images to be connected using the big law to obtain a binary metallographic image matrix; S32, performing skeletonization processing on the binary metallographic image matrix using the eight-neighborhood method to obtain a skeletonized metallographic image matrix; Extract endpoints from the skeletonized metallographic image matrix and add them to the endpoint queue; S33, identifying burr pixel points in the skeletonized metallographic image matrix according to the endpoints in the endpoint queue, deleting all burr pixel points, and obtaining a burr-deleted metallographic image matrix; S34, by determining the distance between two endpoints in the burr-deleted metallographic image matrix, connecting the endpoints in the endpoint queue to achieve the missing area connection, and obtaining the final metallographic image set.
7. The evaluation and management method for metallographic image analysis software according to claim 6, characterized in that: The method of using the big law to binarize the pixels in the metallographic image matrix to be connected comprises the following steps: S311, selecting foreground pixels and background pixels in the metallographic image matrix to be connected, establishing an objective function according to the foreground pixels and the background pixels, and obtaining a grayscale threshold; S312: If the grayscale value of the pixel in the metallographic image matrix to be connected is less than the grayscale threshold, the grayscale value of the corresponding pixel is set to 0; otherwise, the grayscale value of the corresponding pixel is set to 1, and the binarization process is completed to obtain a binarized metallographic image matrix.
8. The evaluation and management method for metallographic image analysis software according to claim 4, characterized in that: The S4 comprises the following steps: S41, inputting the initial metallographic image set into the metallographic image analysis software, the metallographic image analysis software analyzes the average grain size of the initial metallographic images in the initial metallographic image set, and obtains the software evaluation area method grain size grade and the software evaluation intercept method grain size grade respectively; The final metallographic image is used to calculate the grain size grade using the area method and the intercept method, respectively, to obtain the area method metallographic image grain size grade and the intercept method metallographic image grain size grade; S42, setting the first error threshold to , the absolute value of the difference between the area method grain size grade evaluated by the software and the area method metallographic image grain size grade is less than the software evaluation area method grain size grade corresponding to the first error threshold, which is recorded as the first error sample; Set the second error threshold to , the absolute value of the difference between the software-evaluated intercept method grain size grade and the intercept method metallographic image grain size grade is less than the software-evaluated intercept method grain size grade corresponding to the second error threshold, which is recorded as the second error sample; the ratio of the first error sample and the second error sample to the initial metallographic image set is calculated, which is recorded as the evaluation accuracy rate, and the evaluation threshold is set to When the evaluation accuracy is greater than or equal to the evaluation threshold, the metallographic image analysis software evaluation meets the requirements; otherwise, the metallographic image analysis software evaluation does not meet the requirements, and the evaluation management of the metallographic image analysis software is completed.
9. A system for implementing the evaluation management method for metallographic image analysis software according to any one of claims 1 to 8, characterized in that: Specifically include: Initial metallographic image manual processing module, metallographic image grain boundary and grain segmentation module, metallographic image missing area connection module and metallographic image analysis software evaluation module; The initial metallographic image manual processing module is used to pre-process, manually annotate, and crop and expand the initial metallographic image; The metallographic image grain boundary and grain segmentation module is used to segment the metallographic image grain boundary and grain based on a convolutional neural network; The metallographic image missing region connecting module is used to repair the model segmentation metallographic image and fill the missing region in the image; The metallographic image analysis software evaluation module is used to compare the error and accuracy of the grain size grade of the final metallographic image with the threshold value to complete the evaluation management.
Citation Information
Patent Citations
Metallographic grain boundary extraction and communication method based on deep learning
CN113506240A
Cited By
System and method for testing copper ratio of NbTi / Cu superconducting wire based on image recognition
CN119338817A
