WO2022252640A1 - 图像分类预处理、图像分类方法、装置、设备及存储介质 - Google Patents

图像分类预处理、图像分类方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022252640A1
WO2022252640A1 PCT/CN2022/072287 CN2022072287W WO2022252640A1 WO 2022252640 A1 WO2022252640 A1 WO 2022252640A1 CN 2022072287 W CN2022072287 W CN 2022072287W WO 2022252640 A1 WO2022252640 A1 WO 2022252640A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
resolution
step size
transformation
preset
Prior art date
Application number
PCT/CN2022/072287
Other languages
English (en)
French (fr)
Inventor
周细文
庄伯金
肖京
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022252640A1 publication Critical patent/WO2022252640A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the technical field of image processing, and in particular to an image classification preprocessing, an image classification method, device, equipment and storage medium.
  • Embodiments of the present application provide an image classification preprocessing, an image classification method, device, device, and storage medium, so as to solve the problem of low accuracy of image classification.
  • An image classification preprocessing method comprising:
  • the image classification preprocessing instruction includes a target image resolution, a preset number of image sampling times, and an initial image with an initial image resolution;
  • Adjust the initial image from the initial image resolution to The target image resolution is used to obtain the image to be classified.
  • An image classification method comprising:
  • the image classification instruction includes specified image resolution, number of image processing times, and images to be processed with preset image resolution;
  • the above image classification preprocessing method determines the image to be classified corresponding to the image to be processed
  • the image to be classified is input into a preset image classification model to obtain an image classification result.
  • An image classification preprocessing device comprising:
  • a preprocessing instruction receiving module is used to receive an image classification preprocessing instruction;
  • the image classification preprocessing instruction includes target image resolution, preset image sampling times and an initial image with initial image resolution;
  • a floating-point conversion step size determination module configured to determine a floating-point conversion step size according to the target image resolution, the number of preset image sampling times, and the initial image resolution;
  • the step size rounding module is used to round the floating-point conversion step size through a preset integer simulation method to obtain an upward integer conversion step size and a downward integer conversion step size;
  • a step size loss weight determination module configured to determine the first step loss weight according to the upward integer conversion step size and the floating point conversion step size; at the same time, according to the downward integer conversion step size and the floating point conversion step Long determines the second step length loss weight;
  • a resolution adjustment module configured to convert the initial image from the original image to The initial image resolution is adjusted to the target image resolution to obtain the image to be classified.
  • An image classification device comprising:
  • the image classification instruction receiving module is used to receive the image classification instruction; the image classification instruction includes specified image resolution, image processing times and images to be processed with preset image resolution;
  • the image preprocessing module is used to record the specified image resolution as the target image resolution, record the image processing times as the preset image sampling times, record the image to be processed as the initial image, and record the preset image resolution as The number of image samplings is preset, and the image to be classified corresponding to the image to be processed is determined through the above image classification preprocessing method;
  • An image classification module configured to input the image to be classified into a preset image classification model to obtain an image classification result.
  • a computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and operable on the processor, and the processor implements the following steps when executing the computer-readable instructions:
  • the image classification preprocessing instruction includes a target image resolution, a preset number of image sampling times, and an initial image with an initial image resolution;
  • Adjust the initial image from the initial image resolution to The target image resolution is used to obtain the image to be classified.
  • a computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and operable on the processor, and the processor implements the following steps when executing the computer-readable instructions:
  • the image classification instruction includes specified image resolution, number of image processing times, and images to be processed with preset image resolution;
  • the above image classification preprocessing method determines the image to be classified corresponding to the image to be processed
  • the image to be classified is input into a preset image classification model to obtain an image classification result.
  • One or more readable storage media storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the following steps:
  • the image classification preprocessing instruction includes a target image resolution, a preset number of image sampling times, and an initial image with an initial image resolution;
  • Adjust the initial image from the initial image resolution to The target image resolution is used to obtain the image to be classified.
  • One or more readable storage media storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the following steps:
  • the image classification instruction includes specified image resolution, number of image processing times, and images to be processed with preset image resolution;
  • the above image classification preprocessing method determines the image to be classified corresponding to the image to be processed
  • the image to be classified is input into a preset image classification model to obtain an image classification result.
  • the image classification preprocessing method performs rounding processing on the floating-point transformation step size, and uses the first step loss weight and the second step loss weight Compensate for the loss of the aforementioned rounding processing, so that the pixel information of the initial image may not be modified when the initial image is preprocessed, that is, all features in the initial image will not be eliminated during the preprocessing process, thereby ensuring the initial
  • the feature integrity of the image improves the accuracy of image classification for the preprocessed image to be classified.
  • the image classification method generates the image to be classified by means of the above image classification preprocessing method, and can identify the subtle features in the image to be classified when the image is classified by the preset image classification model, and then can identify two differences, but only Distinction points between images with subtle feature differences improve the accuracy of image classification.
  • Fig. 1 is a schematic diagram of an application environment of an image classification preprocessing method or an image classification method in an embodiment of the present application
  • Fig. 2 is a flowchart of an image classification preprocessing method in an embodiment of the present application
  • Fig. 3 is a flowchart of step S50 in the image classification preprocessing method in an embodiment of the present application
  • Fig. 4 is a flowchart of an image classification method in an embodiment of the present application.
  • Fig. 5 is a functional block diagram of an image classification preprocessing device in an embodiment of the present application.
  • FIG. 6 is a functional block diagram of the resolution adjustment module 50 in the image classification preprocessing device in an embodiment of the present application.
  • Fig. 7 is a functional block diagram of an image classification device in an embodiment of the present application.
  • FIG. 8 is a schematic diagram of computer equipment in an embodiment of the present application.
  • the image classification preprocessing method provided in the embodiment of the present application can be applied in the application environment shown in FIG. 1 .
  • the image classification preprocessing method is applied in an image classification preprocessing system.
  • the image classification preprocessing system includes a client and a server as shown in FIG. problem of low accuracy.
  • the client is also referred to as the client, which refers to a program corresponding to the server and providing local services for the client.
  • Clients can be installed on, but not limited to, various personal computers, laptops, smartphones, tablets and portable wearable devices.
  • the server can be implemented by an independent server or a server cluster composed of multiple servers.
  • an image classification preprocessing method is provided, and the method is applied to the server in FIG. 1 as an example for illustration, including the following steps:
  • S10 Receive an image classification preprocessing instruction;
  • the image classification preprocessing instruction includes a target image resolution, a preset number of image sampling times, and an initial image with an initial image resolution;
  • the image classification preprocessing instructions can be sent by the user through devices such as mobile terminals, computers, etc., or can be automatically generated after the user inputs the target image resolution, the preset number of image sampling times, and the initial image with the initial image resolution of.
  • the target image resolution refers to the target value specified by the user or the image classification model that needs to convert images of various resolutions into images of the same resolution;
  • the number of scale conversions (for example, the number of scaling);
  • the initial image can be an image in a different application scenario, for example, the initial image can be a certificate photo, a pathological photo, etc., and the initial image resolution is the image resolution of the original image.
  • S20 Determine the floating-point conversion step size according to the target image resolution, the preset number of image sampling times, and the initial image resolution;
  • the floating-point transformation step refers to the ratio by which the target image resolution needs to be reduced after each scale transformation. For example, assuming that the floating-point transformation step is 2.37 and the initial image resolution is 300*300, then After a scale transformation, the initial image resolution is transformed to 126.58*126.58.
  • the resolution ratio is determined according to the target image resolution and the initial image resolution; the resolution ratio is determined according to the resolution ratio and the preset image sampling times.
  • the floating-point transformation step size is the floating-point transformation step size.
  • the floating-point conversion step size can be determined according to the following expression:
  • a is the floating-point conversion step size
  • N is the initial image resolution
  • m is the target image resolution
  • t is the preset image sampling times.
  • some model frameworks such as machine learning The torch framework in the framework, the neural network framework, etc.
  • the floating-point transformation step size needs to be rounded by the preset integer simulation method to obtain an upward integer transformation
  • the initial image can be scaled.
  • step S30 includes:
  • the floating-point conversion step size is rounded up by the round-up method to obtain the integer-up conversion step size; The method of adding one to the integer part of the number in the decimal position.
  • the floating-point conversion step size is rounded down by the round-down method to obtain the integer-down conversion step size. It can be understood that the rounding-up processing refers to the method of subtracting one from the integer part regardless of the number in the decimal position of the floating-point integer step size.
  • the floating-point conversion step size is upwardly adjusted by the round-up method.
  • the rounding process is performed to obtain the step size of the upward integer transformation; the step size of the floating point transformation is rounded down by the method of rounding down to obtain the step size of the downward integer transformation.
  • the floating-point conversion step size is 2.37
  • the floating-point conversion step size is rounded up
  • the resulting upward integer conversion step size is 3, and the floating-point conversion step size is rounded down
  • the obtained downward integer transformation step size is 2.
  • S40 Determine the loss weight of the first step according to the step size of the upward integer transformation and the step size of the floating point transformation; at the same time, determine the loss of the second step size according to the step size of the downward integer transformation and the step size of the floating point transformation Weights;
  • the upward integer transformation step and the float The difference between point transformation steps is determined as the first step loss weight; the difference between the floating point transformation step and the down integer transformation step is determined as the second step loss weight.
  • the step size of the floating-point transformation is 2.37
  • the step size of the upward integer transformation obtained through step S30 is 3
  • the step size of the downward integer transformation obtained through step S30 is 2
  • the corresponding first-step loss weight is 0.63 (ie 3 ⁇ 2.37)
  • the second step loss weight is 0.37 (that is, 2.37 ⁇ 2).
  • S50 Convert the initial image from the initial image resolution to Adjust to the target image resolution to obtain the image to be classified. It can be understood that the image to be classified is the image waiting for image classification after the image classification preprocessing in steps S20 to S50, that is, the image classification preprocessing representing the initial image has been completed after the image to be classified is obtained.
  • step S50 includes:
  • S501 Perform image transformation on the initial image according to the upward integer transformation step to obtain a first upward feature map, and perform image transformation on the initial image according to the downward integer transformation step to obtain a first downward feature map Afterwards, add one to the number of image transformations;
  • the image transformation proposed in this embodiment such as image scaling, image enlargement, etc.
  • image transformation method can be used as an image transformation method. After the first upward feature map and the first downward feature map are obtained, it is recorded as the number of image transformations once.
  • the loss weight of the first step is determined according to the step size of the upward integer transformation and the step size of the floating point transformation; at the same time, the second step is determined according to the step size of the downward integer transformation and the step size of the floating point transformation
  • the long loss weight perform image transformation on the initial image according to the upward integer transformation step to obtain the first upward feature map, that is, after performing image transformation on the initial image resolution of the initial image according to the upward integer transformation step, the first upward feature map
  • the image resolution of can be determined according to the initial image resolution and the step size of the upward integer transformation.
  • the image transformation this time is to scale the initial image, and then the image resolution of the first upward feature map is 100*100 (300/3).
  • the loss weight of the first step is determined according to the step size of the upward integer transformation and the step size of the floating point transformation; at the same time, the second step is determined according to the step size of the downward integer transformation and the step size of the floating point transformation
  • the image resolution of the first downward feature map can be based on the initial image resolution and the downward integer transformation
  • the step size is determined.
  • the image transformation this time is to scale the initial image
  • the image resolution of the first upward feature map is 150*150 (300/2)
  • the number of image transformations is accumulated by one.
  • S502 Perform feature map weighted fusion according to the first step loss weight, the second step loss weight, the first upward feature map, and the first downward feature map to obtain a first transformation with a first transformation resolution image; the first transformation resolution is determined according to the initial image resolution and the floating-point transformation step;
  • the image resolution of the first upward feature map is converted to the first transformation resolution, and then the first upward transformation feature map is obtained; at the same time, the image resolution of the first downward feature map is rate conversion to the first transformation resolution, and then obtain the first down-conversion feature map; determine the first up-weight feature map according to the first up-transformation feature map and the second step loss weight, and determine the first up-weight feature map according to the first down-transformation feature map and The first step is to determine the first downward weight feature map with the long loss weight, and then perform weighted fusion of the first upward weight feature map and the first downward weight feature map to obtain the first transformation with the first transformation resolution image.
  • the first transformation resolution can be determined according to the initial image resolution and the floating-point transformation step; for example, suppose the initial image resolution is 300*300, the floating-point transformation step is 2.37, and the target image resolution is 4* 4.
  • the corresponding first transformation resolution is the quotient of the initial image resolution and the floating-point transformation step size, that is, the first transformation resolution is 126.58 (300/2.37), so that the floating-point transformation step size can be
  • some model frameworks such as the torch framework in the machine learning framework, neural network framework, etc.
  • the image resolution of the first upward feature map and the first downward feature map is restored to the first transformation resolution (that is, the resolution obtained when the model framework can calculate the floating-point transformation step size), which improves the image classification prediction.
  • the convenience of processing can also keep all the original features of the original image from being destroyed, and provide accurate images to be classified for subsequent image classification.
  • S503 Determine whether the number of times of image transformation is equal to the number of times of preset image sampling
  • weighted fusion of feature maps is performed according to the first step loss weight, the second step loss weight, the first upward feature map and the first downward feature map to obtain the first transformation resolution
  • step S503 that is, after determining whether the number of times of image transformation is equal to the number of times of preset image sampling, it further includes:
  • the second transformation resolution is determined according to the first transformation resolution and the floating-point transformation step size
  • performing image transformation on the first converted image according to the upward integer transformation step to obtain a second upward feature map and performing image transformation on the first converted image according to the downward integer transformation step to obtain
  • the image resolution of the second upward feature map is converted to the second transformation resolution, and then the second upward transformation feature map is obtained
  • the image resolution of the second downward feature map is converted to the first Second transform the resolution, and then obtain the second down-conversion feature map
  • determine the second up-weight feature map according to the second up-transformation feature map and the second step size loss weight and determine the second up-weight feature map according to the second down-transformation feature map and the first step length
  • the loss weight determines the second down-weighted feature map, and then performs weighted fusion of the feature maps on the second up-weighted feature map and the second down-weighted feature map to obtain a second transformed image with a second transformed resolution.
  • weighted fusion of feature maps is performed according to the first step loss weight, the second step loss weight, the second upward feature map, and the second downward feature map to obtain the second transformation resolution 2.
  • the rounding process is performed on the floating-point transformation step size, and the loss compensation is performed on the aforementioned rounding process through the first step size loss weight and the second step size loss weight, so that when the initial image is preprocessed , the pixel information of the initial image may not be modified, that is, all features in the initial image will not be eliminated during the preprocessing process, thereby ensuring the feature integrity of the initial image and improving the performance of the image to be classified after preprocessing. Accuracy in image classification.
  • an image classification method is provided, and the method is applied to the server in FIG. 1 as an example for illustration, including the following steps:
  • S60 Receive an image classification instruction; the image classification instruction includes a specified image resolution, image processing times, and images to be processed with a preset image resolution;
  • specifying the image resolution means that the user or the preset image classification model specifies a target value that needs to convert images of various resolutions into images of the same resolution.
  • the number of image processing refers to the number of scale conversions that need to be performed on the image to be processed during the image classification preprocessing process.
  • the images to be processed can be images in different application scenarios.
  • the initial images can be ID photos, pathological photos, etc.
  • the preset image resolution is the image resolution of the images to be processed.
  • S70 Record the specified image resolution as the target image resolution, record the image processing times as the preset image sampling times, record the image to be processed as the initial image, and record the preset image resolution as the preset image sampling times , determining the image to be classified corresponding to the image to be processed by the above image classification preprocessing method;
  • the specified image resolution as the target image resolution
  • record the image processing times as the preset image sampling times
  • record the preset image resolution The rate is recorded as the preset number of image sampling times, and the image to be classified corresponding to the image to be processed is determined through the above image classification preprocessing method.
  • S80 Input the image to be classified into a preset image classification model to obtain an image classification result.
  • the image to be classified corresponding to the image to be processed is determined by the above-mentioned image classification preprocessing method, at this time, the image resolution of the image to be classified is converted into a specified image resolution, and then the image to be classified can be input to the preset image
  • the preset image classification model can perform image classification on the image to be classified to obtain the image classification result.
  • the preset image classification model can be a classification model based on the VGG (Visual Geometry Group Network, Visual Geometry Group Network) network, or a classification model based on the ResNets (Residual Network, residual network) network, so through
  • VGG Visual Geometry Group Network
  • ResNets Residual Network, residual network
  • an image classification preprocessing device corresponds to the image classification preprocessing method in the foregoing embodiments one by one.
  • the image classification preprocessing device includes a preprocessing instruction receiving module 10 , a floating point conversion step size determination module 20 , a step size rounding module 30 , a step size loss weight determination module 40 and a resolution adjustment module 50 .
  • the detailed description of each functional module is as follows:
  • a preprocessing instruction receiving module 10 configured to receive an image classification preprocessing instruction;
  • the image classification preprocessing instruction includes a target image resolution, a preset number of image sampling times, and an initial image with an initial image resolution;
  • a floating-point conversion step determination module 20 configured to determine a floating-point conversion step according to the target image resolution, the number of preset image sampling times, and the initial image resolution;
  • the step size rounding module 30 is used to round the floating-point conversion step size by a preset integer simulation method to obtain an upward integer conversion step size and a downward integer conversion step size;
  • the step size loss weight determination module 40 is used to determine the first step size loss weight according to the step size of the upward integer transformation and the step size of the floating point transformation; at the same time, according to the step size of the downward integer transformation and the floating point transformation The step size determines the second step size loss weight;
  • a resolution adjustment module 50 configured to convert the initial image from The initial image resolution is adjusted to the target image resolution to obtain an image to be classified.
  • the floating-point conversion step size determination module 20 includes:
  • a resolution ratio determining unit configured to determine a resolution ratio according to the target image resolution and the initial image resolution
  • a floating-point conversion step size determining unit configured to determine the floating-point conversion step size according to the resolution ratio and the preset image sampling times.
  • the step length rounding module 30 includes:
  • an upward confirmation processing unit configured to perform upward rounding processing on the floating point conversion step size by the upward rounding method to obtain the upward integer conversion step size
  • the downward confirmation processing unit is configured to perform a downward rounding process on the floating-point conversion step size by the downward rounding method to obtain the downward integer conversion step size.
  • the step size loss weight determination module 40 includes:
  • a first step loss weight determination unit configured to determine the difference between the step size of the upward integer transformation and the step size of the floating point transformation as the first step loss weight
  • a second step size loss weight determination unit configured to determine a difference between the floating point conversion step size and the downward integer conversion step size as the second step size loss weight.
  • the resolution adjustment module 50 includes:
  • the first image scaling unit 501 is configured to perform image transformation on the initial image according to the upward integer transformation step to obtain a first upward feature map, and perform image transformation on the initial image according to the downward integer transformation step After the first downward feature map is obtained, the number of image transformations is accumulated by one;
  • the first feature map fusion unit 502 is configured to perform weighted fusion of feature maps according to the first step loss weight, the second step loss weight, the first upward feature map, and the first downward feature map to obtain a feature map with the first step.
  • the first zoom times comparison unit 503 is used to determine whether the image transformation times and the preset image sampling times are equal;
  • the first to-be-classified image determining unit 504 is configured to record the first converted resolution as the target image resolution when the number of times of image transformation is equal to the preset number of image samples, and record the first The converted image is recorded as the image to be classified.
  • the resolution adjustment module 50 also includes:
  • the second image scaling unit is configured to perform image transformation on the first converted image according to the upward integer transformation step size to obtain a second upward feature map when the number of times of image transformation is not equal to the number of preset image sampling times , and after performing image transformation on the first converted image according to the step size of the downward integer transformation to obtain a second downward feature map, adding one to the number of image transformations;
  • the second feature map fusion unit is used to perform weighted fusion of feature maps according to the first step loss weight, the second step loss weight, the second upward feature map, and the second downward feature map to obtain a feature map with the second A second converted image of a transformed resolution; the second transformed resolution is determined according to the first transformed resolution and the floating-point transformed step size;
  • a second zoom times comparison unit configured to determine whether the image transformation times are equal to the preset image sampling times
  • the first image-to-be-classified determining unit is configured to record the second transformed resolution as the target image resolution when the number of times of image transformation is equal to the preset number of image samples, and convert the second converted The image record is the image to be classified.
  • Each module in the above-mentioned image classification preprocessing device can be fully or partially realized by software, hardware and a combination thereof.
  • the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
  • an image classification device is provided, and the image classification device corresponds to the image classification method in the foregoing embodiments one by one.
  • the image classification preprocessing device includes an image classification instruction receiving module 60 , an image preprocessing module 70 and an image classification module 80 .
  • the detailed description of each functional module is as follows:
  • An image classification instruction receiving module 60 configured to receive an image classification instruction; the image classification instruction includes specified image resolution, image processing times, and images to be processed with preset image resolutions;
  • the image preprocessing module 70 is used to record the specified image resolution as the target image resolution, record the number of image processing times as the preset image sampling times, record the image to be processed as the initial image, and record the preset image resolution To preset the number of image sampling times, the image to be classified corresponding to the image to be processed is determined through the above image classification preprocessing method;
  • the image classification module 80 is configured to input the image to be classified into a preset image classification model to obtain an image classification result.
  • Each module in the above-mentioned image classification device can be fully or partially realized by software, hardware and a combination thereof.
  • the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
  • a computer device is provided.
  • the computer device may be a server or a terminal, and its internal structure may be as shown in FIG. 8 .
  • the computer device includes a processor, memory, network interface and database connected by a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a readable storage medium and an internal memory.
  • the readable storage medium stores an operating system, computer readable instructions and a database.
  • the internal memory provides an environment for the execution of the operating system and computer readable instructions in the readable storage medium.
  • the database of the computer device is used to store the data used in the image classification preprocessing method or the image classification method in the above embodiments.
  • the network interface of the computer device is used to communicate with an external terminal via a network connection.
  • the readable storage medium includes a non-volatile readable storage medium and a volatile readable storage medium.
  • a computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, the processor executing the computer-readable The following steps are implemented during the instruction:
  • the image classification preprocessing instruction includes a target image resolution, a preset number of image sampling times, and an initial image with an initial image resolution;
  • Adjust the initial image from the initial image resolution to The target image resolution is used to obtain the image to be classified.
  • another computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and operable on the processor, the processor executing the computer-readable The following steps are implemented when reading instructions:
  • the image classification instruction includes specified image resolution, number of image processing times, and images to be processed with preset image resolution;
  • the above image classification preprocessing method determines the image to be classified corresponding to the image to be processed
  • the image to be classified is input into a preset image classification model to obtain an image classification result.
  • one or more readable storage media storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform follows the steps below:
  • the image classification preprocessing instruction includes a target image resolution, a preset number of image sampling times, and an initial image with an initial image resolution;
  • Adjust the initial image from the initial image resolution to The target image resolution is used to obtain the image to be classified.
  • another or more readable storage media storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to Perform the following steps:
  • the image classification instruction includes specified image resolution, number of image processing times, and images to be processed with preset image resolution;
  • the above image classification preprocessing method determines the image to be classified corresponding to the image to be processed
  • the image to be classified is input into a preset image classification model to obtain an image classification result.
  • Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM random access memory
  • RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Multimedia (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

本申请公开了一种图像分类预处理、图像分类方法、装置、设备及存储介质,该图像分类预处理方法通过根据目标图像分辨率、预设图像采样次数以及初始图像分辨率确定浮点变换步长;通过预设整数模拟方法对浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;根据向上整数变换步长及浮点变换步长确定第一步长损失权重;同时根据向下整数变换步长以及浮点变换步长确定第二步长损失权重;根据浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将初始图像自初始图像分辨率调整至目标图像分辨率得到待分类图像。本申请在进行图像预处理时保证了图像的特征完整性,提高了图像分类的准确性。

Description

图像分类预处理、图像分类方法、装置、设备及存储介质
本申请要求于2021年06月01日提交中国专利局、申请号为202110609434.1,发明名称为“图像分类预处理、图像分类方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理技术领域,尤其涉及一种图像分类预处理、图像分类方法、装置、设备及存储介质。
背景技术
随着科学技术的发展,计算机视觉技术是用机器来理解和分析图像的技术,并且计算机视觉技术应用在图像分类等领域中,取代了采用人工进行图像分类的方式,提高了图像分类的效率。
在对图像进行分类时,可能存在一部分仅包含不容易分别的细微特征的图像,发明人意识到,计算机视觉技术在进行图像分类处理时,需要对图像进行缩放、旋转、裁剪等图像预处理,通过上述图像预处理方法对图像进行处理之后,可能会将不同图像之间的细微特征消除,使得计算机视觉技术无法识别出不同图像之间的区别,从而可能会将两个不同类型的图像归为同类图像,进而导致图像分类的准确率较低。
申请内容
本申请实施例提供一种图像分类预处理、图像分类方法、装置、设备及存储介质,以解决图像分类的准确率较低的问题。
一种图像分类预处理方法,包括:
接收图像分类预处理指令;所述图像分类预处理指令中包括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像。
一种图像分类方法,包括:
接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过上述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
一种图像分类预处理装置,包括:
预处理指令接收模块,用于接收图像分类预处理指令;所述图像分类预处理指令中包 括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
浮点变换步长确定模块,用于根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
步长取整模块,用于通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
步长损失权重确定模块,用于根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
分辨率调整模块,用于根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像。
一种图像分类装置,包括:
图像分类指令接收模块,用于接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
图像预处理模块,用于将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过上述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
图像分类模块,用于将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
接收图像分类预处理指令;所述图像分类预处理指令中包括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过上述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
接收图像分类预处理指令;所述图像分类预处理指令中包括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像。
一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过上述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
上述图像分类预处理、图像分类方法、装置、设备及存储介质,该图像分类预处理方法通过对浮点变换步长进行取整处理,并且通过第一步长损失权重以及第二步长损失权重对前述取整处理进行损失补偿,使得对初始图像进行预处理时,可以不修改初始图像的像素信息,也即初始图像中的所有特征均不会在预处理过程中被消除,进而保证了初始图像的特征完整性,提高了对完成预处理的待分类图像进行图像分类时的准确率。
该图像分类方法通过借助上述图像分类预处理方法生成待分类图像,在通过预设图像分类模型进行图像分类时,可以识别到待分类图像中的细微特征,进而可以识别出两个不同,但仅存在细微特征差别的图像之间的区别点,提高了图像分类的准确性。
本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例中图像分类预处理方法或者图像分类方法的一应用环境示意图;
图2是本申请一实施例中图像分类预处理方法的一流程图;
图3是本申请一实施例中图像分类预处理方法中步骤S50的一流程图;
图4是本申请一实施例中图像分类方法的一流程图;
图5是本申请一实施例中图像分类预处理装置的一原理框图;
图6是本申请一实施例中图像分类预处理装置中分辨率调整模块50的一原理框图;
图7是本申请一实施例中图像分类装置的一原理框图;
图8是本申请一实施例中计算机设备的一示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地 描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请实施例提供的图像分类预处理方法,该图像分类预处理方法可应用如图1所示的应用环境中。具体地,该图像分类预处理方法应用在图像分类预处理系统中,该图像分类预处理系统包括如图1所示的客户端和服务器,客户端与服务器通过网络进行通信,用于解决图像分类的准确率较低的问题。其中,客户端又称为用户端,是指与服务器相对应,为客户提供本地服务的程序。客户端可安装在但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备上。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在一实施例中,如图2所示,提供一种图像分类预处理方法,以该方法应用在图1中的服务器为例进行说明,包括如下步骤:
S10:接收图像分类预处理指令;所述图像分类预处理指令中包括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
可以理解地,图像分类预处理指令可以由用户通过如移动终端,电脑等设备发送的,也可以在用户输入目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像之后自动生成的。其中,目标图像分辨率是指用户或者图像分类模型指定需要将各种不同分辨率的图像转换成相同分辨率图像的目标值;预设图像采样次数是指图像分类预处理过程中需要对初始图像进行尺度转换的次数(例如缩放次数);初始图像可以为不同应用场景下的图像,示例性地,初始图像可以为证件照、病理照等,初始图像分辨率即为初始图像的图像分辨率。示例性地,假设一应用场景下,需要将300*300的证件照通过五次尺度转换后,转换成4*4的证件照时,其中,300*300即为初始图像分辨率,预设图像采样次数即为五次,目标图像分辨率为4*4。
S20:根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
可以理解地,浮点变换步长指的是每经过一次尺度变换,目标图像分辨率需要缩小的比例,示例性地,假设浮点变换步长为2.37,初始图像分辨率为300*300,则经过一次尺度变换之后,初始图像分辨率变换为126.58*126.58。
具体地,在接收到图像分类预处理指令之后,根据所述目标图像分辨率以及所述初始图像分辨率,确定分辨率比值;根据所述分辨率比值以及所述预设图像采样次数,确定所述浮点变换步长。
进一步地,可以根据下述表达式确定浮点变换步长:
Figure PCTCN2022072287-appb-000001
其中,a为浮点变换步长;N为初始图像分辨率;m为目标图像分辨率;t为预设图像采样次数。
S30:通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
可以理解地,在根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长之后,由于在对初始图像进行缩放时,一些模型框架(例如机器学习框架中的torch框架,神经网络框架等)是不支持浮点变换步长,仅支持整数变换步长,因此需要通过预设整数模拟方法对浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长之后,即可对初始图像进行缩放。
在一具体实施例中,步骤S30中,包括:
通过所述向上取整方法对所述浮点变换步长进行向上取整处理,得到所述向上整数变换步长;可以理解地,向上取整处理也即针对于浮点整数步长,不考虑其小数位置上的数字,仅对整数部分加一处理的方法。
通过所述向下取整方法对所述浮点变换步长进行向下取整处理,得到所述向下整数变换步长。可以理解地,向上取整处理也即针对于浮点整数步长,不考虑其小数位置上的数字,仅对整数部分减一处理的方法。
具体地,在根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长之后,通过所述向上取整方法对所述浮点变换步长进行向上取整处理,得到所述向上整数变换步长;通过所述向下取整方法对所述浮点变换步长进行向下取整处理,得到所述向下整数变换步长。示例性地,假设浮点变换步长为2.37,则对该浮点变换步长进行向上取整处理之后,得到的向上整数变换步长即为3,对该浮点变换步长进行向下取整处理之后,得到的向下整数变换步长即为2。
S40:根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
具体地,在通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长之后,将所述向上整数变换步长与所述浮点变换步长之间的差值确定为所述第一步长损失权重;将所述浮点变换步长与所述向下整数变换步长之间的差值确定为所述第二步长损失权重。示例性地,假设浮点变换步长为2.37,经过步骤S30得到的向上整数变换步长为3,得到的向下整数变换步长为2,则对应的第一步长损失权重为0.63(即3‐2.37),第二步长损失权重为0.37(即为2.37‐2)。
S50:根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像。可以理解地,待分类图像即为通过步骤S20至S50的图像分类预处理之后等待进行图像分类的图像,也即得到待分类图像之后即表征初始图像的图像分类预处理已完成。
在一具体实施方式中,如图3所示,步骤S50中,包括:
S501:根据所述向上整数变换步长对所述初始图像进行图像变换得到第一向上特征图,并根据所述向下整数变换步长对所述初始图像进行图像变换得到第一向下特征图之后,将图像变换次数累加一;
可以理解地,本实施例中提出的图像变换为图像缩放、图像放大等均可以作为图像变换方法。得到第一向上特征图以及第一向下特征图之后记录为一次图像变换次数。
具体地,在根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重之后,根据向上整数变换步长对初始图像进行图像变换得到第一向上特征图,也即根据向上整数变换步长对初始图像的初始图像分辨率进行图像变换之后,第一向上特征图的图像分辨率可以根据初始图像分辨率与向上整数变换步长进行确定,示例性地,假设初始图像分辨率为300*300,目标图像分辨率为4*4,向上整数变换步长为3时,则此次的图像变换即为对初始图像进行缩放,进而第一向上特征图的图像分辨率即为100*100(300/3)。
进一步地,在根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重之后,根据向下整数变换步长对所述初始图像进行图像变换得到第一向下特征图,该第一向下特征图的图像分辨率可以根据初始图像分辨率与向下整数变换步长进行确定,示例性地,假设初始图像分辨率为300*300,目标图像分辨率为4*4,向上整数变换步长为2时,则此次的图像变换即为对初始图像进行缩放,进而第一向上特征图的图像分辨率即为150*150(300/2),并在得到第一向上特征图以及第一向下特征图之后,将图像变换次数累加一。
S502:根据所述第一步长损失权重、所述第二步长损失权重、第一向上特征图以及第一向下特征图进行特征图加权融合,得到具有第一变换分辨率的第一转换图像;所述第一变换分辨率根据所述初始图像分辨率以及所述浮点变换步长确定;
具体地,在根据所述向上整数变换步长对所述初始图像进行图像变换得到第一向上特征图,并根据所述向下整数变换步长对所述初始图像进行图像变换得到第一向下特征图之后,将图像变换次数累加一之后,将第一向上特征图的图像分辨率转换至第一变换分辨率,进而得到第一向上变换特征图;同时将第一向下特征图的图像分辨率转换至第一变换分辨率,进而得到第一向下变换特征图;根据第一向上变换特征图以及第二步长损失权重确定第一向上权重特征图,根据第一向下变换特征图以及第一步长损失权重确定第一向下权重特征图,进而对第一向上权重特征图以及第一向下权重特征图进行特征图加权融合,即可得到具有第一变换分辨率的第一转换图像。
其中,第一变换分辨率可以根据初始图像分辨率以及浮点变换步长确定;示例性地,假设初始图像分辨率为300*300,浮点变换步长为2.37,目标图像分辨率为4*4,则对应的第一变换分辨率即为初始图像分辨率与浮点变换步长之商,也即第一变换分辨率为126.58(300/2.37),如此既可以通过对浮点变换步长进行取整之后,使得一些模型框架(例如机器学习框架中的torch框架,神经网络框架等)可以对整数变换步长进行计算,并且通过第一步长损失权重以及第二步长损失权重,将第一向上特征图以及第一向下特征图的图像分辨率还原至第一变换分辨率(也即当模型框架可以对浮点变换步长进行计算时得到的分辨率),提高了图像分类预处理的便捷性,同时也可以保留初始图像原有所有特征不被破坏,为后续图像分类提供了准确的待分类图像。
S503:确定所述图像变换次数与所述预设图像采样次数是否相等;
S504:在所述图像变换次数与所述预设图像采样次数相等时,将所述第一变换分辨率记录为所述目标图像分辨率,将所述第一转换图像记录为所述待分类图像。
具体地,在根据所述第一步长损失权重、所述第二步长损失权重、第一向上特征图以及第一向下特征图进行特征图加权融合,得到具有第一变换分辨率的第一转换图像之后,确定图像变换次数与预设图像采样次数是否相等,在图像变换次数等于预设图像采样次数时,表征当前图像预处理已完成,进而直接将第一变换分辨率记录为目标图像分辨率(在进行步骤S501至步骤S502之后,若第一变换分辨率等于目标图像分辨率也可以判定图像变换次数等于预设图像采样次数),并将第一转换图像记录为待分类图像。
在一实施例中,步骤S503之后,也即所述确定所述图像变换次数与所述预设图像采样次数是否相等之后,还包括:
在所述图像变换次数与所述预设图像采样次数不相等时,根据所述向上整数变换步长对所述第一转换图像进行图像变换得到第二向上特征图,并根据所述向下整数变换步长对所述第一转换图像进行图像变换得到第二向下特征图之后,将所述图像变换次数累加一;
可以理解地,在确定所述图像变换次数与所述预设图像采样次数是否相等之后,若图像变换次数与预设图像采样次数不相等,表征此时图像预处理还没有结束,且由于初始图像已经转换成为第一转换图像,因此需要对第一转换图像继续进行图像变换,以使得图像分辨率可以达到目标图像分辨率,进而根据所述向上整数变换步长对所述第一转换图像进行图像变换得到第二向上特征图,并根据所述向下整数变换步长对所述第一转换图像进行图像变换得到第二向下特征图之后,将所述图像变换次数累加一。
根据所述第一步长损失权重、所述第二步长损失权重、第二向上特征图以及第二向下特征图进行特征图加权融合,得到具有第二变换分辨率的第二转换图像;所述第二变换分辨率根据所述第一变换分辨率以及所述浮点变换步长确定;
具体地,在根据所述向上整数变换步长对所述第一转换图像进行图像变换得到第二向上特征图,并根据所述向下整数变换步长对所述第一转换图像进行图像变换得到第二向下 特征图之后,将第二向上特征图的图像分辨率转换至第二变换分辨率,进而得到第二向上变换特征图;同时将第二向下特征图的图像分辨率转换至第二变换分辨率,进而得到第二向下变换特征图;根据第二向上变换特征图以及第二步长损失权重确定第二向上权重特征图,根据第二向下变换特征图以及第一步长损失权重确定第二向下权重特征图,进而对第二向上权重特征图以及第二向下权重特征图进行特征图加权融合,即可得到具有第二变换分辨率的第二转换图像。
确定所述图像变换次数与所述预设图像采样次数是否相等;
在所述图像变换次数与所述预设图像采样次数相等时,将所述第二变换分辨率记录为所述目标图像分辨率,将所述第二转换图像记录为所述待分类图像。
具体地,在根据所述第一步长损失权重、所述第二步长损失权重、第二向上特征图以及第二向下特征图进行特征图加权融合,得到具有第二变换分辨率的第二转换图像之后,确定图像变换次数与预设图像采样次数是否相等,在图像变换次数与预设图像采样次数相等时,表征当前图像预处理已完成,进而直接将第二变换分辨率记录为目标图像分辨率,将第二转换图像记录为待分类图像。
进一步地,若图像变换次数与预设图像采样次数不相等,则执行上述步骤后会得到第三变换分辨率的第三转换图像,甚至后续还会继续得到第四变换分辨率的第四转换图像,直至图像变换次数与预设图像采样次数相等时结束,具体地方法参照上述说明,在此不再赘述。
在本实施例中,通过对浮点变换步长进行取整处理,并且通过第一步长损失权重以及第二步长损失权重对前述取整处理进行损失补偿,使得对初始图像进行预处理时,可以不修改初始图像的像素信息,也即初始图像中的所有特征均不会在预处理过程中被消除,进而保证了初始图像的特征完整性,提高了对完成预处理的待分类图像进行图像分类时的准确率。
在一实施例中,如图4所示,提供一种图像分类方法,以该方法应用在图1中的服务器为例进行说明,包括如下步骤:
S60:接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
可以理解地,指定图像分辨率是指用户或者预设图像分类模型指定需要将各种不同分辨率的图像转换成相同分辨率图像的目标值。图像处理次数是指图像分类预处理过程中需要对待处理图像进行尺度转换的次数。待处理图像可以为不同应用场景下的图像,示例性地,初始图像可以为证件照、病理照等,预设图像分辨率即为待处理图像的图像分辨率。
S70:将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过上述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
具体地,在接收图像分类指令之后,将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过上述图像分类预处理方法确定与待处理图像对应的待分类图像。
S80:将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
具体地,在将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过上述图像分类预处理方法确定与所述待处理图像对应的待分类图像,此时待分类图像的图像分辨转换成了指定图像分辨率,进而可以将待分类图像输入至预设图像分类模型中,预设图像分类模型即可对待分类图像进行图像分类,得到图像分类结果。其中,预设图像分类模型可以为基于VGG(Visual Geometry Group Network,视觉几何组网络)网 络构建的分类模型,也可以为基于ResNets(Residual Network,残差网络)网络构建的分类模型,如此在通过预设图像分类模型进行图像分类时,可以识别到待分类图像中的细微特征,进而可以识别出两个不同,但仅存在细微特征差别的图像之间的区别点,提高了图像分类的准确性。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
在一实施例中,提供一种图像分类预处理装置,该图像分类预处理装置与上述实施例中图像分类预处理方法一一对应。如图5所示,该图像分类预处理装置包括预处理指令接收模块10、浮点变换步长确定模块20、步长取整模块30、步长损失权重确定模块40和分辨率调整模块50。各功能模块详细说明如下:
预处理指令接收模块10,用于接收图像分类预处理指令;所述图像分类预处理指令中包括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
浮点变换步长确定模块20,用于根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
步长取整模块30,用于通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
步长损失权重确定模块40,用于根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
分辨率调整模块50,用于根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像。
优选地,浮点变换步长确定模块20包括:
分辨率比值确定单元,用于根据所述目标图像分辨率以及所述初始图像分辨率,确定分辨率比值;
浮点变换步长确定单元,用于根据所述分辨率比值以及所述预设图像采样次数,确定所述浮点变换步长。
优选地,步长取整模块30包括:
向上确证处理单元,用于通过所述向上取整方法对所述浮点变换步长进行向上取整处理,得到所述向上整数变换步长;
向下确证处理单元,用于通过所述向下取整方法对所述浮点变换步长进行向下取整处理,得到所述向下整数变换步长。
优选地,步长损失权重确定模块40包括:
第一步长损失权重确定单元,用于将所述向上整数变换步长与所述浮点变换步长之间的差值确定为所述第一步长损失权重;
第二步长损失权重确定单元,用于将所述浮点变换步长与所述向下整数变换步长之间的差值确定为所述第二步长损失权重。
优选地,如图6所示,分辨率调整模块50包括:
第一图像缩放单元501,用于根据所述向上整数变换步长对所述初始图像进行图像变换得到第一向上特征图,并根据所述向下整数变换步长对所述初始图像进行图像变换得到第一向下特征图之后,将图像变换次数累加一;
第一特征图融合单元502,用于根据所述第一步长损失权重、所述第二步长损失权重、第一向上特征图以及第一向下特征图进行特征图加权融合,得到具有第一变换分辨率的第一转换图像;所述第一变换分辨率根据所述初始图像分辨率以及所述浮点变换步长确定;
第一缩放次数比较单元503,用于确定所述图像变换次数与所述预设图像采样次数是 否相等;
第一待分类图像确定单元504,用于在所述图像变换次数与所述预设图像采样次数相等时,将所述第一变换分辨率记录为所述目标图像分辨率,将所述第一转换图像记录为所述待分类图像。
优选地,分辨率调整模块50还包括:
第二图像缩放单元,用于在所述图像变换次数与所述预设图像采样次数不相等时,根据所述向上整数变换步长对所述第一转换图像进行图像变换得到第二向上特征图,并根据所述向下整数变换步长对所述第一转换图像进行图像变换得到第二向下特征图之后,将所述图像变换次数累加一;
第二特征图融合单元,用于根据所述第一步长损失权重、所述第二步长损失权重、第二向上特征图以及第二向下特征图进行特征图加权融合,得到具有第二变换分辨率的第二转换图像;所述第二变换分辨率根据所述第一变换分辨率以及所述浮点变换步长确定;
第二缩放次数比较单元,用于确定所述图像变换次数与所述预设图像采样次数是否相等;
第一待分类图像确定单元,用于在所述图像变换次数与所述预设图像采样次数相等时,将所述第二变换分辨率记录为所述目标图像分辨率,将所述第二转换图像记录为所述待分类图像。
关于图像分类预处理装置的具体限定可以参见上文中对于图像分类预处理方法的限定,在此不再赘述。上述图像分类预处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一实施例中,提供一种图像分类装置,该图像分类装置与上述实施例中图像分类方法一一对应。如图7所示,该图像分类预处理装置包括图像分类指令接收模块60、图像预处理模块70和图像分类模块80。各功能模块详细说明如下:
图像分类指令接收模块60,用于接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
图像预处理模块70,用于将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过上述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
图像分类模块80,用于将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
关于图像分类装置的具体限定可以参见上文中对于图像分类方法的限定,在此不再赘述。上述图像分类装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,也可以是终端,其内部结构图可以如图8所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括可读存储介质、内存储器。该可读存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为可读存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储上述实施例中图像分类预处理方法,或者图像分类方法所使用到的数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种图像分类预处理方法,或者该计算机可读指 令被处理器执行时以实现一种图像分类方法。本实施例所提供的可读存储介质包括非易失性可读存储介质和易失性可读存储介质。
在一个实施例中,提供了一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
接收图像分类预处理指令;所述图像分类预处理指令中包括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像。
在一个实施例中,提供了另一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过上述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
在一个实施例中,提供了一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
接收图像分类预处理指令;所述图像分类预处理指令中包括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像。
在一个实施例中,提供了另一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过上述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中或者易失性计算机可读取存储介质,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种图像分类预处理方法,其中,包括:
    接收图像分类预处理指令;所述图像分类预处理指令中包括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
    根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
    通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
    根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
    根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像。
  2. 如权利要求1所述的图像分类预处理方法,其中,所述根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长,包括:
    根据所述目标图像分辨率以及所述初始图像分辨率,确定分辨率比值;
    根据所述分辨率比值以及所述预设图像采样次数,确定所述浮点变换步长。
  3. 如权利要求1所述的图像分类预处理方法,其中,所述预设整数模拟方法包括向上取整方法以及向下取整方法;所述通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长,包括:
    通过所述向上取整方法对所述浮点变换步长进行向上取整处理,得到所述向上整数变换步长;
    通过所述向下取整方法对所述浮点变换步长进行向下取整处理,得到所述向下整数变换步长。
  4. 如权利要求1所述的图像分类预处理方法,其中,所述根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像,包括:
    根据所述向上整数变换步长对所述初始图像进行图像变换得到第一向上特征图,并根据所述向下整数变换步长对所述初始图像进行图像变换得到第一向下特征图之后,将图像变换次数累加一;
    根据所述第一步长损失权重、所述第二步长损失权重、第一向上特征图以及第一向下特征图进行特征图加权融合,得到具有第一变换分辨率的第一转换图像;所述第一变换分辨率根据所述初始图像分辨率以及所述浮点变换步长确定;
    确定所述图像变换次数与所述预设图像采样次数是否相等;
    在所述图像变换次数与所述预设图像采样次数相等时,将所述第一变换分辨率记录为所述目标图像分辨率,将所述第一转换图像记录为所述待分类图像。
  5. 如权利要求4所述的图像分类预处理方法,其中,所述确定所述图像缩放次数与所述预设图像采样次数是否相等之后,还包括:
    在所述图像变换次数与所述预设图像采样次数不相等时,根据所述向上整数变换步长对所述第一转换图像进行图像变换得到第二向上特征图,并根据所述向下整数变换步长对所述第一转换图像进行图像变换得到第二向下特征图之后,将所述图像变换次数累加一;
    根据所述第一步长损失权重、所述第二步长损失权重、第二向上特征图以及第二向下特征图进行特征图加权融合,得到具有第二变换分辨率的第二转换图像;所述第二变换分辨率根据所述第一变换分辨率以及所述浮点变换步长确定;
    确定所述图像变换次数与所述预设图像采样次数是否相等;
    在所述图像变换次数与所述预设图像采样次数相等时,将所述第二变换分辨率记录为所述目标图像分辨率,将所述第二转换图像记录为所述待分类图像。
  6. 一种图像分类方法,其中,包括:
    接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
    将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过如权利要求1至5任一项所述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
    将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
  7. 一种图像分类预处理装置,其中,包括:
    预处理指令接收模块,用于接收图像分类预处理指令;所述图像分类预处理指令中包括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
    浮点变换步长确定模块,用于根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
    步长取整模块,用于通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
    步长损失权重确定模块,用于根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
    分辨率调整模块,用于根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像。
  8. 一种图像分类装置,其中,包括:
    图像分类指令接收模块,用于接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
    图像预处理模块,用于将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过如权利要求1至5任一项所述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
    图像分类模块,用于将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
  9. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其中,所述处理器执行所述计算机可读指令时实现如下步骤:
    接收图像分类预处理指令;所述图像分类预处理指令中包括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
    根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
    通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
    根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
    根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨 率,得到待分类图像。
  10. 如权力要求9所述的计算机设备,其中,所述根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长,包括:
    根据所述目标图像分辨率以及所述初始图像分辨率,确定分辨率比值;
    根据所述分辨率比值以及所述预设图像采样次数,确定所述浮点变换步长。
  11. 如权力要求9所述的计算机设备,其中,所述预设整数模拟方法包括向上取整方法以及向下取整方法;所述通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长,包括:
    通过所述向上取整方法对所述浮点变换步长进行向上取整处理,得到所述向上整数变换步长;
    通过所述向下取整方法对所述浮点变换步长进行向下取整处理,得到所述向下整数变换步长。
  12. 如权力要求9所述的计算机设备,其中,所述根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像,包括:
    根据所述向上整数变换步长对所述初始图像进行图像变换得到第一向上特征图,并根据所述向下整数变换步长对所述初始图像进行图像变换得到第一向下特征图之后,将图像变换次数累加一;
    根据所述第一步长损失权重、所述第二步长损失权重、第一向上特征图以及第一向下特征图进行特征图加权融合,得到具有第一变换分辨率的第一转换图像;所述第一变换分辨率根据所述初始图像分辨率以及所述浮点变换步长确定;
    确定所述图像变换次数与所述预设图像采样次数是否相等;
    在所述图像变换次数与所述预设图像采样次数相等时,将所述第一变换分辨率记录为所述目标图像分辨率,将所述第一转换图像记录为所述待分类图像。
  13. 如权力要求12所述的计算机设备,其中,所述确定所述图像缩放次数与所述预设图像采样次数是否相等之后,还包括:
    在所述图像变换次数与所述预设图像采样次数不相等时,根据所述向上整数变换步长对所述第一转换图像进行图像变换得到第二向上特征图,并根据所述向下整数变换步长对所述第一转换图像进行图像变换得到第二向下特征图之后,将所述图像变换次数累加一;
    根据所述第一步长损失权重、所述第二步长损失权重、第二向上特征图以及第二向下特征图进行特征图加权融合,得到具有第二变换分辨率的第二转换图像;所述第二变换分辨率根据所述第一变换分辨率以及所述浮点变换步长确定;
    确定所述图像变换次数与所述预设图像采样次数是否相等;
    在所述图像变换次数与所述预设图像采样次数相等时,将所述第二变换分辨率记录为所述目标图像分辨率,将所述第二转换图像记录为所述待分类图像。
  14. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其中,所述处理器执行所述计算机可读指令时实现如下步骤:
    接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
    将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过如权利要求1至5任一项所述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
    将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
  15. 一个或多个存储有计算机可读指令的可读存储介质,其中,所述计算机可读指令被 一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
    接收图像分类预处理指令;所述图像分类预处理指令中包括目标图像分辨率、预设图像采样次数以及具有初始图像分辨率的初始图像;
    根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长;
    通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长;
    根据所述向上整数变换步长以及所述浮点变换步长确定第一步长损失权重;同时根据所述向下整数变换步长以及所述浮点变换步长确定第二步长损失权重;
    根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像。
  16. 如权力要求15所述的可读存储介质,其中,所述根据所述目标图像分辨率、预设图像采样次数以及所述初始图像分辨率,确定浮点变换步长,包括:
    根据所述目标图像分辨率以及所述初始图像分辨率,确定分辨率比值;
    根据所述分辨率比值以及所述预设图像采样次数,确定所述浮点变换步长。
  17. 如权力要求15所述的可读存储介质,其中,所述预设整数模拟方法包括向上取整方法以及向下取整方法;所述通过预设整数模拟方法对所述浮点变换步长进行取整处理,得到向上整数变换步长以及向下整数变换步长,包括:
    通过所述向上取整方法对所述浮点变换步长进行向上取整处理,得到所述向上整数变换步长;
    通过所述向下取整方法对所述浮点变换步长进行向下取整处理,得到所述向下整数变换步长。
  18. 如权力要求15所述的可读存储介质,其中,所述根据所述浮点变换步长、向上整数变换步长、向下整数变换步长、第一步长损失权重以及第二步长损失权重,将所述初始图像自所述初始图像分辨率调整至所述目标图像分辨率,得到待分类图像,包括:
    根据所述向上整数变换步长对所述初始图像进行图像变换得到第一向上特征图,并根据所述向下整数变换步长对所述初始图像进行图像变换得到第一向下特征图之后,将图像变换次数累加一;
    根据所述第一步长损失权重、所述第二步长损失权重、第一向上特征图以及第一向下特征图进行特征图加权融合,得到具有第一变换分辨率的第一转换图像;所述第一变换分辨率根据所述初始图像分辨率以及所述浮点变换步长确定;
    确定所述图像变换次数与所述预设图像采样次数是否相等;
    在所述图像变换次数与所述预设图像采样次数相等时,将所述第一变换分辨率记录为所述目标图像分辨率,将所述第一转换图像记录为所述待分类图像。
  19. 如权力要求18所述的可读存储介质,其中,所述确定所述图像缩放次数与所述预设图像采样次数是否相等之后,还包括:
    在所述图像变换次数与所述预设图像采样次数不相等时,根据所述向上整数变换步长对所述第一转换图像进行图像变换得到第二向上特征图,并根据所述向下整数变换步长对所述第一转换图像进行图像变换得到第二向下特征图之后,将所述图像变换次数累加一;
    根据所述第一步长损失权重、所述第二步长损失权重、第二向上特征图以及第二向下特征图进行特征图加权融合,得到具有第二变换分辨率的第二转换图像;所述第二变换分辨率根据所述第一变换分辨率以及所述浮点变换步长确定;
    确定所述图像变换次数与所述预设图像采样次数是否相等;
    在所述图像变换次数与所述预设图像采样次数相等时,将所述第二变换分辨率记录为 所述目标图像分辨率,将所述第二转换图像记录为所述待分类图像。
  20. 一个或多个存储有计算机可读指令的可读存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
    接收图像分类指令;所述图像分类指令中包括指定图像分辨率,图像处理次数以及具有预设图像分辨率的待处理图像;
    将所述指定图像分辨率记录为目标图像分辨率,将图像处理次数记录为预设图像采样次数,将待处理图像记录为初始图像,将预设图像分辨率记录为预设图像采样次数,通过如权利要求1至5任一项所述图像分类预处理方法确定与所述待处理图像对应的待分类图像;
    将所述待分类图像输入至预设图像分类模型中,得到图像分类结果。
PCT/CN2022/072287 2021-06-01 2022-01-17 图像分类预处理、图像分类方法、装置、设备及存储介质 WO2022252640A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110609434.1A CN113240042B (zh) 2021-06-01 2021-06-01 图像分类预处理、图像分类方法、装置、设备及存储介质
CN202110609434.1 2021-06-01

Publications (1)

Publication Number Publication Date
WO2022252640A1 true WO2022252640A1 (zh) 2022-12-08

Family

ID=77136274

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/072287 WO2022252640A1 (zh) 2021-06-01 2022-01-17 图像分类预处理、图像分类方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN113240042B (zh)
WO (1) WO2022252640A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113240042B (zh) * 2021-06-01 2023-08-29 平安科技(深圳)有限公司 图像分类预处理、图像分类方法、装置、设备及存储介质
CN113470030B (zh) * 2021-09-03 2021-11-23 北京字节跳动网络技术有限公司 组织腔清洁度的确定方法、装置、可读介质和电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020039456A1 (en) * 1996-10-30 2002-04-04 Oki Data Corporation Image data adjusting device and method
CN111402139A (zh) * 2020-03-25 2020-07-10 Oppo广东移动通信有限公司 图像处理方法、装置、电子设备和计算机可读存储介质
CN112614143A (zh) * 2020-12-30 2021-04-06 深圳市联影高端医疗装备创新研究院 一种图像分割方法、装置、电子设备及存储介质
CN113240042A (zh) * 2021-06-01 2021-08-10 平安科技(深圳)有限公司 图像分类预处理、图像分类方法、装置、设备及存储介质
CN113361471A (zh) * 2021-06-30 2021-09-07 平安普惠企业管理有限公司 图像数据处理方法、装置、计算机设备及存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10373050B2 (en) * 2015-05-08 2019-08-06 Qualcomm Incorporated Fixed point neural network based on floating point neural network quantization
CN110298413B (zh) * 2019-07-08 2021-07-16 北京字节跳动网络技术有限公司 图像特征提取方法、装置、存储介质及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020039456A1 (en) * 1996-10-30 2002-04-04 Oki Data Corporation Image data adjusting device and method
CN111402139A (zh) * 2020-03-25 2020-07-10 Oppo广东移动通信有限公司 图像处理方法、装置、电子设备和计算机可读存储介质
CN112614143A (zh) * 2020-12-30 2021-04-06 深圳市联影高端医疗装备创新研究院 一种图像分割方法、装置、电子设备及存储介质
CN113240042A (zh) * 2021-06-01 2021-08-10 平安科技(深圳)有限公司 图像分类预处理、图像分类方法、装置、设备及存储介质
CN113361471A (zh) * 2021-06-30 2021-09-07 平安普惠企业管理有限公司 图像数据处理方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN113240042A (zh) 2021-08-10
CN113240042B (zh) 2023-08-29

Similar Documents

Publication Publication Date Title
CN108154526B (zh) 突发模式图像的图像对准
WO2019201035A1 (zh) 对图像中的对象节点的识别方法、装置、终端及计算机可读存储介质
WO2022252640A1 (zh) 图像分类预处理、图像分类方法、装置、设备及存储介质
WO2021017261A1 (zh) 识别模型训练方法、图像识别方法、装置、设备及介质
WO2021179587A1 (zh) 神经网络模型量化方法、装置、电子设备及计算机可读存储介质
US11830170B2 (en) Systems and methods for image data processing to correct document deformations using machine learning system
WO2019144855A1 (zh) 图像处理方法、存储介质和计算机设备
CN112200722A (zh) 图像超分辨重构模型的生成方法、重构方法及电子设备
WO2021012382A1 (zh) 配置聊天机器人的方法、装置、计算机设备和存储介质
US11810326B2 (en) Determining camera parameters from a single digital image
CN111507333B (zh) 一种图像矫正方法、装置、电子设备和存储介质
CN113807353B (zh) 图像转换模型训练方法、装置、设备及存储介质
CN112990219B (zh) 用于图像语义分割的方法和装置
WO2020062191A1 (zh) 图像处理方法、装置及设备
US11481683B1 (en) Machine learning models for direct homography regression for image rectification
WO2024045442A1 (zh) 图像矫正模型的训练方法、图像矫正方法、设备及存储介质
WO2022134354A1 (zh) 车损检测模型训练、车损检测方法、装置、设备及介质
CN116843901A (zh) 医学图像分割模型训练方法和医学图像分割方法
JP2017182480A (ja) 画像処理装置および画像処理方法
WO2024021504A1 (zh) 人脸识别模型训练方法、识别方法、装置、设备及介质
CN113012075A (zh) 一种图像矫正方法、装置、计算机设备及存储介质
CN116957024A (zh) 利用神经网络模型进行推理的方法和装置
WO2023159945A1 (zh) 多模态模型训练以及图像识别方法、装置、电子设备
US20220270353A1 (en) Data augmentation based on attention
CN111881778B (zh) 文本检测的方法、装置、设备和计算机可读介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22814693

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22814693

Country of ref document: EP

Kind code of ref document: A1