Image classification method and apparatus, computer device, and storage medium
Abstract
Disclosed are an image classification method performed by a computer device. The method includes: acquiring an image feature of a pathological image; extracting, for each scale in multiple scales, a local feature corresponding to the scale from the image feature; splicing the local features respectively corresponding to the scales to obtain a spliced image feature; and classifying the spliced image feature to obtain a category to which the pathological image belongs. According to the method provided in the embodiments of this application, the local features corresponding to different scales contain different information, so that the finally obtained spliced image feature contains feature information corresponding to different scales, and the feature information of the spliced image feature is enriched. The category to which the pathological image belongs is determined based on the spliced image feature, so that the accuracy of the category is ensured.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . An image classification method, performed by a computer device and comprising:
acquiring an image feature of a pathological image, further including:
segmenting the pathological image at multiple scales, each scale having a multiple sub-images and each sub-image having a respective position in the pathological image;
performing feature extraction on each sub-image to obtain an image feature of the sub-image; and
splicing the image features of the multiple sub-images corresponding to one scale based on positions of the multiple sub-images in the pathological image to obtain the image feature of the pathological image at the scale;
extracting, for each scale in the multiple scales, multiple local features corresponding to the scale from the image feature of the pathological image at the scale, wherein each local feature comprises second sub-features of the sub-images having the same scale at multiple positions of the pathological image; splicing the local features respectively corresponding to the scales to obtain a spliced image feature, further including:
for each scale:
splicing the second sub-features in the multiple extracted local features corresponding to the scale to obtain a first feature vector for each sub-image corresponding to the scale:
updating the first feature vector to obtain a second feature vector for the sub-image corresponding to the scale;
constructing a three-dimensional feature matrix using the multiple second feature vectors of sub-images corresponding to the scale based on positions of the multiple local features in the image feature having the same scale as an aggregated feature corresponding to the scale; and
splicing the multiple aggregated features respectively corresponding to the scales to obtain the spliced image feature; and
classifying the spliced image feature to obtain a category to which the pathological image belongs.
2 . The method according to claim 1 , wherein the spliced image feature comprises first sub-features at multiple positions; and the classifying the spliced image feature to obtain a category to which the pathological image belongs comprises:
updating each first sub-feature of the multiple first sub-features to obtain a first updated feature corresponding to the first sub-feature; using the first updated features corresponding to the multiple first sub-features to constitute an updated spliced image feature based on positions of the multiple first sub-features in the spliced image feature; and classifying the updated spliced image feature to obtain the category to which the pathological image belongs.
3 . The method according to claim 2 , wherein each first updated feature is a vector; and the using the first updated features corresponding to the multiple first sub-features to constitute an updated spliced image feature based on positions of the multiple first sub-features in the spliced image feature comprises:
using the first updated features corresponding to the multiple first sub-features to constitute a three-dimensional feature matrix based on the positions of the multiple first sub-features in the spliced image feature as the updated spliced image feature.
4 . The method according to claim 1 , wherein the spliced image feature comprises first sub-features at multiple positions; and before the classifying the spliced image feature to obtain a category to which the pathological image belongs, the method further comprises:
fusing each first sub-feature with a corresponding position feature indicating a position of the first sub-feature in the spliced image feature to obtain a second updated feature corresponding to the first sub-feature; and using the second updated features to constitute an updated spliced image feature based on the positions of the multiple first sub-features in the spliced image feature.
5 . The method according to claim 1 , wherein the splicing the multiple aggregated features to obtain the spliced image feature comprises:
splicing features at the same position in the multiple aggregated features to obtain feature vectors corresponding to multiple positions; and using the feature vectors corresponding to multiple positions to constitute a three-dimensional feature matrix as the spliced image feature.
6 . A computer device, comprising a processor and a memory, the memory storing at least one computer program that, when loaded and executed by the processor, causes the computer device to perform an image classification method including:
acquiring an image feature of a pathological image, further including:
segmenting the pathological image at multiple scales, each scale having a multiple sub-images and each sub-image having a respective position in the pathological image;
performing feature extraction on each sub-image to obtain an image feature of the sub-image; and
splicing the image features of the multiple sub-images corresponding to one scale based on positions of the multiple sub-images in the pathological image to obtain the image feature of the pathological image at the scale;
extracting, for each scale in the multiple scales, multiple local features corresponding to the scale from the image feature of the pathological image at the scale, wherein each local feature comprises second sub-features of the sub-images having the same scale at multiple positions of the pathological image; splicing the local features respectively corresponding to the scales to obtain a spliced image feature, further including:
for each scale:
splicing the second sub-features in the multiple extracted local features corresponding to the scale to obtain a first feature vector for each sub-image corresponding to the scale:
updating the first feature vector to obtain a second feature vector for the sub-image corresponding to the scale;
constructing a three-dimensional feature matrix using the multiple second feature vectors of sub-images corresponding to the scale based on positions of the multiple local features in the image feature having the same scale as an aggregated feature corresponding to the scale; and
splicing the multiple aggregated features respectively corresponding to the scales to obtain the spliced image feature; and
classifying the spliced image feature to obtain a category to which the pathological image belongs.
7 . The computer device according to claim 6 , wherein the spliced image feature comprises first sub-features at multiple positions; and the classifying the spliced image feature to obtain a category to which the pathological image belongs comprises:
updating each first sub-feature of the multiple first sub-features to obtain a first updated feature corresponding to the first sub-feature; using the first updated features corresponding to the multiple first sub-features to constitute an updated spliced image feature based on positions of the multiple first sub-features in the spliced image feature; and classifying the updated spliced image feature to obtain the category to which the pathological image belongs.
8 . The computer device according to claim 7 , wherein each first updated feature is a vector; and the using the first updated features corresponding to the multiple first sub-features to constitute an updated spliced image feature based on positions of the multiple first sub-features in the spliced image feature comprises:
using the first updated features corresponding to the multiple first sub-features to constitute a three-dimensional feature matrix based on the positions of the multiple first sub-features in the spliced image feature as the updated spliced image feature.
9 . The computer device according to claim 6 , wherein the spliced image feature comprises first sub-features at multiple positions; and before the classifying the spliced image feature to obtain a category to which the pathological image belongs, the method further comprises:
fusing each first sub-feature with a corresponding position feature indicating a position of the first sub-feature in the spliced image feature to obtain a second updated feature corresponding to the first sub-feature; and using the second updated features to constitute an updated spliced image feature based on the positions of the multiple first sub-features in the spliced image feature.
10 . The computer device according to claim 6 , wherein the splicing the multiple aggregated features to obtain the spliced image feature comprises:
splicing features at the same position in the multiple aggregated features to obtain feature vectors corresponding to multiple positions; and using the feature vectors corresponding to multiple positions to constitute a three-dimensional feature matrix as the spliced image feature.
11 . A non-transitory computer-readable storage medium, storing at least one computer program that, when loaded and executed by a processor of a computer device, causes the computer device to perform an image classification method including:
acquiring an image feature of a pathological image, further including:
segmenting the pathological image at multiple scales, each scale having a multiple sub-images and each sub-image having a respective position in the pathological image;
performing feature extraction on each sub-image to obtain an image feature of the sub-image; and
splicing the image features of the multiple sub-images corresponding to one scale based on positions of the multiple sub-images in the pathological image to obtain the image feature of the pathological image at the scale;
extracting, for each scale in the multiple scales, multiple local features corresponding to the scale from the image feature of the pathological image at the scale, wherein each local feature comprises second sub-features of the sub-images having the same scale at multiple positions of the pathological image; splicing the local features respectively corresponding to the scales to obtain a spliced image feature, further including:
for each scale:
splicing the second sub-features in the multiple extracted local features corresponding to the scale to obtain a first feature vector for each sub-image corresponding to the scale;
updating the first feature vector to obtain a second feature vector for the sub-image corresponding to the scale;
constructing a three-dimensional feature matrix using the multiple second feature vectors of sub-images corresponding to the scale based on positions of the multiple local features in the image feature having the same scale as an aggregated feature corresponding to the scale; and
splicing the multiple aggregated features respectively corresponding to the scales to obtain the spliced image feature; and
classifying the spliced image feature to obtain a category to which the pathological image belongs.
12 . The non-transitory computer-readable storage medium according to claim 11 , wherein the spliced image feature comprises first sub-features at multiple positions; and
the classifying the spliced image feature to obtain a category to which the pathological image belongs comprises: updating each first sub-feature of the multiple first sub-features to obtain a first updated feature corresponding to the first sub-feature; using the first updated features corresponding to the multiple first sub-features to constitute an updated spliced image feature based on positions of the multiple first sub-features in the spliced image feature; and classifying the updated spliced image feature to obtain the category to which the pathological image belongs.
13 . The non-transitory computer-readable storage medium according to claim 12 , wherein each first updated feature is a vector; and the using the first updated features corresponding to the multiple first sub-features to constitute an updated spliced image feature based on positions of the multiple first sub-features in the spliced image feature comprises:
using the first updated features corresponding to the multiple first sub-features to constitute a three-dimensional feature matrix based on the positions of the multiple first sub-features in the spliced image feature as the updated spliced image feature.
14 . The non-transitory computer-readable storage medium according to claim 11 , wherein the spliced image feature comprises first sub-features at multiple positions; and
before the classifying the spliced image feature to obtain a category to which the pathological image belongs, the method further comprises: fusing each first sub-feature with a corresponding position feature indicating a position of the first sub-feature in the spliced image feature to obtain a second updated feature corresponding to the first sub-feature; and using the second updated features to constitute an updated spliced image feature based on the positions of the multiple first sub-features in the spliced image feature.
15 . The non-transitory computer-readable storage medium according to claim 11 , wherein the splicing the multiple aggregated features to obtain the spliced image feature comprises:
splicing features at the same position in the multiple aggregated features to obtain feature vectors corresponding to multiple positions; and using the feature vectors corresponding to multiple positions to constitute a three-dimensional feature matrix as the spliced image feature.Join the waitlist — get patent alerts
Track US12524992B2 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.