Improved YOLOv8s-based instance segmentation detection method and application
By improving the YOLOv8s model, combining spatial depth conversion convolution blocks and small object detection layer, the accuracy and speed problems of traditional methods for identifying second-phase particles in industrial scenarios are solved, and high-precision and fast batch detection is achieved, suitable for nickel Second phase particles of the base high temperature alloy are identified.
Patent Information
- Application Number
- CN202411175060.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-01-10
AI Technical Summary
Traditional example segmentation methods are difficult to achieve high-precision and high-speed batch automation detection in industrial scenarios, and have high requirements for picture quality, and cannot effectively identify the impact of impurities or noise, which has the disadvantages of subjectivity and inability to quickly process.
Using an instance segmentation detection method based on improved YOLOv8s, the improved model includes Backbone module, Neck module and Head module, combined with spatial depth conversion convolution block and small object detection layer, and using SIoU loss function, the nickel-based high-temperature alloy is realized. High-precision identification and batch detection of two-phase particles.
It realizes high-precision and fast batch detection, reduces the leakage detection rate, and can effectively calculate the average area fraction, quantity, size and dispersion of the second phase particles. It is suitable for the second phase particle segmentation detection of nickel-based high-temperature alloys. Automatic identification at industrial sites.
Smart Images

Figure CN119295746A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image or video recognition or understanding, and in particular to an instance segmentation detection method based on improved YOLOv8s and an application thereof. Background Art
[0002] Instance segmentation is a subset of the technical field of image segmentation. Compared with traditional object detection algorithms, instance segmentation can provide more detailed and complex output results. As a result, it has image processing use cases in many industries, from analyzing medical images to detecting objects of interest in satellite imagery to enabling navigation for self-driving cars.
[0003] Take the example of nickel-based superalloy segmentation. Nickel-based superalloy is a special alloy system designed for use under high temperature and complex stress conditions. Such alloys require excellent mechanical properties for service in high temperature environments, including but not limited to significant high temperature strength, excellent fatigue and creep resistance, as well as excellent fracture toughness and microstructural stability. In addition, nickel-based superalloys must also exhibit good surface stability to resist erosion by environmental factors such as high temperature oxidation and corrosion. In view of its comprehensive performance under high temperature conditions, nickel-based superalloys are widely used in the manufacture of key hot end components of engines and gas turbines in aerospace.
[0004] The reason why nickel-based high-temperature alloys exhibit excellent performance under high temperature conditions is due to their complex chemical composition and precise manufacturing process. The performance optimization of nickel-based high-temperature alloys is mainly achieved through alloying strategies, that is, introducing a certain amount of titanium, niobium and other elements into the alloy. The addition of these elements promotes the precipitation strengthening of fine dispersed γ' phase Ni3 (Al, Ti) or γ" phase Ni3 (Nb, Al, Ti) intermetallic compounds, as well as partial solid solution strengthening and grain boundary strengthening, thereby achieving high strength and excellent creep properties in high temperature environments. However, on the other hand, Nb and Ti are carbide and nitride forming elements. Under the action of microsegregation during the solidification process, carbonitride phases are precipitated in the liquid or solid two-phase region, which are called primary carbonitrides. These primary carbonitrides are large in size and can even reach tens of microns. The fine precipitates in the alloy enhance the mechanical properties of the material. The use of key alloying elements is undoubted, but when the key alloying elements in the alloy fail to effectively form fine or nano-sized precipitates, but exist in the material in the form of larger, hard particles, these particles are likely to have a negative impact on the mechanical properties of the steel. The harm of such large-sized hard particles to the alloy is comparable to the adverse effects of large-sized non-deformed oxide particles on the fatigue life, impact toughness and other properties of steel. Similarly, the δ phase precipitated during forging and heat treatment can improve the high-temperature durability of the alloy on the one hand, but excessive or elongated δ phases may also harm the plasticity, toughness and corrosion resistance of the alloy. Therefore, in industrial production, the identification and characteristic statistics of micron-sized second phases such as carbonitrides and δ phases in alloys are of great significance for subsequent composition adjustment and process improvement.
[0005] In order to measure the influence of the second phase in the microstructure, researchers often conduct quantitative evaluation of the second phase. The traditional identification method mainly relies on software such as Image-Pro Plus for analysis: importing the image into the software and adjusting the RGB value so that the software can effectively identify the second phase such as carbonitride and δ phase, but this method has the following disadvantages:
[0006] (1) It can only process a single image, not batch processing, and requires manual operation each time, which is time-consuming and laborious;
[0007] (2) When the captured image contains a lot of impurities or noise, no matter how the parameters are adjusted, it cannot effectively identify the second phases such as carbonitrides and δ phases, which in turn affects the subsequent data processing;
[0008] (3) This method relies on the operator's expertise and is subjective.
[0009] In general, the use of software such as Image-Pro Plus places extremely high demands on the quality of the images being identified, and thus places high demands on the alloy samples, image capture, and image preprocessing at industrial sites. However, the industrial site environment is complex and changeable, and it is difficult to ensure that the quality of all images meets the requirements. Therefore, Image-Pro Plus software can only identify some high-quality images.
[0010] Fundamentally, traditional statistical methods cannot identify carbides, nitrides, dirt on the sample surface, or the matrix like the human brain can. The human brain is unable to quickly screen and calculate pixel by pixel. Summary of the invention
[0011] In order to solve the above technical problems, the present invention provides an instance segmentation detection method and application based on improved YOLOv8s, which can replace the threshold segmentation-based method, meet the high-precision, high-speed, and batch automated detection requirements in industrial scenarios, and will not affect the detection results due to the quality of the input image.
[0012] The technical solution adopted by the present invention is an instance segmentation detection method based on improved YOLOv8s, the method collects a data set to be segmented and preprocesses it, builds an improved YOLOv8s model and trains it with the preprocessed data set; the improved YOLOv8s model includes a Backbone module, a Neck module and a Head module which are arranged in sequence;
[0013] A spatial depth conversion convolution block (SPDConv) is set in conjunction with the Backbone module;
[0014] A small target detection layer is set up in conjunction with the Neck module and the Head module.
[0015] Preferably, the spatial-to-depth conversion convolution block includes a spatial-to-depth layer and a non-strided convolution layer;
[0016] The input size is (S, S, C1), which is converted into 4 sub-feature maps through the space-to-depth layer. Several sub-feature maps are concatenated along the channel direction to obtain a size of X′ is transformed into a new size of The feature map X"; where C2 <scale 2 C1, scale is batch size.
[0017] Preferably, the Backbone module includes a number of C2f blocks arranged in sequence corresponding to the detection targets;
[0018] There are two spatial depth conversion convolution blocks before the first C2f block, one or more convolution layers are set between the two spatial depth conversion convolution blocks, and the remaining C2f blocks are connected to the previous C2f block through the corresponding convolution layers;
[0019] The last C2f block is connected to the first upsampling layer of the Neck module through a fast spatial pyramid pooling layer and associated with the output of the small object detection layer, and the remaining C2f blocks are connected to the corresponding connection layers in the Neck module.
[0020] Preferably, the Neck module includes an upsampling branch;
[0021] The upsampling branch includes a number of C2f blocks corresponding to the small target detection layer arranged in sequence, and any C2f block is connected to the corresponding C2f block in the Backbone module through the upsampling layer and the connection layer; the last C2f block of the upsampling branch outputs large target features.
[0022] Preferably, the Neck module further includes a convolutional splicing branch;
[0023] The convolutional splicing branch includes several C2f blocks corresponding to the large target detection layer arranged in sequence. Any C2f block is connected to the C2f block corresponding to the upper-level target through the convolutional layers and connection layers connected in sequence, and any C2f block outputs the corresponding target feature; except for the connection layer corresponding to the small target detection layer, other connection layers of the convolutional splicing branch are connected to the corresponding C2f blocks in the upsampling branch; the connection layer corresponding to the small target detection layer is associated with the output of the Backbone module.
[0024] Preferably, the improved YOLOv8s model uses SIoU as the loss function, satisfying,
[0025]
[0026] Among them, IoU is the intersection over union ratio, Δ is the distance loss, and Ω is the shape loss.
[0027] Preferably, preprocessing includes screening data, annotation and amplification data.
[0028] An application of the instance segmentation detection method based on improved YOLOv8s is applied to target detection in images and / or videos.
[0029] Preferably, the segmentation detection of second phase particles applied to nickel-based high-temperature alloys is performed, and the data of the mask area is processed during the process, and the number of second phase particles, center of gravity coordinates, area, area fraction and discreteness are calculated based on the data of the mask area; wherein the area fraction is the percentage of the total area of the second phase particles to the total area of the image.
[0030] Preferably, an improved second phase particle dispersion model is constructed to update the dispersion of the second phase particles based on the standard deviation of the shortest distance between the annotated contours and the shortest distance between the annotated contours and the four corners of the minimum circumscribed rectangle.
[0031] The present invention provides an instance segmentation detection method and application based on improved YOLOv8s, which collects a data set to be segmented and performs preprocessing, constructs an improved YOLOv8s model and performs training with the preprocessed data set; the improved YOLOv8s model comprises a Backbone module, a Neck module and a Head module which are arranged in sequence; a spatial depth conversion convolution block is arranged in conjunction with the Backbone module, and a small target detection layer is arranged in conjunction with the Neck module and the Head module; the method is applied to target detection of images and / or videos, such as segmentation detection of second phase particles of nickel-based high-temperature alloys.
[0032] The beneficial effects of the present invention are:
[0033] (1) Setting up an improved YOLOv8s model, including adding an SPDConv layer, a small target detection layer, and using the SIoU loss function, greatly improves the model's detection performance for small targets and reduces the missed detection rate;
[0034] (2) Update the calculation of the discreteness of the second-phase particles and embed it into the second-phase particle identification process to achieve batch detection, and directly calculate the average area fraction, average number, average size, discreteness and other indicators of the second-phase particles;
[0035] (3) The model has good segmentation performance and fast computing speed;
[0036] (4) The target detection process is connected, which is particularly suitable for the second phase particle segmentation detection of nickel-based high-temperature alloys, including but not limited to carbonitride, δ phase identification, grain boundary identification and similar identification work of other steel types. It can also be applied to process including but not limited to induction, self-consumption and other processes, and intelligent identification of other macro objects, such as scrap steel and macro defects; and it is not limited to target detection of photos, but can also realize online recognition and calculation of videos, laying the foundation for the recognition of optical signals in self-consumption processes. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is a structural diagram of the improved YOLOv8s model in the present invention;
[0038] Figure 2 It is a schematic diagram of a comparative experiment in which SPDConv is added to different positions of the model in the present invention;
[0039] Figure 3: It is a comparison diagram of the original image in the embodiment, the detection and recognition by the standard YOLOv8s model and the improved model of the present invention, wherein (a) is the original image, (b) is the image detected and recognized by the standard YOLOv8s model, and (c) is the image detected and recognized by the improved model of the present invention;
[0040] Figure 4 This is a statistical diagram of carbonitride dispersion under ideal conditions;
[0041] Figure 5 A schematic diagram of an improved carbonitride dispersion model constructed for an embodiment of the present invention;
[0042] Figure 6 It is a schematic diagram of the results corresponding to Table 4 after the discreteness calculation is embedded in the carbonitride identification in the embodiment of the present invention. DETAILED DESCRIPTION
[0043] The present invention is further described in detail below in conjunction with embodiments, but the protection scope of the present invention is not limited thereto.
[0044] The present invention relates to an instance segmentation detection method based on improved YOLOv8s. The method collects a data set to be segmented and performs preprocessing, constructs an improved YOLOv8s model and performs training with the preprocessed data set; the improved YOLOv8s model comprises a Backbone module, a Neck module and a Head module which are arranged in sequence;
[0045] A spatial depth conversion convolution block (SPDConv) is set in conjunction with the Backbone module;
[0046] A small target detection layer is set in conjunction with the Neck module and the Head module, so that the network pays more attention to small target detection.
[0047] In addition, the present invention also improves the loss function by changing the CIoU loss to the SIoU loss to further improve the model performance.
[0048] The spatial-to-depth conversion convolution block includes a spatial-to-depth layer and a non-strided convolution layer;
[0049] The input size is (S, S, C1), which is converted into 4 sub-feature maps through the space-to-depth layer. Several sub-feature maps are concatenated along the channel direction to obtain a size of X′ is transformed into a new size of The feature map X"; where C2 <scale 2 C1, scale is batch size.
[0050] In the present invention, the spatial depth conversion convolution block is mainly composed of a space-to-depth layer and a non-strided convolution layer (stride = 1);
[0051] Input a feature map of size (S, S, C1), and convert the input X into several sub-feature maps through the space-to-depth layer. The calculation formula is as follows:
[0052] f (0,0) =X[0:S:scale,0:S:scale],f (*,0) =X[1:S:scale,0:S:scale],
[0053] …
[0054] f (+,-. / 0*,0) =X[scale-1:S:scale,scale-1:S:scale];
[0055] f (0,*) =X[0:S:scale,1:S:scale],f (*.*) =X[1:S:scale,1:S:scale],
[0056] …
[0057] f (+,-. / 0*,*) =X[scale-1:S:scale,scale-1:S:scale];
[0058] f (0,+,-. / 0*) =X[0:S:scale,scale-1:S:scale],
[0059] f (*,+,-. / 0*) =X[1:S:scale,scale-1:S:scale],
[0060] …
[0061] f (+,-. / 0*,+,-. / 0*) =X[scale-1:S:scale,scale-1:S:scale],
[0062] The number of sub-feature maps converted by the SPDConv module is related to the value of the parameter scale. When scale = 2, 4 sub-feature maps will be generated, and their dimensions are When scale=3, 9 sub-feature maps will be generated, and their dimensions are The formula is the matrix slicing operation in Python, where each f represents a sub-feature map. In general, scale = 2, and the generated sub-feature maps are f(0,0)f(0,1)f(1,0)f(1,1).
[0063] After that, X′ is transformed into a new feature map X" with a size of Among them, C2 <scale 2 When C1, scale = 2, the dimension of X" is The use of non-stride convolution here can retain all relevant information. When the step size is greater than 1, although the conversion from X to X" can be obtained, some features will be lost.
[0064] In the present invention, in order to verify the adaptability of the SPDConv module to the overall model, SPDConv is added to different positions of the model for comparative experiments. Figure 2 As shown in the figure, SPD0 means adding SPDConv module to the 0th layer of backbone, SPD01 means adding SPDConv module to the 0th and 3rd layers of backbone, SPD012 means adding SPDConv module to the 0th, 3rd and 6th layers of backbone, SPD0123 means adding SPDConv module to the 0th, 3rd, 6th and 9th layers of backbone, and SPD01234 means adding SPDConv module to the 0th, 3rd, 6th, 9th and 12th layers of backbone. The comparative experimental results of TiN and NbC are shown in Tables 1 and 2 respectively. The precision P, recall R and mAP50 are mainly selected as evaluation indicators.
[0065] Table 1 TiN comparison test results
[0066]
[0067] Table 2 Nbc comparison experimental results
[0068]
[0069]
[0070] From the data in Tables 1 and 2, it can be seen that compared with other added positions, the structural improvement of SPD01 is the most effective in improving the detection and segmentation performance of the model in terms of comprehensive detection and segmentation accuracy and computational complexity. For TiN, the mAP50 values of the detection box (Box) and mask (Mask) are 0.808 and 0.576, respectively, and compared with the unimproved model, the mAP50 values of the detection box (Box) and mask (Mask) are increased by 4.6% and 5.4%, respectively. For NbC, the mAP50 values of the detection box (Box) and mask (Mask) are 0.622 and 0.439, respectively, and compared with the unimproved model, the mAP50 values of the detection box (Box) and mask (Mask) are increased by 3.1% and 1.8%, respectively.
[0071] Therefore, the SPD01 module is selected as an improvement of the present invention.
[0072] The Backbone module includes several C2f blocks corresponding to the detection targets set in sequence;
[0073] There are two spatial depth conversion convolution blocks before the first C2f block, one or more convolution layers are set between the two spatial depth conversion convolution blocks, and the remaining C2f blocks are connected to the previous C2f block through the corresponding convolution layers;
[0074] The last C2f block is connected to the first upsampling layer of the Neck module through a fast spatial pyramid pooling layer and associated with the output of the small object detection layer, and the remaining C2f blocks are connected to the corresponding connection layers in the Neck module.
[0075] The Neck module includes an upsampling branch;
[0076] The upsampling branch includes a number of C2f blocks corresponding to the small target detection layer arranged in sequence, and any C2f block is connected to the corresponding C2f block in the Backbone module through the upsampling layer and the connection layer; the last C2f block of the upsampling branch outputs large target features.
[0077] The Neck module also includes a convolutional splicing branch;
[0078] The convolutional splicing branch includes several C2f blocks corresponding to the large target detection layer arranged in sequence. Any C2f block is connected to the C2f block corresponding to the upper-level target through the convolutional layers and connection layers connected in sequence, and any C2f block outputs the corresponding target feature; except for the connection layer corresponding to the small target detection layer, other connection layers of the convolutional splicing branch are connected to the corresponding C2f blocks in the upsampling branch; the connection layer corresponding to the small target detection layer is associated with the output of the Backbone module.
[0079] In the present invention, a small target detection layer is further added so that the network pays more attention to small target detection. In the instance segmentation tasks including but not limited to carbonitrides, since the targets are small, and some targets even have pixels less than 20×20, the original network mainly uses 80×80, 40×40, and 20×20 size feature maps and detection heads. However, after the model is downsampled, the features of small targets may only have a few pixels or even disappear. Therefore, by adding a 160×160 scale feature map in the Neck layer for feature fusion, the 160×160 scale can better preserve the feature information of small targets and improve the detection accuracy of the model. At the same time, a corresponding detection head is added in the Head layer, and four detection heads are used to work together to improve the model performance.
[0080] The improved YOLOv8s model uses SIoU as the loss function, satisfying
[0081]
[0082] Among them, IoU is the intersection over union ratio, Δ is the distance loss, and Ω is the shape loss.
[0083] Different from YOLOv8 which uses CIoU as its loss function, the present invention replaces CIoU with SIoU, fully considering the direction mismatch between the real box and the predicted box, improving the problem of slow convergence speed and low efficiency of the model, and even producing a worse model.
[0084] Here, the distance loss (Distance Cost) Δ refers to the distance between the center point of the predicted box and the center point of the real box. The calculation formula is:
[0085]
[0086] in,
[0087] Here Λ is the angle cost, indicating whether the direction matches. Its calculation formula is:
[0088]
[0089] in,
[0090] Shape Cost Ω is used to measure the difference between the predicted box and the real box shape. Its calculation formula is:
[0091]
[0092] in,
[0093] The calculation formula of IoU is,
[0094]
[0095] Among them, B g= and B are the center points of the real box and the predicted box, respectively. α and β represent the angles between the line connecting the two center points and the horizontal and vertical directions, respectively. \ and C ] represents the difference between the horizontal and vertical coordinates of the two center points, σ represents the distance between the two center points, C k and C l They represent the width and height of the minimum bounding rectangle of the predicted box and the real box, respectively. The width and height of the real box are w g= 、h g= , the width and height of the prediction box are w and h respectively, and the coordinates of the two center points are and (b cx s,sb c@ r.
[0096] Preprocessing includes data screening, annotation and data amplification.
[0097] The following is a specific description in conjunction with the application.
[0098] The present invention also relates to an application of the instance segmentation detection method based on improved YOLOv8s, which is applied to target detection in images and / or videos.
[0099] It is applied to the segmentation detection of second phase particles of nickel-based high-temperature alloys. During the process, the data of the mask area is processed, and the number of second phase particles, center of gravity coordinates, regional area, area fraction and discreteness are calculated based on the data of the mask area.
[0100] An improved second-phase particle dispersion model is constructed, and the dispersion of the second-phase particles is updated based on the standard deviation of the shortest distance between the annotated contours and the shortest distance between the annotated contours and the four corners of the minimum circumscribed rectangle.
[0101] This embodiment segments the carbonitrides of nickel-based high-temperature alloys. In the application, image acquisition is first performed. Metallographic specimens taken from bars of different specifications of nickel-based high-temperature alloys are selected. The samples are not corroded after grinding and polishing. The sample rolling direction is parallel to the Y axis, and 200X images are obtained through a metallographic microscope. 255 images are selected from the taken images to form a data set, and the resolution of each image is 2240×1524. The selection principles mainly include: fewer impurities in the image, the presence of both carbonitrides (NbC and TiN), and clearer morphology of carbonitrides.
[0102] After all the images in the data set are preprocessed, the Labelme software can be used to annotate the carbonitrides in the images. The annotated outline should coincide with the outline of the carbonitride as much as possible. After the annotation is completed, a json file is generated, including the location information of the carbonitride outline and the category name of the carbonitride. The json file is converted into a txt file so that the improved YOLOv8 network can recognize the annotation information and ensure the normal progress of subsequent training.
[0103] In order to ensure the effectiveness of the subsequently trained model and improve the generalization of the model, the original data set was augmented to include but not limited to image enhancement methods such as mirroring, adding Gaussian noise, adjusting brightness, and adding random points. The size of the augmented data set is 1530 images, which are divided into training set, validation set, and test set in a ratio of 8:1:1.
[0104] After the training is completed, the performance of the model is evaluated. The main evaluation indicators are confusion matrix, precision P (Precision), recall R (Recall) and mean average precision mAP (Mean Average Precision).
[0105] Subsequently, in order to verify the impact of the improved module on the model performance, YOLOv8s was used as the benchmark model. The experimental environment and hyperparameters used in the ablation experiment were exactly the same as those in the training phase. The effect of the model improvement was determined by comparing evaluation indicators such as precision, recall, and mAP50. The experimental results are shown in Table 3, where the small object detection layer was renamed small;
[0106] Table 3 Ablation experiment results
[0107]
[0108] As can be seen from Table 3, with the addition of the small target detection layer, SPDConv and SIoU, the precision, recall rate and mAP50 values of the detection box (Box) increased by 7.4%, 20.4% and 24.2% respectively, and the corresponding indicators of the mask area increased by 13.5%, 16.4% and 17.6% respectively. From the above data, it can be seen that the improved network can effectively improve the model performance and increase the accuracy of carbonitride detection and segmentation.
[0109] After the training model is generated, PyCharm software is used to perform batch prediction. The prediction results under the same parameters before and after improvement are as follows: Figure 3As shown in the comparison figure, it can be seen that the improved model can detect dense small-sized carbonitrides more effectively, and has a better ability to distinguish impurities. In general, the improved model is more effective for detecting carbonitrides in high-temperature alloys.
[0110] Furthermore, in the process of improving the forging process of nickel-based high-temperature alloys, the uniformity of carbide distribution has a significant impact on the difference in the transverse and longitudinal performance of nickel-based high-temperature alloys. Although the existing technology can accurately quantify the average size and quantity of carbides, there is no suitable method for the indicator of carbide particle distribution uniformity. This problem is abstracted into a general calculation indicator - quantitative calculation of the degree of particle dispersion, that is, calculating the standard deviation of the distance between each particle and other particles, such as Figure 4 Ideally, the distribution of particles is completely uniform. In this case, the standard deviation of the distance between each particle and the nearest particle should be 0. At this time, the discreteness of the carbonitride particles is 0, that is, the distribution of carbonitrides is absolutely uniform.
[0111] Considering that the area that can be collected in each image is limited, the nearest particle of carbonitride near the edge of the image may not be in the image, which will cause the statistical discreteness to be larger than the true value. Figure 4 ) is translated and copied 8 times as the eight adjacent neighborhoods of the current image (1×1) to form a new image (3×3), such as Figure 5 As shown, the distance between the nearest particle of the carbide in the central image (1×1) and all the carbides in the new image (3×3) is calculated, thereby solving the problem that the statistical discreteness is larger than the true value;
[0112] However, when only the standard deviation of the distance between each particle and the nearest particle is calculated, there are still cases of misjudgment. When the particle distribution is extremely uneven, such as when large-sized primary carbides are less broken and clustered together, the calculated discreteness is also low. However, under actual conditions, it is believed that the carbide distribution is not uniform in this case. This is a problem that must be encountered when calculating the nearest neighbor distance. The reason is that only the standard deviation of the shortest distance between particles is considered, while the distance between the particle and the edge and corner is ignored. Considering that the actual number of carbide particles is not large enough, consider adding the closest distance between the particle group and the four corners of the rectangle to the array composed of the shortest distance just now, and then the new discreteness can be calculated.
[0113] The discreteness calculation is embedded in the carbonitride identification. The final data processing results are shown in Table 4. The corresponding picture effect diagram in Table 4 is shown in Figure 6 shown.
[0114] Table 4 Data processing results
[0115]
[0116] In the present invention, batch detection is achieved by embedding discrete degree calculation into carbonitride identification.
[0117] The present invention also relates to a computer-readable storage medium in an application, on which an instance segmentation detection program based on improved YOLOv8s is stored. When the program is executed by a processor, the above-mentioned instance segmentation detection method based on improved YOLOv8s is implemented.
[0118] The present invention also relates to a computer device in application, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the instance segmentation detection method based on the improved YOLOv8s is implemented.
[0119] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0120] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0121] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0123] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0124] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. An instance segmentation detection method based on improved YOLOv8s, characterized by: The method collects and preprocesses a data set to be segmented, constructs an improved YOLOv8s model, and trains the model using the preprocessed data set; the improved YOLOv8s model includes a Backbone module, a Neck module, and a Head module that are sequentially coordinated; A spatial depth conversion convolution block is set in conjunction with the Backbone module; A small target detection layer is set up in conjunction with the Neck module and the Head module.
2. The instance segmentation detection method based on improved YOLOv8s according to claim 1, characterized in that: The spatial-to-depth conversion convolution block includes a spatial-to-depth layer and a non-strided convolution layer; The input size is (S, S, C1), which is converted into 4 sub-feature maps through the space-to-depth layer. Several sub-feature maps are concatenated along the channel direction to obtain a size of X ′ , through the non-strided convolution layer to convert X ′ Convert to the new size The feature map X"; where C2 <scale 2 C1, scale is batch size.
3. The instance segmentation detection method based on improved YOLOv8s according to claim 2, characterized in that: The Backbone module includes several C2f blocks corresponding to the detection targets set in sequence; There are two spatial depth conversion convolution blocks before the first C2f block, one or more convolution layers are set between the two spatial depth conversion convolution blocks, and the remaining C2f blocks are connected to the previous C2f block through the corresponding convolution layers; The last C2f block is connected to the first upsampling layer of the Neck module through a fast spatial pyramid pooling layer and associated with the output of the small object detection layer, and the remaining C2f blocks are connected to the corresponding connection layers in the Neck module.
4. The instance segmentation detection method based on improved YOLOv8s according to claim 3, characterized in that: The Neck module includes an upsampling branch; The upsampling branch includes a number of C2f blocks corresponding to the small target detection layer arranged in sequence, and any C2f block is connected to the corresponding C2f block in the Backbone module through the upsampling layer and the connection layer; the last C2f block of the upsampling branch outputs large target features.
5. The instance segmentation detection method based on improved YOLOv8s according to claim 4, characterized in that: The Neck module also includes a convolutional splicing branch; The convolutional splicing branch includes several C2f blocks corresponding to the large target detection layer arranged in sequence. Any C2f block is connected to the C2f block corresponding to the upper-level target through the convolutional layers and connection layers connected in sequence, and any C2f block outputs the corresponding target feature; except for the connection layer corresponding to the small target detection layer, other connection layers of the convolutional splicing branch are connected to the corresponding C2f blocks in the upsampling branch; the connection layer corresponding to the small target detection layer is associated with the output of the Backbone module.
6. The instance segmentation detection method based on improved YOLOv8s according to claim 1, characterized in that: The improved YOLOv8s model uses SIoU as the loss function, satisfying Among them, IoU is the intersection over union ratio, Δ is the distance loss, and Ω is the shape loss.
7. The instance segmentation detection method based on improved YOLOv8s according to claim 1, characterized in that: Preprocessing includes data screening, annotation and data amplification.
8. An application of the instance segmentation detection method based on improved YOLOv8s according to any one of claims 1 to 7, characterized in that: Object detection in images and / or videos.
9. The use according to claim 8, characterized in that: It is applied to the segmentation detection of second phase particles of nickel-based high-temperature alloys. During the process, the data of the mask area is processed, and the number of second phase particles, center of gravity coordinates, regional area, area fraction and discreteness are calculated based on the data of the mask area.
10. The use according to claim 9, characterized in that: An improved second-phase particle dispersion model is constructed, and the dispersion of the second-phase particles is updated based on the standard deviation of the shortest distance between the annotated contours and the shortest distance between the annotated contours and the four corners of the minimum circumscribed rectangle.
Citation Information
Cited By
Method and device for identifying nickel shots according to particle sizes
CN121353252A