WO2019127075A1 - Method for identifying coin year, terminal device, and computer readable storage medium - Google Patents

Method for identifying coin year, terminal device, and computer readable storage medium Download PDF

Info

Publication number
WO2019127075A1
WO2019127075A1 PCT/CN2017/118891 CN2017118891W WO2019127075A1 WO 2019127075 A1 WO2019127075 A1 WO 2019127075A1 CN 2017118891 W CN2017118891 W CN 2017118891W WO 2019127075 A1 WO2019127075 A1 WO 2019127075A1
Authority
WO
WIPO (PCT)
Prior art keywords
coin
year
image
target
coordinates
Prior art date
Application number
PCT/CN2017/118891
Other languages
French (fr)
Chinese (zh)
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 中国科学院深圳先进技术研究院
Priority to PCT/CN2017/118891 priority Critical patent/WO2019127075A1/en
Publication of WO2019127075A1 publication Critical patent/WO2019127075A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image

Definitions

  • the present invention belongs to the field of image recognition technologies, and in particular, to a method for identifying a coin year, a terminal device, and a computer readable storage medium.
  • the present invention provides a method for identifying a coin year, a terminal device, and a computer readable storage medium, to solve the existing method for manually recycling coins, which has a large workload, low efficiency, and high labor cost. problem.
  • a first aspect of the invention provides a method of identifying a year of a coin, comprising:
  • a second aspect of the invention provides a terminal device comprising means for performing the method as described in the first aspect above.
  • a third aspect of the present invention provides a terminal device including a memory, a processor, and the ⁇ 0 2019/127075 ⁇ (: 17 ⁇ 2017/118891 a computer program in a memory and operable on the processor, wherein the processor executes the computer program to implement the method as described in the first aspect above A step of.
  • a fourth aspect of the invention provides a computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the first aspect as described above The steps of the method.
  • the present invention obtains a target coin image to be identified; inputs the target coin image to a trained coin year recognition model; and determines, in the target coin image, based on year digital information output by the coin year recognition model The year of the coin. Since the year of the coin to be recognized is recognized by the pre-trained coin year recognition model, it is not necessary to manually classify the coin according to the year of the coin, which not only improves the efficiency of coin recovery but also saves labor costs.
  • FIG. 1 is a flowchart of an implementation of a method for recognizing a coin year according to an embodiment of the present invention
  • FIG. is a schematic diagram of a coin image provided by an embodiment of the present invention.
  • FIG. 215 is a schematic diagram of a lower half of a circular display area in which a coin image is located in a coin image according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram showing the upper half of the circular display area where the coin is located in the coin image provided by the embodiment of the present invention
  • FIG. 2 is a schematic diagram of a coin image in an embodiment of the present invention in which the year number is located in the right half of the circular display area where the coin is located;
  • FIG. is a schematic diagram of a coin image in which the year number is located in the left half of the circular display area where the coin is located;
  • FIG. 3 is a flowchart of an implementation of a method for recognizing a coin year according to another embodiment of the present invention.
  • FIG. 4 is a flowchart of an implementation of 301 in a method for recognizing a coin year according to an embodiment of the present invention
  • FIG. 6 is a flowchart of an implementation of a method for identifying a coin year according to an embodiment of the present invention. ⁇ 0 2019/127075 ⁇ (:17 ⁇ 2017/118891
  • FIG. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a terminal device according to another embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a terminal device according to still another embodiment of the present invention.
  • FIG. 1 is a flowchart of an implementation of a method for recognizing a coin year according to an embodiment of the present invention.
  • the execution subject of the method for recognizing the coin year in this embodiment is a terminal device.
  • the terminal device may be a mobile terminal device such as a smart phone or a tablet computer, or may be another terminal device, and is not limited herein.
  • the method of identifying the year of the coin as shown in FIG. 1 may include the following steps:
  • the image of the coin to be recognized by the camera device may be image-collected to obtain a coin image, and the collected coin image is input to the terminal device.
  • the terminal device receives the coin image input by the user if an instruction for identifying the year of the coin is detected, and determines the coin image input by the user as the target coin image to be recognized. ⁇ 0 2019/127075 ⁇ (:17 ⁇ 2017/118891
  • the target coin image may be one sheet or at least two, and is not limited herein.
  • the coin to be identified may be a renminbi coin, a euro coin, or other types of hard coins, and is not limited herein.
  • the pre-trained coin year model is invoked to process the target coin image.
  • the input amount of the coin year identification unit is a coin image
  • the output amount is the year digital information of the coin in the coin image.
  • the year number information includes the name and coordinates of the four-digit year number used to form the coin year on the coin. For example, if the release date of the coin is 1987, the names of the four digits on the coin are "1", "9", "8", "7".
  • the coordinates of the four-digit year number can be represented by the coordinates of a rectangular area occupied by the four-digit year number in the coin image.
  • the coordinates of the rectangular area can be represented by the coordinates of the two end points of the preset diagonal of the rectangular area.
  • FIG. 2 & FIG. 2 for a schematic diagram of a coin image provided by an embodiment of the present invention.
  • the rectangular area occupied by the four digits "1", “9", “8", and “7" on the coin in the coin image is Can pass through the rectangular area
  • the coordinates of each rectangular region may be represented by the coordinates of the end points of the lower left corner of each rectangular region and the coordinates of the endpoints of the upper right corner. For example, if the coordinates of the rectangular area & the lower left end point are (X)
  • the coordinates of the rectangular area & the upper right corner are (X , 2 ), the shell wrist area &
  • the terminal device invoking the pre-trained coin year model to process the target coin image may be: the terminal device inputs the target coin image to be identified into the coin year recognition model, and acquires the coin year recognition model. The year digital information of the coin in the output target coin image.
  • [0039] 813 Determine a year of the coin in the target coin image according to the year digital information output by the coin year identification model.
  • the terminal device After acquiring the year number information of the coin in the target coin image output by the coin year identification model, the terminal device determines the year of the coin in the target coin image according to the year number information of the coin in the target coin image. ⁇ 0 2019/127075 ⁇ (:17 ⁇ 2017/118891
  • 313 may include the following steps:
  • the terminal device may sort the four-digit year number according to the coordinates of the four-digit year number on the coin in the target coin image and the preset sorting strategy, thereby obtaining the year of the coin.
  • the four-digit year number on the coin is presented along the edge of the coin.
  • the arc shape is sequentially arranged as an example, and the specific process of sorting the four-digit year numbers according to the preset sorting strategy by the terminal device is described in detail.
  • the four-digit year number is sorted according to the coordinates of the four-digit year number on the coin in the target coin image and the preset sorting strategy, to obtain the year of the coin, specifically Includes the following steps:
  • the four digits are located in the lower half of the circular display area, the four digits are sorted according to a first preset order to obtain a year of the coin;
  • the four digits are located in the upper half of the circular display area, the four digits are sorted according to a second preset order to obtain the year of the coin;
  • the four digits are located in the right half of the circular display area, the four digits are sorted according to a third preset order to obtain the year of the coin;
  • the four digits are located in the left half of the circular display area, the four digits are sorted according to a fourth preset order to obtain the year of the coin.
  • the terminal device processes the target coin image by the background difference method to extract the coin from the target coin image. Round display area.
  • the terminal device determines based on the original coordinate system corresponding to the target coin image ⁇ 0 2019/127075 ⁇ (:17 ⁇ 2017/118891 The coordinates of the center point of the circular display area.
  • the terminal device can call The ⁇ ⁇ 1 ⁇ 1 ]'(3 ⁇ 4)8 function in the application is used to find the coordinates of the center point of the circular display area.
  • the terminal device Since the coordinates of the four-digit year number output by the coin year recognition model are represented by the coordinates of the two end points of the preset diagonal of the rectangular area occupied by the four-digit year number, the terminal device identifies the coin year The coordinates of the four-digit year number output by the model are converted, and the coordinates of the center point of the rectangular area occupied by the four-digit year number are obtained, and the coordinates of the center point of the rectangular area occupied by the four-digit year number and the circular display area are The center point coordinates are compared to determine the position of the four-digit year number in the circular display area.
  • the first preset order, the second preset order, the third preset order, and the fourth preset order need to be referred to according to the coin year identification model when determining the coordinates of the digital year on the coin.
  • the coordinate system is determined. Assume that the coordinates of the year number output by the coin year recognition model are based on the origin of the upper left corner of the coin image, the vertical side where the coordinate origin is located as the positive direction of the X axis, and the horizontal side where the coordinate origin is located as the positive direction of the X axis. Coordinate system, Bay 1
  • the terminal device detects that the X-axis coordinates corresponding to the center points of the four rectangular regions occupied by the four-digit year numbers are greater than the ⁇ -axis coordinates corresponding to the center point of the circular display region, the terminal device recognizes The four-digit year numbers are located in the lower half of the circular display area. At this time, the terminal device sorts the four-digit year numbers in the order of the ⁇ -axis coordinates corresponding to the center point of the rectangular area from the smallest to the largest, and obtains the year of the coin. In Fig. 215, the year of the coin obtained after sorting is "1987".
  • the terminal device detects that the X-axis coordinates corresponding to the center points of the four rectangular regions occupied by the four-digit year number are smaller than the ⁇ -axis coordinates corresponding to the center point of the circular display region, the terminal device recognizes that The four-digit year numbers are located in the upper half of the circular display area. At this time, the terminal device sorts the four-digit year numbers in descending order of the ⁇ -axis coordinates corresponding to the center point of the rectangular area to obtain the year of the coin. The year of the coin obtained after sorting the figure is "1987".
  • the terminal device detects that the X-axis coordinate corresponding to the center point of the four rectangular regions occupied by the four-digit year number is greater than the ⁇ -axis coordinate corresponding to the center point of the circular display region, Then, the four-digit year numbers are located in the right half of the circular display area, and the terminal device sorts the four-digit year numbers in descending order of the ⁇ -axis coordinates corresponding to the center point of the rectangular area to obtain the coin.
  • Year, in Figure 2 (1, the year of the coin obtained after sorting is "1987". ⁇ 0 2019/127075 ⁇ (:17 ⁇ 2017/118891
  • the terminal device detects that the X-axis coordinate corresponding to the center point of the four rectangular regions occupied by the four-digit year number is smaller than the ⁇ -axis coordinate corresponding to the center point of the circular display region, the terminal device recognizes that The four-digit year numbers are located in the left half of the circular display area. At this time, the terminal device sorts the four-digit year numbers according to the ⁇ axis coordinate corresponding to the center point of the rectangular area from small to large, and obtains the year of the coin. The year of the coin obtained after sorting is "1987".
  • the method for identifying the coin year obtained by the embodiment obtains the target coin image to be identified; the target coin image is input to the trained coin year recognition model; The year number information of the recognition model output determines the year of the coin in the target coin image. Since the year of the coin to be recognized is recognized by the pre-trained coin year recognition model, it is not necessary to manually classify the coin according to the year of the coin, which not only improves the efficiency of coin recovery but also saves labor costs.
  • FIG. 3 is a flow chart of an implementation of a method for recognizing a coin year according to another embodiment of the present invention.
  • the execution subject of the method for recognizing the coin year in this embodiment is a terminal device.
  • the terminal device may be a mobile terminal device such as a mobile phone or a tablet computer, or may be another terminal device, and is not limited herein.
  • the embodiment may further include 0 before 311.
  • the coin year recognition model needs to be trained before the pre-trained coin year recognition model is called to identify the year of the coin.
  • the training sample set includes a plurality of sets of sample data, and each set of sample data is composed of a coin image and year digital information of coins in the coin image.
  • the year number information for the coin includes the name and seat of the four digits on the coin.
  • 301 can be implemented by using 3011 ⁇ 3015 as shown in FIG. 4, as follows:
  • a large number of coin images for training the model may be collected by the camera device, and the collected coin images for training the model are uniformly stored in the terminal device. ⁇ 0 2019/127075 ⁇ (:17 ⁇ 2017/118891 First image folder.
  • the terminal device receives the model training instruction, it acquires the coin image for training the model from the first image folder.
  • all the coin images collected by the imaging device are the same size.
  • all coin images acquired by the camera are of MxN pixels.
  • M and N respectively represent the number of pixels included in each row and column of the image, and M and N are positive integers, and M and N can be set according to actual needs, and are not limited herein.
  • all the coin images in the first image folder may be renamed.
  • the terminal device can be preset The algorithm renames all the coin images in the first image folder, and sets the name of the coin image uniformly. Where X is any number from 0 to 9, for example, the name of the renamed coin image may be 000001.jpg, 000002.jpg, 000003.jpg, and the like.
  • the terminal device can store all the coin images after the rename in the second image folder.
  • the rectangular area is used to represent a display area occupied by a year number on the coin.
  • the terminal device After the terminal device renames all the coin images for training the model, the name and coordinates of the four-digit year number on the coin in each coin image are determined.
  • the user in determining the coordinates of the four digits of the number on the coin in each coin image, the user is required to assist in marking the four digits of the number on the coin in each coin image.
  • the user can frame the four-digit year number on the coin in each coin image through a rectangular frame, and then select four rectangular regions.
  • the four rectangular areas selected by the user in the coin image are used to respectively represent the display area occupied by the four-digit year number on the coin in the coin image.
  • 3012 may specifically include the following steps:
  • the terminal device acquires four rectangular areas selected by the user on the coins in each coin image, and Determining the coordinates of the two end points of the preset diagonal of each rectangular area according to the preset coordinate calibration strategy, and determining the coordinates of the two end points of the preset diagonal of each rectangular area as the coordinates of the rectangular area .
  • the preset coordinate calibration strategy is used to represent coordinate calibration based on a preset coordinate system.
  • the preset coordinate system can be determined according to actual needs, and there is no restriction here.
  • the preset coordinate system may be the coordinate origin of the upper left corner of the coin image, the vertical direction where the coordinate origin is located as the positive direction of the X axis, and the horizontal edge where the coordinate origin is located as the coordinate system established by the positive direction of the axis.
  • the terminal device determines coordinates of two end points of a preset diagonal of each rectangular area in each coin image based on a preset coordinate system.
  • the preset diagonal line can be set according to actual requirements, and is not limited herein.
  • the preset diagonal line may be a diagonal line connecting the lower left corner end point and the upper right corner end point of the rectangular area, and the preset is The two endpoints of the diagonal are the lower left endpoint and the upper right endpoint, respectively.
  • the terminal device after determining the coordinates of the consecutive endpoints of the preset diagonal of each rectangular area in each coin image, the terminal device recognizes the coordinates of the consecutive endpoints of each rectangular area as The coordinates of the corresponding rectangular area.
  • [0081] 8013 Determine coordinates of four rectangular regions in the coin image as coordinates of four-digit year numbers on coins in the coin image, respectively.
  • the coordinates of the four rectangular regions are respectively determined as the four-digit year numbers on the coins in the coin image.
  • coordinate of That is, the coordinates of the year number in the rectangular area are expressed by the coordinates of the rectangular area.
  • the terminal device while determining the coordinates of the four-digit year number on the coin in each coin image, the terminal device also determines the name of the four-digit year number on the coin in each coin image.
  • the name of the four-digit year number on the coin in each coin image may be input by the user. For example, the user inputs the name of the number while selecting each year number through the rectangular frame. The terminal device obtains the name of each year number entered by the user.
  • each coin image and the four-digit year on the coin in each coin image After the terminal device acquires the name and coordinates of the four-digit year number on the coin in each coin image, each coin image and the four-digit year on the coin in each coin image The names and coordinates of the numbers are stored in association.
  • the terminal device may first name the name of each coin image and four digits on the coin in each coin image.
  • the name and coordinates of the year number are stored in a table form in the first text file.
  • Table 1 shows part of the first text file, the part is named 001352.
  • the terminal device associates the name of each coin image, the name and coordinates of the four digits on the coin in each coin image in a table form in the first text file
  • the text information with the same name of the coin image in the first text file is further stored in the same Extensible Markup Language (XML) file, and the names of the coin images in the first text file are different.
  • Text information is stored in different XML files. in this way , you can get multiple XML files.
  • Each XML file stores the name and coordinates of a four-digit year number on a coin in a coin image.
  • the resulting multiple XML files can be: 000001. xml 000002.xml s 000003 Pass.
  • the terminal device After obtaining the XML file corresponding to each coin image, the terminal device associates the coin image with its corresponding XM L file to obtain a plurality of sets of sample data, and the plurality of sets of sample data constitute a sample set for training the model. .
  • the terminal device can randomly extract 50% of the sample data from the sample set as the training sample data, and the training sample data constitutes the training sample set.
  • the RCNN model is trained to determine the trained Faster RCNN model as a coin year identification model.
  • the terminal device uses the training sample set to train the pre-built region-based convolutional neural network (Faster RCNN) model.
  • Faster RCNN pre-built region-based convolutional neural network
  • the terminal device uses each coin image as an input of a Faster RCNN model, and the name and coordinates of the four digits on the coin in each coin image are output of the Faster RCNN model to the pre-built Faster RCNN model. Train. After training the Faster RCNN model, the terminal device determines the trained Faster RCNN model as the coin year recognition model.
  • coin year identification model is used to identify the year of the coin.
  • FIG. 5 is a schematic structural diagram of a Faster RCNN model according to an embodiment of the present invention.
  • the Faster RCNN model specifically includes a feature extraction network and a region extraction network (Region proposal).
  • RPN Random Network Network
  • target identification network The input end of the RPN and the input end of the target identification network are both connected to the output of the feature extraction network, and the input end of the target identification network is also connected to the output of the PRN.
  • the feature extraction network is configured to perform a convolution operation on the pixel values of all the pixel points in the input coin image by the convolution kernel to obtain a feature map, and output the feature map to the RPN and the target recognition network.
  • the dimensions of the feature map are much smaller than the dimensions of the coin image.
  • the RPN is configured to determine, according to the feature map, a display area in the coin image that may be a year number, and The display area where the year number is located is output as a candidate area to the target recognition network.
  • the target recognition network is configured to select a target region corresponding to the four-digit year number on the coin in the coin image from the candidate region according to the feature map output by the feature extraction network, and identify the year number in the region where the year number is located. And output the name of the four-digit year number and the coordinates of the corresponding target area.
  • the feature extraction network may adopt a VGG16 network.
  • the target recognition network may specifically be a Fast Region-based Convolutional Neural Network (Fast RCNN).
  • the target area is a rectangular area
  • the coordinates of the target area may be represented by the coordinates of the two end points of the preset diagonal of the target area, for example, the coordinates of the end point of the lower left corner of the target area may be The coordinate representation of the endpoint in the upper right corner.
  • the RPN is used to gradually slide on the feature map by using a preset sliding window.
  • the sliding step size can be set according to actual needs, and there is no limit here.
  • Each position where the preset sliding window slides on the feature map maps k original image areas of different sizes or areas. For example, assuming that the preset sliding window corresponds to 300 sliding positions on the feature map, the entire feature map corresponds to 300k original image regions.
  • the coordinates corresponding to each of the original image regions are known. Since the original image region is a rectangular region, the coordinates of the original image region can be represented by the coordinates of the endpoint positions at which the four corners are located.
  • the RPN calculates the probability value that the original image area is an unrelated area or the area where the year number is located, that is, each original image area corresponds to two probability values. Based on the two probability values corresponding to each original image region, the RPN selects n original image regions with a high probability of the region where the year number is located as the candidate region from all the original image regions, and outputs the coordinates of the candidate region to the target recognition.
  • the internet The internet.
  • the target recognition network is configured to calculate a probability value of each of the numbers 0 to 9 for each candidate region, that is, each candidate region corresponds to 10 probability values, which are any numbers of numbers 0-9. Probability value. That is to say, if the number of candidate regions is n, then 10n probability values are finally obtained, and each of the numbers 0-9 corresponds to n probability values. Considering that the year number on the coin is four digits, the target recognition network selects four probability values with higher probability values from the n probability values corresponding to each number, that is, each number in 0 ⁇ 9 is separately screened out. Four candidate regions, and finally 40 candidate regions were selected.
  • the target recognition network further determines four candidate regions with the highest probability value from the selected 40 candidate regions, and identifies the four candidate regions with the highest probability value as The four-digit year number on the coin corresponds to the target area. Finally, the target recognition network outputs the coordinates of the four target areas and the names of the corresponding year numbers.
  • S02 can be implemented by S021 ⁇ S025 as shown in FIG. 6, which is as follows:
  • S021 Initialize parameter values of the feature extraction network according to parameter values of the feature extraction model obtained by pre-training, randomly initialize parameter values of the region extraction network, and adopt the feature extraction after initialization a network and the region extraction network extract candidate regions from each of the coin images
  • the terminal acquires the feature extraction model obtained by the pre-training, and initializes the parameters of the feature extraction network according to the parameter values of the feature extraction model obtained by the pre-training.
  • the feature extraction model is a feature extraction model based on ImageNet training.
  • ImageNet is the largest image database used for image recognition in the world.
  • the feature extraction network may adopt a VGG16 network. Please refer to Table 2 together. Table 2 shows the parameters of a VGG16 network provided by this embodiment.
  • the VGG16 network includes 13 convolution layers and 4 pooling layers. The size and number of convolution kernels in each layer are shown in Table 2.
  • the terminal device may obtain the parameter value of the pre-trained 0016 model from the network, and initialize the parameter value of 0016 by using the parameter value of the pre-trained 0016 model.
  • the parameter values of 0016 include, but are not limited to, the number of convolution kernels, the size of the convolution kernel, and the values corresponding to the respective elements in the convolution kernel.
  • the terminal device randomly initializes the parameter values of the RPN.
  • Initializing the parameter value of the RPN means initializing the value of each element in each convolution kernel included in the RPN.
  • the terminal device may extract the candidate area from each coin image by using the initialized feature extraction network and the RPN, and The coordinates of the extracted candidate regions are output to the target recognition network.
  • S022 Perform the first training on the target recognition network according to the candidate region extracted from each of the coin images and the year digital information of the coins in each of the coin images.
  • the terminal device performs the first training on the target recognition network based on the candidate region extracted from each coin image and the year digital information on the coin in each coin image.
  • the terminal device uses the coordinates of the candidate region extracted from each coin image as the input of the target recognition network, and uses the year digital information on the coin in each coin image as the output of the target recognition network, The first training is performed on the target recognition network.
  • an initial parameter value of the target recognition network is obtained.
  • the initial parameter value of the target recognition network refers to the initial parameter value of each element in the convolution kernel in the target recognition network.
  • S023 Update parameter values of the area extraction network according to initial parameter values of the target identification network after the first training, and adopt the initialized feature extraction network and the updated area.
  • the extraction network again extracts candidate regions from each of the coin images.
  • the terminal device updates the parameter value of the RPN according to the initial parameter value of the target network after the first training, and extracts the candidate region from each coin image again by using the updated region extraction network, and extracts the candidate region again.
  • the coordinates of the candidate regions are output to the target recognition network.
  • S024 Perform a second training on the target recognition network according to the candidate region extracted from each of the coin images and the year digital information of the coins in each of the coin images.
  • the terminal device performs the second training on the target recognition network after the first training based on the candidate region extracted from each coin image and the year digital information on the coin in each coin image. Specifically, the terminal device will again use the coordinates of the candidate region extracted from each coin image as the input of the target recognition network, and use the year digital information on the coin in each coin image as the output of the target recognition network to target the target. Identify the network for a second training session.
  • the final parameter value of the target recognition network refers to the final parameter of each element in the convolution kernel in the target recognition network. ⁇ 0 2019/127075 ⁇ (:17 ⁇ 2017/118891 value.
  • the 8 ⁇ 3 ⁇ RCNN model composed of the updated area extraction network of the terminal device and the target recognition network after the second training is determined as a coin year recognition model, and the coin year identification model is stored.
  • the terminal calls the coin year identification model.
  • the Fa S t er RCNN model detects and locates the target faster and has higher accuracy
  • the coin year model obtained by training the Fa S er RCNN model is used to identify the year of the coin, which not only improves the coin.
  • the efficiency of the year identification, and the accuracy of the coin year identification since the positions and postures of the coins in the plurality of coin images included in the training sample set are random, the coin year recognition model trained based on the training sample set can be effective for the years of the coins in the coin images of different specifications. Identification.
  • FIG. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
  • the terminal device 700 can be a mobile terminal device such as a smart phone or a tablet computer, and can also be other terminal devices, and is not limited herein.
  • Each unit included in the terminal device 700 of this embodiment is used to perform the steps in the embodiment corresponding to FIG. 1.
  • the terminal device 700 of this embodiment includes a first obtaining unit 71, a model calling unit 72, and a year determining unit 73.
  • the first acquisition unit 71 is configured to acquire a target coin image to be identified.
  • the model invoking unit 72 is configured to input the target coin image to the trained coin year recognition model.
  • the year determining unit 73 is configured to determine a year of the coin in the target coin image according to the year number information output by the coin year identification model; wherein the year number information is used to represent the year of the coin ⁇ 0 2019/127075 ⁇ (:17 ⁇ 2017/118891
  • the year digital information includes a name and a coordinate of a four-digit year number on the coin in the target coin image; the year determining unit 73 is specifically configured to: The coordinates of the four-digit year number on the coin in the target coin image and the preset sorting strategy sort the four-digit year number to obtain the year of the coin.
  • the year determining unit 73 is specifically configured to:
  • the four digits are located in the lower half of the circular display area, the four digits are sorted according to the first preset order to obtain the year of the coin;
  • the four digits are located in the upper half of the circular display area, the four digits are sorted according to a second preset order to obtain a year of the coin;
  • the four digits are located in the right half of the circular display area, the four digits are sorted according to a third preset order to obtain the year of the coin;
  • the four digits are located in the left half of the circular display area, the four digits are sorted according to a fourth preset order to obtain the year of the coin.
  • the terminal device obtained by the embodiment obtains the target coin image to be identified; the target coin image is input to the trained coin year recognition model; and the model is output according to the coin year identification model.
  • the year number information determines the year of the coin in the target coin image. Since the year of the coin to be identified is recognized by the pre-trained coin year recognition model, it is not necessary to manually classify the coin according to the year of the coin, which not only improves the efficiency of coin recovery but also saves labor costs.
  • FIG. 8 is a schematic structural diagram of a terminal device according to another embodiment of the present invention.
  • Each unit included in the terminal device 700 of this embodiment is used to perform the steps in the embodiment corresponding to FIG. 3.
  • the terminal device 700 in this embodiment further includes a second acquiring unit 74 and a model, with respect to the embodiment corresponding to FIG. ⁇ 0 2019/127075 ⁇ (:17 ⁇ 2017/118891 Training unit 75.
  • the second obtaining unit 74 is configured to acquire a training sample set; wherein each set of sample data in the training sample set is composed of a coin image and year digital information of coins in the coin image, the year of the coin
  • the digital information includes the name and coordinates of the four digits of the year on the coin.
  • the model training unit 75 is configured to adopt the training sample set pair to construct a pre-constructed region-based fast convolutional neural network RCNN model is trained, will be trained
  • the RCNN model is determined to be a coin year identification model; wherein the coin year identification model is used to identify the year of the coin.
  • the second obtaining unit 74 specifically includes an image obtaining unit 74 1 , a coordinate calibration unit 742 , a digital coordinate determining unit 743 , a digital name determining unit 744 , and a sample set determining unit. 745.
  • the image acquisition unit 741 is for acquiring a coin image for training the model.
  • the coordinate calibration unit 742 is configured to determine coordinates of four rectangular regions selected by the user on the coin in each of the coin images; wherein the rectangular region is used to represent the year number on the coin Occupied display area.
  • the digital coordinate determining unit 743 is for determining the coordinates of the four rectangular regions in the coin image as the coordinates of the four-digit year number on the coin in the coin image, respectively.
  • the number name determining unit 744 is for determining the name of the four-digit year number on the coin in each of the coin images.
  • the sample set determining unit 745 is configured to store the name and the coordinates of the year number on each of the coin images and the coins in each of the coin images to obtain a training sample set.
  • the coordinate calibration unit 742 specifically includes a region obtaining unit and a region coordinate determining unit.
  • the area obtaining unit is configured to acquire four rectangular areas selected by the user on the coins in each of the coin images.
  • the area coordinate determining unit is configured to determine coordinates of two end points of the preset diagonal of each of the rectangular areas according to a preset coordinate calibration strategy, and preset a diagonal of each of the rectangular areas The coordinates of the two endpoints are determined as the coordinates of the rectangular region.
  • the Faster RCNN model includes a feature extraction network ⁇ 0 2019/127075 ⁇ (:17 ⁇ 2017/118891
  • the model training unit 75 specifically includes: a parameter initialization unit 751, a first training unit 752, a parameter update unit 753, a second training unit 754, and a model determination unit 755.
  • the parameter initialization unit 751 is configured to initialize a parameter value of the feature extraction network according to a parameter value of the feature extraction model obtained by pre-training, randomly initialize a parameter value of the region extraction network, and adopt an initialized The feature extraction network and the region extraction network extract candidate regions from each of the coin images.
  • the first training unit 752 is configured to perform the first training on the target recognition network based on the candidate regions extracted from each of the coin images and the year digital information of the coins in each of the coin images.
  • the parameter updating unit 753 is configured to update the parameter value of the area extraction network according to the initial parameter value of the target identification network after the first training, and adopt the initialized feature extraction network and the updated The region extraction network again extracts candidate regions from each of the coin images.
  • the second training unit 754 is configured to perform the second training on the target recognition network according to the candidate region extracted from each of the coin images and the year digital information of the coins in each of the coin images. .
  • the model determining unit 755 is configured to identify the Fa S t er RCNN model composed of the initialized feature extraction network, the updated region extraction network, and the target training network after the second training. Identify the model for the coin year.
  • a terminal device provided by this embodiment is pre-built RCNN model
  • the RCNN model is trained to obtain a coin year recognition model.
  • the target detection and positioning rate is faster and the accuracy is higher. Therefore, the coin year model obtained by training the Fa S t er RCNN model is used to identify the year of the coin, which not only improves the efficiency of the coin year recognition, but also improves the efficiency.
  • the accuracy of the coin year identification since the positions and postures of the coins in the plurality of coin images included in the training sample set are random, the coin year recognition model trained based on the training sample set can be effective for the years of the coins in the coin images of different specifications.
  • Identification. 9 is a schematic diagram of a terminal device according to still another embodiment of the present invention. As shown in FIG.
  • the terminal device 900 of this embodiment includes: a processor 90, a memory 91, and a computer program 92 stored in the memory 91 and operable on the processor 90.
  • the processor 90 when executing the computer program 92, implements the steps in the various method embodiments described above, such as S11 through S13 shown in FIG.
  • the processor 90 executes the computer program 92, the functions of the units/units in the above-described respective terminal device embodiments are implemented, for example, the functions of the units 71 to 73 shown in FIG.
  • the computer program 92 may be partitioned into one or more units/units, which are stored in the memory 91 and executed by the processor 90.
  • the one or more units/units may be a series of computer program instruction segments capable of performing a particular function, the instruction segments being used to describe the execution of the computer program 92 in the terminal device.
  • the computer program 92 can be divided into a first obtaining unit, a model calling unit, and a year determining unit, and the specific functions of each unit are as follows:
  • the first acquisition unit is configured to acquire a target coin image to be identified.
  • the model calling unit is configured to input the target coin image to the trained coin year recognition model.
  • the year determining unit is configured to determine a year of the coin in the target coin image according to the year number information output by the coin year identification model; wherein the year number information is used to represent the year of the coin.
  • the terminal device 900 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal device 900 can include, but is not limited to, a processor 90, a memory 91.
  • FIG. 9 is merely an example of a terminal device, and does not constitute a limitation on the terminal device 900, and may include more or less components than those illustrated, or combine some components, or different components.
  • the terminal device may further include an input/output device, a network access device, a bus, and the like.
  • the processor 90 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-to-use programmable gate array
  • CPU central processing unit
  • DSP digital signal processor
  • ASIC Application Specific Integrated Circuit
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 91 may be an internal storage unit of the terminal device, such as a hard disk or a terminal of the terminal device. Save.
  • the memory 91 may also be an external storage device of the terminal device, for example, a plug-in hard disk provided on the terminal device, and an intelligent memory card (Smart Media)
  • the memory 91 may also include both an internal storage unit of the terminal device and an external storage device.
  • the memory 91 is used to store the computer program and other programs and data required by the terminal device.
  • the memory 91 can also be used to temporarily store data that has been output or is about to be output.
  • each functional unit and unit described above is exemplified. In practical applications, the above functions may be assigned differently according to needs.
  • the functional unit and the unit are completed, that is, the internal structure of the terminal device is divided into different functional units or units to complete all or part of the functions described above.
  • Each functional unit and unit in the embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the integrated unit may be implemented by hardware.
  • Formal implementation can also be implemented in the form of software functional units.
  • the disclosed terminal devices/systems and methods may be implemented in other manners.
  • the terminal device/system embodiment described above is only illustrative.
  • the division of the unit or unit is only a logical function division.
  • there may be another division manner for example, multiple units.
  • components can be combined or can be integrated into another Systems, or some features can be ignored, or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, terminal device or unit, and may be in electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place, or may be distributed to multiple networks. On the unit. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit/unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the present invention implements all or part of the processes in the foregoing embodiments, and may also be completed by a computer program to instruct related hardware.
  • the computer program may be stored in a computer readable storage medium. The steps of the various method embodiments described above may be implemented when the program is executed by the processor.
  • the computer program includes computer program code, and the computer program code may be in the form of a source code, an object code, an executable file, or some intermediate form.
  • the computer readable medium may include: any entity or terminal device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read only memory (Read-Only Memory, ROM) ), Random Access Memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media.
  • a recording medium a USB flash drive
  • a removable hard disk a magnetic disk
  • an optical disk a computer memory
  • electrical carrier signals telecommunications signals
  • software distribution media may be appropriately increased or decreased according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable media It does not include electrical carrier signals and telecommunication signals.

Abstract

The present application is applicable to the technical field of image recognition, and provides a method for identifying a coin year, a terminal device, and a computer readable storage medium. The method comprises: obtaining a target coin image to be identified; inputting the target coin image into a trained coin year recognition model; and determining the year of a coin in the target coin image according to year number information outputted by the coin year recognition model. Because the year of a coin to be identified can be identified by using a pre-trained coin year recognition model, manual classification of coins based on the years of the coins is avoided, so that the coin recovery efficiency is improved and the manual costs are saved.

Description

\¥0 2019/127075 卩(:17 \2017/118891  \¥0 2019/127075 卩(:17 \2017/118891
一种识别硬币年份的方法、 终端设备及计算机可读存储介质 Method for identifying coin year, terminal device and computer readable storage medium
技术领域 Technical field
[0001] 本发明属于图像识别技术领域, 尤其涉及一种识别硬币年份的方法、 终端设备 及计算机可读存储介质。  [0001] The present invention belongs to the field of image recognition technologies, and in particular, to a method for identifying a coin year, a terminal device, and a computer readable storage medium.
背景技术  Background technique
[0002] 随着国民经济的发展, 印刷工艺的提高, 国家每隔一定时间会发行一套新的硬 币, 而对一些发行年份较早的硬币则需要进行回收。 传统的硬币回收方法是由 工作人员根据硬币正面印刷的发行年份对硬币进行分类, 再筛选出发行年份较 早的硬币。 这种人工回收硬币的方法工作量大, 效率低, 且人工成本较高。 发明概述  [0002] With the development of the national economy and the improvement of the printing process, the country will issue a new set of coins at regular intervals, and some coins with earlier release years need to be recycled. The traditional coin recycling method is to classify the coins according to the release year of the front printing of the coin, and then select the coins with the earlier release date. This method of manually recycling coins is labor intensive, inefficient, and labor intensive. Summary of invention
技术问题  technical problem
[0003] 本发明提供了一种识别硬币年份的方法、 终端设备及计算机可读存储介质, 以 解决现有的人工回收硬币的方法所存在的工作量大, 效率低, 且人工成本较高 的问题。  [0003] The present invention provides a method for identifying a coin year, a terminal device, and a computer readable storage medium, to solve the existing method for manually recycling coins, which has a large workload, low efficiency, and high labor cost. problem.
问题的解决方案  Problem solution
技术解决方案  Technical solution
[0004] 本发明的第一方面提供了一种识别硬币年份的方法, 包括:  A first aspect of the invention provides a method of identifying a year of a coin, comprising:
[0005] 获取待识别的目标硬币图像;  [0005] acquiring an image of a target coin to be identified;
[0006] 将所述目标硬币图像输入至训练好的硬币年份识别模型;  [0006] inputting the target coin image into the trained coin year recognition model;
[0007] 根据所述硬币年份识别模型输出的年份数字信息确定所述目标硬币图像中的硬 币的年份; 其中, 所述年份数字信息用于表征硬币的年份。  [0007] determining a year of the coin in the target coin image according to the year number information output by the coin year identification model; wherein the year number information is used to represent the year of the coin.
[0008] 本发明的第二方面提供了一种终端设备, 包括用于执行如上述第一方面所述的 方法的单元。  A second aspect of the invention provides a terminal device comprising means for performing the method as described in the first aspect above.
[0009] 本发明的第三方面提供了一种终端设备, 包括存储器、 处理器以及存储在所述 \¥0 2019/127075 卩(:17 \2017/118891 存储器中并可在所述处理器上运行的计算机程序, 其中, 所述处理器执行所述 计算机程序时实现如上述第一方面所述方法的步骤。 A third aspect of the present invention provides a terminal device including a memory, a processor, and the \¥0 2019/127075 卩 (: 17 \2017/118891 a computer program in a memory and operable on the processor, wherein the processor executes the computer program to implement the method as described in the first aspect above A step of.
[0010] 本发明的第四方面提供了一种计算机可读存储介质, 所述计算机可读存储介质 存储有计算机程序, 其中, 所述计算机程序被处理器执行时实现如上述第一方 面所述方法的步骤。  [0010] A fourth aspect of the invention provides a computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the first aspect as described above The steps of the method.
发明的有益效果  Advantageous effects of the invention
有益效果  Beneficial effect
[0011] 本发明通过获取待识别的目标硬币图像; 将所述目标硬币图像输入至训练好的 硬币年份识别模型; 根据所述硬币年份识别模型输出的年份数字信息确定所述 目标硬币图像中的硬币的年份。 由于通过预先训练好的硬币年份识别模型对待 识别的硬币的年份进行识别, 从而无需人工根据硬币的年份对硬币进行分类, 不仅提高了硬币回收的效率, 而且节省了人工成本。  [0011] The present invention obtains a target coin image to be identified; inputs the target coin image to a trained coin year recognition model; and determines, in the target coin image, based on year digital information output by the coin year recognition model The year of the coin. Since the year of the coin to be recognized is recognized by the pre-trained coin year recognition model, it is not necessary to manually classify the coin according to the year of the coin, which not only improves the efficiency of coin recovery but also saves labor costs.
对附图的简要说明  Brief description of the drawing
附图说明  DRAWINGS
[0012] 图 1是本发明实施例提供的一种识别硬币年份的方法的实现流程图;  1 is a flowchart of an implementation of a method for recognizing a coin year according to an embodiment of the present invention;
[0013] 图 是本发明实施例提供的一种硬币图像的示意图;  [0013] FIG. is a schematic diagram of a coin image provided by an embodiment of the present invention;
[0014] 图 215是本发明实施例提供的一种硬币图像中年份数字位于硬币所在的圆形显示 区域的下半部分的示意图;  [0014] FIG. 215 is a schematic diagram of a lower half of a circular display area in which a coin image is located in a coin image according to an embodiment of the present invention;
[0015] 图 2(:是本发明实施例提供的一种硬币图像中年份数字位于硬币所在的圆形显示 区域的上半部分的示意图;  [0015] FIG. 2 is a schematic diagram showing the upper half of the circular display area where the coin is located in the coin image provided by the embodiment of the present invention;
[0016] 图 2(1是本发明实施例提供的一种硬币图像中年份数字位于硬币所在的圆形显示 区域的右半部分的示意图;  2 is a schematic diagram of a coin image in an embodiment of the present invention in which the year number is located in the right half of the circular display area where the coin is located;
[0017] 图 是本发明实施例提供的一种硬币图像中年份数字位于硬币所在的圆形显示 区域的左半部分的示意图;  [0017] FIG. is a schematic diagram of a coin image in which the year number is located in the left half of the circular display area where the coin is located;
[0018] 图 3是本发明另一实施例提供的一种识别硬币年份的方法的实现流程图;  3 is a flowchart of an implementation of a method for recognizing a coin year according to another embodiment of the present invention;
[0019] 图 4是本发明实施例提供的一种识别硬币年份的方法中301的实现流程图; 4 is a flowchart of an implementation of 301 in a method for recognizing a coin year according to an embodiment of the present invention;
[0020]
Figure imgf000004_0001
RCNN模型的结构示意图;
[0020]
Figure imgf000004_0001
Schematic diagram of the structure of the RCNN model;
[0021] 图 6是本发明实施例提供的一种识别硬币年份的方法中302的实现流程图; \¥0 2019/127075 卩(:17 \2017/118891 [0021] FIG. 6 is a flowchart of an implementation of a method for identifying a coin year according to an embodiment of the present invention; \¥0 2019/127075 卩(:17 \2017/118891
[0022] 图 7是发明实施例提供的一种终端设备的结构示意图; [0022] FIG. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present invention;
[0023] 图 8是本发明另一实施例提供的一种终端设备的结构示意图;  8 is a schematic structural diagram of a terminal device according to another embodiment of the present invention;
[0024] 图 9是本发明再一实施例提供的一种终端设备的结构示意图。  FIG. 9 is a schematic structural diagram of a terminal device according to still another embodiment of the present invention.
发明实施例  Invention embodiment
本发明的实施方式  Embodiments of the invention
[0025] 下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实 施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创造性劳动前 提下所获得的所有其他实施例, 都属于本发明保护的范围。  [0025] The technical solutions in the embodiments of the present invention will be clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, but not all embodiments. . All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without departing from the inventive work are all within the scope of the present invention.
[0026] 应当理解, 本说明书和所附权利要求书中使用时的术语“包括”和“包含”指示所 描述特征、 整体、 步骤、 操作、 元素和 /或组件的存在, 但并不排除一个或多个 其它特征、 整体、 步骤、 操作、 元素、 组件和 /或其集合的存在或添加。  The terms "comprising" and "comprising", when used in the claims and the claims Or the presence or addition of a plurality of other features, integers, steps, operations, elements, components, and/or collections thereof.
[0027] 还应当理解, 在此本发明说明书中所使用的术语仅仅是出于描述特定实施例的 目的而并不意在限制本发明。 如在本发明说明书和所附权利要求书中所使用的 那样, 除非上下文清楚地指明其它情况, 否则单数形式的“一”、 “一个”及“该”意 在包括复数形式。  The terminology used herein is for the purpose of describing particular embodiments and is not intended to limit the invention. The singular forms "a," ",",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
[0028] 还应当进一步理解, 在本发明说明书和所附权利要求书中使用的术语“和 /或” 是指相关联列出的项中的一个或多个的任何组合以及所有可能组合, 并且包括 这些组合。  [0028] It should also be further understood that the term "and/or" used in the description of the invention and the appended claims means any combination and all possible combinations of one or more of the associated listed items, and These combinations are included.
[0029] 请参阅图 1, 图 1是本发明实施例提供的一种识别硬币年份的方法的实现流程图 。 本实施例中识别硬币年份的方法的执行主体为终端设备。 终端设备可以为智 能手机、 平板电脑等移动终端设备, 还可以为其他终端设备, 此处不做限制。 如图 1所示的识别硬币年份的方法可以包括以下步骤:  Referring to FIG. 1, FIG. 1 is a flowchart of an implementation of a method for recognizing a coin year according to an embodiment of the present invention. The execution subject of the method for recognizing the coin year in this embodiment is a terminal device. The terminal device may be a mobile terminal device such as a smart phone or a tablet computer, or may be another terminal device, and is not limited herein. The method of identifying the year of the coin as shown in FIG. 1 may include the following steps:
[0030] 811: 获取待识别的目标硬币图像。  [0030] 811: Acquire an image of the target coin to be identified.
[0031] 在本实施例中, 当需要对硬币的发行年份进行识别时, 可以先通过摄像装置对 待识别的硬币进行图像采集, 得到硬币图像, 再将采集到的硬币图像输入至终 端设备。 终端设备若检测到用于识别硬币年份的指令, 则接收用户输入的硬币 图像, 并将用户输入的硬币图像确定为待识别的目标硬币图像。 \¥0 2019/127075 卩(:17 \2017/118891 [0031] In this embodiment, when it is necessary to identify the year of release of the coin, the image of the coin to be recognized by the camera device may be image-collected to obtain a coin image, and the collected coin image is input to the terminal device. The terminal device receives the coin image input by the user if an instruction for identifying the year of the coin is detected, and determines the coin image input by the user as the target coin image to be recognized. \¥0 2019/127075 卩(:17 \2017/118891
[0032] 目标硬币图像可以是一张, 也可以是至少两张, 此处不做限制。 [0032] The target coin image may be one sheet or at least two, and is not limited herein.
[0033] 待识别的硬币可以是人民币硬币, 也可以是欧元硬币, 还可以是其他类型的硬 币, 此处不做限制。  [0033] The coin to be identified may be a renminbi coin, a euro coin, or other types of hard coins, and is not limited herein.
[0034] 812: 将所述目标硬币图像输入至训练好的硬币年份识别模型。  [0034] 812: Input the target coin image into the trained coin year recognition model.
[0035] 终端设备获取到待识别的目标硬币图像后, 调用预先训练好的硬币年份模型对 目标硬币图像进行处理。 需要说明的是, 在本实施例中, 硬币年份识别单元的 输入量是硬币图像, 输出量是硬币图像中的硬币的年份数字信息。  [0035] After the terminal device acquires the target coin image to be identified, the pre-trained coin year model is invoked to process the target coin image. It should be noted that, in the present embodiment, the input amount of the coin year identification unit is a coin image, and the output amount is the year digital information of the coin in the coin image.
[0036] 年份数字信息包括硬币上用于构成硬币年份的四位年份数字的名称和坐标。 例 如, 若硬币的发行年份为 1987 , 则该硬币上的四位年份数字的名称分别为“1”、 “ 9”、 “8”、 “7”。 在本实施例中, 四位年份数字的坐标可以通过四位年份数字分别 在硬币图像中所占的某一矩形区域的坐标表示。 矩形区域的坐标可通过该矩形 区域预设对角线的两个端点的坐标表示。  [0036] The year number information includes the name and coordinates of the four-digit year number used to form the coin year on the coin. For example, if the release date of the coin is 1987, the names of the four digits on the coin are "1", "9", "8", "7". In this embodiment, the coordinates of the four-digit year number can be represented by the coordinates of a rectangular area occupied by the four-digit year number in the coin image. The coordinates of the rectangular area can be represented by the coordinates of the two end points of the preset diagonal of the rectangular area.
[0037] 例如, 请一并参阅图 2&, 图 示出了本发明实施例提供的一种硬币图像的示意 图。 如图 所述, 硬币图像中的硬币上的四位年份数字“1”、 “9”、 “8”、 “7”所占 的矩形区域分布为
Figure imgf000006_0001
则可以通过矩形区域
Figure imgf000006_0002
For example, please refer to FIG. 2 & FIG. 2 for a schematic diagram of a coin image provided by an embodiment of the present invention. As shown in the figure, the rectangular area occupied by the four digits "1", "9", "8", and "7" on the coin in the coin image is
Figure imgf000006_0001
Can pass through the rectangular area
Figure imgf000006_0002
表示年份数字“1”、 “9”、 “8”、 “7”的坐标。 在本发明一实施例中, 可以以每个矩 形区域左下角端点的坐标和右上角端点的坐标来表示每个矩形区域的坐标。 例 如, 若矩形区域 &左下角端点的坐标为(X Indicates the coordinates of the year numbers "1", "9", "8", and "7". In an embodiment of the invention, the coordinates of each rectangular region may be represented by the coordinates of the end points of the lower left corner of each rectangular region and the coordinates of the endpoints of the upper right corner. For example, if the coordinates of the rectangular area & the lower left end point are (X)
), 矩形区域&右上角端点的坐标为(X ,2), 贝腕形区域 &
Figure imgf000006_0003
), the coordinates of the rectangular area & the upper right corner are (X , 2 ), the shell wrist area &
Figure imgf000006_0003
4 ^)], 那么年份数字“
Figure imgf000006_0004
4 ^)], then the year number "
Figure imgf000006_0004
[0038] 在本实施例中, 终端设备调用预先训练好的硬币年份模型对目标硬币图像进行 处理可以是: 终端设备将待识别的目标硬币图像输入至硬币年份识别模型, 并 获取硬币年份识别模型输出的目标硬币图像中的硬币的年份数字信息。  [0038] In this embodiment, the terminal device invoking the pre-trained coin year model to process the target coin image may be: the terminal device inputs the target coin image to be identified into the coin year recognition model, and acquires the coin year recognition model. The year digital information of the coin in the output target coin image.
[0039] 813: 根据所述硬币年份识别模型输出的年份数字信息确定所述目标硬币图像 中的硬币的年份。  [0039] 813: Determine a year of the coin in the target coin image according to the year digital information output by the coin year identification model.
[0040] 终端设备获取到硬币年份识别模型输出的目标硬币图像中的硬币的年份数字信 息后, 根据目标硬币图像中的硬币的年份数字信息, 确定目标硬币图像中的硬 币的年份。 \¥0 2019/127075 卩(:17 \2017/118891 [0040] After acquiring the year number information of the coin in the target coin image output by the coin year identification model, the terminal device determines the year of the coin in the target coin image according to the year number information of the coin in the target coin image. \¥0 2019/127075 卩(:17 \2017/118891
[0041] 在本发明一具体实施例中, 313可以包括以下步骤: [0041] In a specific embodiment of the present invention, 313 may include the following steps:
[0042] 根据所述目标硬币图像中的硬币上的四位年份数字的坐标以及预设排序策略对 所述四位年份数字进行排序, 得到所述硬币的年份。  And [0042] sorting the four-digit year numbers according to coordinates of four-digit year numbers on coins in the target coin image and a preset sorting strategy to obtain a year of the coins.
[0043] 在本实施例中, 终端设备可以根据目标硬币图像中的硬币上的四位年份数字的 坐标以及预设排序策略对四位年份数字进行排序, 进而得到硬币的年份。  [0043] In this embodiment, the terminal device may sort the four-digit year number according to the coordinates of the four-digit year number on the coin in the target coin image and the preset sorting strategy, thereby obtaining the year of the coin.
[0044] 在本实施例中, 当硬币上的四位年份数字的排列方式不同时, 对应的预设排序 策略不同, 具体根据实际需求设置, 此处不做限制。  [0044] In this embodiment, when the arrangement of the four digits on the coin is different, the corresponding preset sorting strategy is different, and the setting is specifically according to actual requirements, and no limitation is made here.
[0045] 如图 所示, 在实际应用中, 由于硬币上的四位年份数字通常是沿着硬币的边 缘呈弧形状依次排列, 因此, 此处以硬币上的四位年份数字沿硬币的边缘呈弧 形状依次排列为例, 对终端设备根据预设排序策略对四位年份数字进行排序的 具体过程进行详细说明。 具体的, 在本实施例中, 根据所述目标硬币图像中的 硬币上的四位年份数字的坐标以及预设排序策略对所述四位年份数字进行排序 , 得到所述硬币的年份, 具体可以包括以下步骤:  [0045] As shown in the figure, in practical applications, since the four digits on the coin are usually arranged in an arc shape along the edge of the coin, the four-digit year number on the coin is presented along the edge of the coin. The arc shape is sequentially arranged as an example, and the specific process of sorting the four-digit year numbers according to the preset sorting strategy by the terminal device is described in detail. Specifically, in this embodiment, the four-digit year number is sorted according to the coordinates of the four-digit year number on the coin in the target coin image and the preset sorting strategy, to obtain the year of the coin, specifically Includes the following steps:
[0046] 采用背景差分法对所述目标硬币图像进行处理, 得到所述目标硬币图像中的硬 币所在的圆形显示区域, 确定所述圆形显示区域的中心点的坐标;  [0046] processing the target coin image by using a background difference method to obtain a circular display area where the coin in the target coin image is located, and determining coordinates of a center point of the circular display area;
[0047] 根据所述圆形显示区域的中心点的坐标以及所述硬币上的四位年份数字的坐标 , 确定所述四位年份数字在所述圆形显示区域中的位置;  [0047] determining a position of the four-digit year number in the circular display area according to coordinates of a center point of the circular display area and coordinates of four-digit year numbers on the coin;
[0048] 若所述四位年份数字均位于所述圆形显示区域的下半部分, 则按照第一预设顺 序对所述四位年份数字进行排序, 得到所述硬币的年份;  [0048] if the four digits are located in the lower half of the circular display area, the four digits are sorted according to a first preset order to obtain a year of the coin;
[0049] 若所述四位年份数字均位于所述圆形显示区域的上半部分, 则按照第二预设顺 序对所述四位年份数字进行排序, 得到所述硬币的年份;  [0049] if the four digits are located in the upper half of the circular display area, the four digits are sorted according to a second preset order to obtain the year of the coin;
[0050] 若所述四位年份数字均位于所述圆形显示区域的右半部分, 则按照第三预设顺 序对所述四位年份数字进行排序, 得到所述硬币的年份;  [0050] if the four digits are located in the right half of the circular display area, the four digits are sorted according to a third preset order to obtain the year of the coin;
[0051] 若所述四位年份数字均位于所述圆形显示区域的左半部分, 则按照第四预设顺 序对所述四位年份数字进行排序, 得到所述硬币的年份。  [0051] If the four digits are located in the left half of the circular display area, the four digits are sorted according to a fourth preset order to obtain the year of the coin.
[0052] 在本实施例中, 终端设备在得到目标硬币图像中的硬币上的四位年份数字的坐 标后, 通过背景差分法对目标硬币图像进行处理, 以从目标硬币图像中提取硬 币所在的圆形显示区域。 终端设备基于目标硬币图像对应的原始坐标系, 确定 \¥0 2019/127075 卩(:17 \2017/118891 该圆形显示区域的中心点坐标。 在实际应用中, 终端设备可以调用
Figure imgf000008_0001
应用中 的^§1〇1 ]'(¾)8函数来求得圆形显示区域的中心点坐标。
[0052] In this embodiment, after obtaining the coordinates of the four-digit year number on the coin in the target coin image, the terminal device processes the target coin image by the background difference method to extract the coin from the target coin image. Round display area. The terminal device determines based on the original coordinate system corresponding to the target coin image \¥0 2019/127075 卩(:17 \2017/118891 The coordinates of the center point of the circular display area. In practical applications, the terminal device can call
Figure imgf000008_0001
The ^ § 1〇1 ]'(3⁄4)8 function in the application is used to find the coordinates of the center point of the circular display area.
[0053] 由于硬币年份识别模型输出的四位年份数字的坐标是通过四位年份数字所占的 矩形区域的预设对角线的两个端点的坐标表示的, 因此, 终端设备将硬币年份 识别模型输出的四位年份数字的坐标进行转换, 得到四位年份数字所占的矩形 区域的中心点的坐标, 再将四位年份数字所占的矩形区域的中心点的坐标与圆 形显示区域的中心点坐标进行比较, 进而确定四位年份数字在所述圆形显示区 域中的位置。  [0053] Since the coordinates of the four-digit year number output by the coin year recognition model are represented by the coordinates of the two end points of the preset diagonal of the rectangular area occupied by the four-digit year number, the terminal device identifies the coin year The coordinates of the four-digit year number output by the model are converted, and the coordinates of the center point of the rectangular area occupied by the four-digit year number are obtained, and the coordinates of the center point of the rectangular area occupied by the four-digit year number and the circular display area are The center point coordinates are compared to determine the position of the four-digit year number in the circular display area.
[0054] 在实际应用中, 第一预设顺序、 第二预设顺序、 第三预设顺序及第四预设顺序 需要根据硬币年份识别模型在确定硬币上的数字年份的坐标时所参照的坐标系 确定。 假设硬币年份识别模型输出的年份数字的坐标是基于以硬币图像左上角 端点为坐标原点, 以坐标原点所在的竖边作为 X轴正方向, 以坐标原点所在的横 边作为 X轴正方向所建立的坐标系, 贝 1  [0054] In an actual application, the first preset order, the second preset order, the third preset order, and the fourth preset order need to be referred to according to the coin year identification model when determining the coordinates of the digital year on the coin. The coordinate system is determined. Assume that the coordinates of the year number output by the coin year recognition model are based on the origin of the upper left corner of the coin image, the vertical side where the coordinate origin is located as the positive direction of the X axis, and the horizontal side where the coordinate origin is located as the positive direction of the X axis. Coordinate system, Bay 1
[0055] 如图 215所示, 终端设备若检测到四位年份数字所占的四个矩形区域的中心点对 应的 X轴坐标均大于圆形显示区域的中心点对应的\轴坐标, 则识别为四位年份 数字均位于圆形显示区域的下半部分, 此时终端设备按照矩形区域的中心点对 应的 \轴坐标从小到大的顺序对四位年份数字进行排序, 得到硬币的年份, 在图 215中, 排序后得到的硬币的年份为“1987”。  [0055] As shown in FIG. 215, if the terminal device detects that the X-axis coordinates corresponding to the center points of the four rectangular regions occupied by the four-digit year numbers are greater than the \-axis coordinates corresponding to the center point of the circular display region, the terminal device recognizes The four-digit year numbers are located in the lower half of the circular display area. At this time, the terminal device sorts the four-digit year numbers in the order of the \-axis coordinates corresponding to the center point of the rectangular area from the smallest to the largest, and obtains the year of the coin. In Fig. 215, the year of the coin obtained after sorting is "1987".
[0056] 如图 所示, 终端设备若检测到四位年份数字所占的四个矩形区域的中心点对 应的 X轴坐标均小于圆形显示区域的中心点对应的\轴坐标, 则识别为四位年份 数字均位于圆形显示区域的上半部分, 此时终端设备按照矩形区域的中心点对 应的 \轴坐标从大到小的顺序对四位年份数字进行排序, 得到硬币的年份, 在图 排序后得到的硬币的年份为“1987”。  [0056] As shown in the figure, if the terminal device detects that the X-axis coordinates corresponding to the center points of the four rectangular regions occupied by the four-digit year number are smaller than the \-axis coordinates corresponding to the center point of the circular display region, the terminal device recognizes that The four-digit year numbers are located in the upper half of the circular display area. At this time, the terminal device sorts the four-digit year numbers in descending order of the \-axis coordinates corresponding to the center point of the rectangular area to obtain the year of the coin. The year of the coin obtained after sorting the figure is "1987".
[0057] 如图 2(1所示, 终端设备若检测到四位年份数字所占的四个矩形区域的中心点对 应的 X轴坐标均大于圆形显示区域的中心点对应的\轴坐标, 则识别为四位年份 数字均位于圆形显示区域的右半部分, 此时终端设备按照矩形区域的中心点对 应的 \轴坐标从大到小的顺序对四位年份数字进行排序, 得到硬币的年份, 在图 2(1中, 排序后得到的硬币的年份为“1987”。 \¥0 2019/127075 卩(:17 \2017/118891 [0057] As shown in FIG. 2 (1), if the terminal device detects that the X-axis coordinate corresponding to the center point of the four rectangular regions occupied by the four-digit year number is greater than the \-axis coordinate corresponding to the center point of the circular display region, Then, the four-digit year numbers are located in the right half of the circular display area, and the terminal device sorts the four-digit year numbers in descending order of the \-axis coordinates corresponding to the center point of the rectangular area to obtain the coin. Year, in Figure 2 (1, the year of the coin obtained after sorting is "1987". \¥0 2019/127075 卩(:17 \2017/118891
[0058] 如图 所示, 终端设备若检测到四位年份数字所占的四个矩形区域的中心点对 应的 X轴坐标均小于圆形显示区域的中心点对应的\轴坐标, 则识别为四位年份 数字均位于圆形显示区域的左半部分, 此时终端设备按照矩形区域的中心点对 应的 \轴坐标从小到大的顺序对四位年份数字进行排序, 得到硬币的年份, 在图 排序后得到的硬币的年份为“1987”。 [0058] As shown in the figure, if the terminal device detects that the X-axis coordinate corresponding to the center point of the four rectangular regions occupied by the four-digit year number is smaller than the \-axis coordinate corresponding to the center point of the circular display region, the terminal device recognizes that The four-digit year numbers are located in the left half of the circular display area. At this time, the terminal device sorts the four-digit year numbers according to the \axis coordinate corresponding to the center point of the rectangular area from small to large, and obtains the year of the coin. The year of the coin obtained after sorting is "1987".
[0059] 以上可以看出, 本实施例提供的一种识别硬币年份的方法通过获取待识别的目 标硬币图像; 将所述目标硬币图像输入至训练好的硬币年份识别模型; 根据所 述硬币年份识别模型输出的年份数字信息确定所述目标硬币图像中的硬币的年 份。 由于通过预先训练好的硬币年份识别模型对待识别的硬币的年份进行识别 , 从而无需人工根据硬币的年份对硬币进行分类, 不仅提高了硬币回收的效率 , 而且节省了人工成本。  [0059] As can be seen from the above, the method for identifying the coin year provided by the embodiment obtains the target coin image to be identified; the target coin image is input to the trained coin year recognition model; The year number information of the recognition model output determines the year of the coin in the target coin image. Since the year of the coin to be recognized is recognized by the pre-trained coin year recognition model, it is not necessary to manually classify the coin according to the year of the coin, which not only improves the efficiency of coin recovery but also saves labor costs.
[0060] 请参阅图 3 , 图 3是本发明另一实施例提供的一种识别硬币年份的方法的实现流 程图。 本实施例中识别硬币年份的方法的执行主体为终端设备。 终端设备可以 为手机、 平板电脑等移动终端设备, 还可以为其他终端设备, 此处不做限制。 如图 3所示, 在图 1对应的实施例的基础上, 本实施例在 311之前, 还可以包括 0 Referring to FIG. 3, FIG. 3 is a flow chart of an implementation of a method for recognizing a coin year according to another embodiment of the present invention. The execution subject of the method for recognizing the coin year in this embodiment is a terminal device. The terminal device may be a mobile terminal device such as a mobile phone or a tablet computer, or may be another terminal device, and is not limited herein. As shown in FIG. 3, on the basis of the embodiment corresponding to FIG. 1, the embodiment may further include 0 before 311.
1-802, 具体如下: 1-802, as follows:
[0061] 801: 获取训练样本集。  [0061] 801: Acquire a training sample set.
[0062] 在本实施例中, 在调用预先训练好的硬币年份识别模型对硬币的年份进行识别 之前, 需要对硬币年份识别模型进行训练。  [0062] In the present embodiment, the coin year recognition model needs to be trained before the pre-trained coin year recognition model is called to identify the year of the coin.
[0063] 在对硬币年份识别模型进行训练时, 首先需要获取用于训练模型的训练样本集 。 其中, 训练样本集包括多组样本数据, 每组样本数据均由硬币图像以及硬币 图像中的硬币的年份数字信息构成。 硬币的年份数字信息包括硬币上的四位年 份数字的名称及坐。  [0063] When training the coin year recognition model, it is first necessary to acquire a training sample set for training the model. The training sample set includes a plurality of sets of sample data, and each set of sample data is composed of a coin image and year digital information of coins in the coin image. The year number information for the coin includes the name and seat of the four digits on the coin.
[0064] 在本发明一具体实施例中, 301可以通过如图 4所示的 3011~3015实现, 具体如 下:  [0064] In an embodiment of the present invention, 301 can be implemented by using 3011~3015 as shown in FIG. 4, as follows:
[0065] 8011: 获取用于训练模型的硬币图像。  [0065] 8011: Acquire a coin image for training the model.
[0066] 在本实施例中, 在训练模型之前, 可以通过摄像装置采集大量的用于训练模型 的硬币图像, 并将采集到的用于训练模型的硬币图像统一存储在终端设备中的 \¥0 2019/127075 卩(:17 \2017/118891 第一图像文件夹。 终端设备在接收到模型训练指令时, 从第一图像文件夹中获 取用于训练模型的硬币图像。 [0066] In this embodiment, before training the model, a large number of coin images for training the model may be collected by the camera device, and the collected coin images for training the model are uniformly stored in the terminal device. \¥0 2019/127075 卩(:17 \2017/118891 First image folder. When the terminal device receives the model training instruction, it acquires the coin image for training the model from the first image folder.
[0067] 需要说明的是, 通过摄像装置采集到的所有硬币图像的尺寸均相同。 例如, 通 过摄像装置采集到的所有硬币图像的尺寸均为 MxN像素。 其中, M和N分别表示 图像的每行和每列所包含的像素个数, M和N均为正整数, M和N可以根据实际 需求设置, 此处不做限。  [0067] It should be noted that all the coin images collected by the imaging device are the same size. For example, all coin images acquired by the camera are of MxN pixels. Wherein, M and N respectively represent the number of pixels included in each row and column of the image, and M and N are positive integers, and M and N can be set according to actual needs, and are not limited herein.
[0068] 在本实施例中, 终端设备获取到第一图像文件夹中的所有硬币图像后, 可以对 该第一图像文件夹中的所有硬币图像进行重命名。 具体的, 终端设备可以通过 预设的
Figure imgf000010_0001
算法对第一图像文件夹中的所有硬币图像进行重命名, 将硬币 图像的名称统一设置
Figure imgf000010_0002
其中, X为数字 0~9中的任一数字, 例如, 重 命名后的硬币图像的名称可以 000001.jpg、 000002.jpg、 000003.jpg等。 终端设备 可以将重命名后的所有硬币图像存储在第二图像文件夹。
[0068] In this embodiment, after the terminal device acquires all the coin images in the first image folder, all the coin images in the first image folder may be renamed. Specifically, the terminal device can be preset
Figure imgf000010_0001
The algorithm renames all the coin images in the first image folder, and sets the name of the coin image uniformly.
Figure imgf000010_0002
Where X is any number from 0 to 9, for example, the name of the renamed coin image may be 000001.jpg, 000002.jpg, 000003.jpg, and the like. The terminal device can store all the coin images after the rename in the second image folder.
[0069] 8012: 确定用户在每张所述硬币图像中的硬币上框选出的四个矩形区域的坐标 [0069] 8012: determining coordinates of four rectangular regions selected by the user on the coins in each of the coin images
; 其中, 所述矩形区域用于表征所述硬币上的年份数字所占的显示区域。 Wherein the rectangular area is used to represent a display area occupied by a year number on the coin.
[0070] 在本实施中, 终端设备对所有用于训练模型的硬币图像进行重命名后, 确定每 张硬币图像中的硬币上的四位年份数字的名称和坐标。  [0070] In the present embodiment, after the terminal device renames all the coin images for training the model, the name and coordinates of the four-digit year number on the coin in each coin image are determined.
[0071] 在实际应用中, 在确定每张硬币图像中的硬币上的四位年份数字的坐标时, 需 要用户辅助对每张硬币图像中的硬币上的四位年份数字进行标记。 具体的, 用 户可以通过矩形框对每张硬币图像中的硬币上的四位年份数字进行框选, 进而 框选出四个矩形区域。 用户在硬币图像中所框选出的四个矩形区域分别用于表 征硬币图像中的硬币上的四位年份数字所占的显示区域。  [0071] In practical applications, in determining the coordinates of the four digits of the number on the coin in each coin image, the user is required to assist in marking the four digits of the number on the coin in each coin image. Specifically, the user can frame the four-digit year number on the coin in each coin image through a rectangular frame, and then select four rectangular regions. The four rectangular areas selected by the user in the coin image are used to respectively represent the display area occupied by the four-digit year number on the coin in the coin image.
[0072] 需要说明的是, 由于硬币上的四位年份数字的尺寸大小基本相同, 因此, 四位 年份数字所占的显示区域的面积大致相同, 用户在硬币图像中所框选出的四个 矩形区域的面积大致相同。  [0072] It should be noted that since the size of the four digits on the coin is substantially the same, the area of the display area occupied by the four digits is substantially the same, and the four selected by the user in the coin image. The area of the rectangular area is approximately the same.
[0073] 在本发明一具体实施例中, 3012具体可以包括以下步骤:  [0073] In a specific embodiment of the present invention, 3012 may specifically include the following steps:
[0074] 获取用户在每张所述硬币图像中的硬币上框选出的四个矩形区域;  [0074] acquiring four rectangular regions selected by the user on the coins in each of the coin images;
[0075] 根据预设的坐标标定策略, 确定每个所述矩形区域的预设对角线的两个端点的 坐标, 将每个所述矩形区域的预设对角线的两个端点的坐标确定为所述矩形区 \¥0 2019/127075 卩(:17 \2017/118891 域的坐标。 [0075] determining, according to a preset coordinate calibration strategy, coordinates of two end points of a preset diagonal of each of the rectangular regions, and coordinates coordinates of two end points of a preset diagonal of each of the rectangular regions Determined to be the rectangular area \¥0 2019/127075 卩(:17 \2017/118891 The coordinates of the field.
[0076] 在本实施例中, 当用户在硬币图像中的硬币上框选出四个矩形区域后, 终端设 备获取用户在每张硬币图像中的硬币上框选出的四个矩形区域, 并根据预设的 坐标标定策略, 确定每个矩形区域的预设对角线的两个端点的坐标, 将每个矩 形区域的预设对角线的两个端点的坐标确定为该矩形区域的坐标。  [0076] In this embodiment, after the user selects four rectangular areas on the coins in the coin image, the terminal device acquires four rectangular areas selected by the user on the coins in each coin image, and Determining the coordinates of the two end points of the preset diagonal of each rectangular area according to the preset coordinate calibration strategy, and determining the coordinates of the two end points of the preset diagonal of each rectangular area as the coordinates of the rectangular area .
[0077] 其中, 预设的坐标标定策略用于表征以预设的坐标系为基准进行坐标标定。 预 设的坐标系可以根据实际需求确定, 此处不做限制。 例如, 预设的坐标系可以 是以硬币图像左上角端点为坐标原点, 以坐标原点所在的竖边作为 X轴正方向, 以坐标原点所在的横边作为 轴正方向所建立的坐标系。  [0077] wherein the preset coordinate calibration strategy is used to represent coordinate calibration based on a preset coordinate system. The preset coordinate system can be determined according to actual needs, and there is no restriction here. For example, the preset coordinate system may be the coordinate origin of the upper left corner of the coin image, the vertical direction where the coordinate origin is located as the positive direction of the X axis, and the horizontal edge where the coordinate origin is located as the coordinate system established by the positive direction of the axis.
[0078] 终端设备基于预设的坐标系, 确定每张硬币图像中每个矩形区域的预设对角线 的两个端点的坐标。 其中, 预设对角线可以根据实际需求设置, 此处不做限制 , 例如预设对角线可以是矩形区域左下角端点与右上角端点连接而成的对角线 , 此时, 该预设对角线两个端点分别为左下角端点和右上角端点。  [0078] The terminal device determines coordinates of two end points of a preset diagonal of each rectangular area in each coin image based on a preset coordinate system. The preset diagonal line can be set according to actual requirements, and is not limited herein. For example, the preset diagonal line may be a diagonal line connecting the lower left corner end point and the upper right corner end point of the rectangular area, and the preset is The two endpoints of the diagonal are the lower left endpoint and the upper right endpoint, respectively.
[0079] 终端设备在确定了每张硬币图像中每个矩形区域的预设对角线的连个端点的坐 标后, 将每个矩形区域的预设对角线的连个端点的坐标识别为相应矩形区域的 坐标。  [0079] after determining the coordinates of the consecutive endpoints of the preset diagonal of each rectangular area in each coin image, the terminal device recognizes the coordinates of the consecutive endpoints of each rectangular area as The coordinates of the corresponding rectangular area.
[0080] 例如, 如图 所示, 若矩形区域 &
Figure imgf000011_0001
矩形区域&右 上角端点的坐标为 (X 4 ^), 贝腕形区域 &的坐标即为[(X 4 ^) 』。
[0080] For example, as shown in the figure, if a rectangular area &
Figure imgf000011_0001
The coordinates of the rectangle area & the upper right corner are (X 4 ^), and the coordinates of the shell wrist area & is [(X 4 ^) ”.
[0081] 8013: 将所述硬币图像中的四个矩形区域的坐标分别确定为所述硬币图像中的 硬币上的四位年份数字的坐标。  [0081] 8013: Determine coordinates of four rectangular regions in the coin image as coordinates of four-digit year numbers on coins in the coin image, respectively.
[0082] 在本实施例中, 当终端设备确定了每张硬币图像中的四个矩形区域的坐标后, 将四个矩形区域的坐标分别确定为该硬币图像中的硬币上的四位年份数字的坐 标。 即通过矩形区域的坐标来表述该矩形区域内的年份数字的坐标。  [0082] In the embodiment, after the terminal device determines the coordinates of the four rectangular regions in each coin image, the coordinates of the four rectangular regions are respectively determined as the four-digit year numbers on the coins in the coin image. coordinate of. That is, the coordinates of the year number in the rectangular area are expressed by the coordinates of the rectangular area.
[0083] 例如, 结合图 和步骤 3012, 若矩形区域 &
Figure imgf000011_0002
那么 年份数字“
Figure imgf000011_0003
[0083] For example, in conjunction with the figure and step 3012, if a rectangular area &
Figure imgf000011_0002
Then the year number"
Figure imgf000011_0003
[0084] 8014: 确定每张所述硬币图像中的硬币上的四位年份数字的名称。  [0084] 8014: Determine a name of a four-digit year number on a coin in each of the coin images.
[0085] 在本实施例中, 在确定每张硬币图像中的硬币上的四位年份数字的坐标的同时 , 终端设备还确定每张硬币图像中的硬币上的四位年份数字的名称。 [0086] 在实际应用中, 每张硬币图像中的硬币上的四位年份数字的名称可以由用户输 入, 例如, 用户在通过矩形框框选每位年份数字的同时, 输入该数字的名称。 终端设备获取用户输入的每位年份数字的名称。 [0085] In the present embodiment, while determining the coordinates of the four-digit year number on the coin in each coin image, the terminal device also determines the name of the four-digit year number on the coin in each coin image. [0086] In practical applications, the name of the four-digit year number on the coin in each coin image may be input by the user. For example, the user inputs the name of the number while selecting each year number through the rectangular frame. The terminal device obtains the name of each year number entered by the user.
[0087] 8015: 将每张所述硬币图像、 每张所述硬币图像中的硬币上的年份数字的名称 及坐标进行关联存储, 得到训练样本集。  [0087] 8015: Associate each of the coin image, the name of the year number on the coin in each of the coin images, and coordinates to obtain a training sample set.
[0088] 在本实施例中, 终端设备获取到每张硬币图像中的硬币上的四位年份数字的名 称及坐标后, 将每张硬币图像、 每张硬币图像中的硬币上的四位年份数字的名 称及坐标进行关联存储。  [0088] In this embodiment, after the terminal device acquires the name and coordinates of the four-digit year number on the coin in each coin image, each coin image and the four-digit year on the coin in each coin image The names and coordinates of the numbers are stored in association.
[0089] 具体的, 终端设备在获取到每张硬币图像中的硬币上的四位年份数字的名称及 坐标后, 可以先将每张硬币图像的名称、 每张硬币图像中硬币上的四位年份数 字的名称及坐标以表格形式关联存储在第一文本文件中。  [0089] Specifically, after acquiring the name and coordinates of the four-digit year number on the coin in each coin image, the terminal device may first name the name of each coin image and four digits on the coin in each coin image. The name and coordinates of the year number are stored in a table form in the first text file.
[0090] 请参阅表 1, 表 1示出了第一文本文件的部分内容, 该部分内容为名称为 001352.  [0090] Please refer to Table 1, Table 1 shows part of the first text file, the part is named 001352.
的硬币图像中的硬币上的年份数字的名称及坐标。  The name and coordinates of the year number on the coin in the coin image.
[0091] 表 1  Table 1
[] [表 1]  [] [Table 1]
Figure imgf000012_0001
Figure imgf000012_0001
[0092] 在本实施例中, 终端设备在将每张硬币图像的名称、 每张硬币图像中硬币上的 四位年份数字的名称及坐标以表格形式关联存储在第一文本文件中后, 可以根 据硬币图像的名称, 进一步将第一文本文件中硬币图像的名称相同的文本信息 存储在同一可扩展标记语言 (Extensible Markup Language, XML) 文件中, 将 第一文本文件中硬币图像的名称不同的文本信息存储在不同 XML文件中。 如此 , 可以得到多个 XML文件。 每个 XML文件中存储了一张硬币图像中的硬币上的 四位年份数字的名称及坐标。 例如, 最终得到的多个 XML文件可以为: 000001. xml 000002.xmls 000003 傳。 [0092] In this embodiment, after the terminal device associates the name of each coin image, the name and coordinates of the four digits on the coin in each coin image in a table form in the first text file, According to the name of the coin image, the text information with the same name of the coin image in the first text file is further stored in the same Extensible Markup Language (XML) file, and the names of the coin images in the first text file are different. Text information is stored in different XML files. in this way , you can get multiple XML files. Each XML file stores the name and coordinates of a four-digit year number on a coin in a coin image. For example, the resulting multiple XML files can be: 000001. xml 000002.xml s 000003 Pass.
[0093] 在得到每张硬币图像对应的 XML文件后, 终端设备将硬币图像与其对应的 XM L文件进行关联存储, 得到多组样本数据, 该多组样本数据构成了用于训练模型 的样本集。  [0093] After obtaining the XML file corresponding to each coin image, the terminal device associates the coin image with its corresponding XM L file to obtain a plurality of sets of sample data, and the plurality of sets of sample data constitute a sample set for training the model. .
[0094] 在得到样本集之后, 终端设备可以随机从样本集中抽取 50%的样本数据作为训 练样本数据, 这些训练样本数据即组成了训练样本集。  [0094] After obtaining the sample set, the terminal device can randomly extract 50% of the sample data from the sample set as the training sample data, and the training sample data constitutes the training sample set.
[0095] S02: 采用所述训练样本集对预先构建的基于区域的快速卷积神经网络 Faster [0095] S02: using the training sample set to pre-build a region-based fast convolutional neural network Faster
RCNN模型进行训练, 将训练好的所述 Faster RCNN模型确定为硬币年份识别模 型。 The RCNN model is trained to determine the trained Faster RCNN model as a coin year identification model.
[0096] 在本实施例中, 终端设备获取到训练样本集之后, 采用训练样本集对预先构建 的基于区域的快速卷积神经网络 (Faster Region-based convolutional neural network, Faster RCNN) 模型进行训练。  [0096] In this embodiment, after acquiring the training sample set, the terminal device uses the training sample set to train the pre-built region-based convolutional neural network (Faster RCNN) model.
[0097] 具体的, 终端设备将每张硬币图像作为 Faster RCNN模型的输入, 每张硬币图 像中硬币上的四位年份数字的名称及坐标作为 Faster RCNN模型的输出, 对预先 构建的 Faster RCNN模型进行训练。 终端设备在训练好 Faster RCNN模型后, 将训 练好的 Faster RCNN模型确定为硬币年份识别模型。  [0097] Specifically, the terminal device uses each coin image as an input of a Faster RCNN model, and the name and coordinates of the four digits on the coin in each coin image are output of the Faster RCNN model to the pre-built Faster RCNN model. Train. After training the Faster RCNN model, the terminal device determines the trained Faster RCNN model as the coin year recognition model.
[0098] 其中, 硬币年份识别模型用于识别硬币的年份。  [0098] wherein the coin year identification model is used to identify the year of the coin.
[0099] 请一并参阅图 5, 图 5是本发明实施例提供的一种 Faster RCNN模型的结构示意 图。 如图 5所示, 在本发明一具体实施例中, Faster RCNN模型具体包括特征提 取网络、 区域提取网络 (Region proposal  [0099] Please refer to FIG. 5 together. FIG. 5 is a schematic structural diagram of a Faster RCNN model according to an embodiment of the present invention. As shown in FIG. 5, in a specific embodiment of the present invention, the Faster RCNN model specifically includes a feature extraction network and a region extraction network (Region proposal).
network, RPN) 及目标识别网络。 RPN的输入端端和目标识别网络的输入端均 与特征提取网络的输出端连接, 目标识别网络的输入端还与 PRN的输出端连接。  Network, RPN) and target identification network. The input end of the RPN and the input end of the target identification network are both connected to the output of the feature extraction network, and the input end of the target identification network is also connected to the output of the PRN.
[0100] 特征提取网络用于通过卷积核对输入的硬币图像中的所有像素点的像素值进行 卷积运算, 得到特征图, 并将特征图输出至 RPN和目标识别网络。 特征图的维度 远小于硬币图像的维度。  [0100] The feature extraction network is configured to perform a convolution operation on the pixel values of all the pixel points in the input coin image by the convolution kernel to obtain a feature map, and output the feature map to the RPN and the target recognition network. The dimensions of the feature map are much smaller than the dimensions of the coin image.
[0101] RPN用于根据特征图确定硬币图像中可能是年份数字所在的显示区域, 并将可 能是年份数字所在的显示区域作为候选区域输出至目标识别网络。 [0101] The RPN is configured to determine, according to the feature map, a display area in the coin image that may be a year number, and The display area where the year number is located is output as a candidate area to the target recognition network.
[0102] 目标识别网络用于根据特征提取网络输出的特征图, 从候选区域中选择硬币图 像中的硬币上的四位年份数字对应的目标区域, 并对年份数字所在区域中的年 份数字进行识别, 且输出四位年份数字的名称及对应的目标区域的坐标。  [0102] The target recognition network is configured to select a target region corresponding to the four-digit year number on the coin in the coin image from the candidate region according to the feature map output by the feature extraction network, and identify the year number in the region where the year number is located. And output the name of the four-digit year number and the coordinates of the corresponding target area.
[0103] 在实际应用中, 特征提取网络可以采用 VGG16网络。 目标识别网络具体可以是 基于区域的快速卷积神经网络 (Fast Region-based convolutional neural network, Fast RCNN) 。  [0103] In practical applications, the feature extraction network may adopt a VGG16 network. The target recognition network may specifically be a Fast Region-based Convolutional Neural Network (Fast RCNN).
[0104] 在本实施例中, 目标区域为矩形区域, 目标区域的坐标可以通过目标区域的预 设对角线的两个端点的坐标表示, 例如, 可以通过目标区域的左下角端点的坐 标和右上角端点的坐标表示。  [0104] In this embodiment, the target area is a rectangular area, and the coordinates of the target area may be represented by the coordinates of the two end points of the preset diagonal of the target area, for example, the coordinates of the end point of the lower left corner of the target area may be The coordinate representation of the endpoint in the upper right corner.
[0105] 在本实施例中, 具体的, RPN用于采用预设滑动窗口在特征图上逐步滑动。 滑 动步长可以根据实际需求设置, 此处不做限制。 预设滑动窗口在特征图上滑动 的每一位置都会映射出 k个不同尺寸或面积的原始图像区域。 例如, 假设预设滑 动窗口在特征图上对应 300个滑动位置, 则整幅特征图对应 300k个原始图像区域 。 在本实施例中, 每个原始图像区域对应的坐标是已知的, 由于原始图像区域 为矩形区域, 因此, 原始图像区域的坐标可以通过其四个角所在的端点位置的 坐标表示。 对于每个原始图像区域, RPN会计算该原始图像区域是无关区域或者 是年份数字所在区域的概率值, 即每个原始图像区域均对应两个概率值。 RPN根 据每个原始图像区域对应的两个概率值, 从所有原始图像区域中挑选出年份数 字所在区域的概率较大的 n个原始图像区域作为候选区域, 并将候选区域的坐标 输出至目标识别网络。  [0105] In this embodiment, specifically, the RPN is used to gradually slide on the feature map by using a preset sliding window. The sliding step size can be set according to actual needs, and there is no limit here. Each position where the preset sliding window slides on the feature map maps k original image areas of different sizes or areas. For example, assuming that the preset sliding window corresponds to 300 sliding positions on the feature map, the entire feature map corresponds to 300k original image regions. In the present embodiment, the coordinates corresponding to each of the original image regions are known. Since the original image region is a rectangular region, the coordinates of the original image region can be represented by the coordinates of the endpoint positions at which the four corners are located. For each original image area, the RPN calculates the probability value that the original image area is an unrelated area or the area where the year number is located, that is, each original image area corresponds to two probability values. Based on the two probability values corresponding to each original image region, the RPN selects n original image regions with a high probability of the region where the year number is located as the candidate region from all the original image regions, and outputs the coordinates of the candidate region to the target recognition. The internet.
[0106] 目标识别网络用于计算每个候选区域分别是数字 0~9中任一数字的概率值, 即 每一候选区域均对应 10个概率值, 分别是数字 0~9中任一数字的概率值。 也就是 说, 若候选区域的个数为 n, 则最终得到 10n个概率值, 数字 0~9中的每个数字对 应 n个概率值。 考虑到硬币上的年份数字是四位, 目标识别网络从每个数字对应 的 n个概率值中筛选概率值较高的 4个概率值, 即为 0~9中的每个数字分别筛选出 了 4个候选区域, 最终筛选出 40个候选区域。 目标识别网络再从筛选出的 40个候 选区域中确定概率值最高的 4个候选区域, 将概率值最高的 4个候选区域识别为 硬币上的四位年份数字各自对应的目标区域。 最后, 目标识别网络将这 4个目标 区域的坐标及对应的年份数字的名称进行输出。 [0106] The target recognition network is configured to calculate a probability value of each of the numbers 0 to 9 for each candidate region, that is, each candidate region corresponds to 10 probability values, which are any numbers of numbers 0-9. Probability value. That is to say, if the number of candidate regions is n, then 10n probability values are finally obtained, and each of the numbers 0-9 corresponds to n probability values. Considering that the year number on the coin is four digits, the target recognition network selects four probability values with higher probability values from the n probability values corresponding to each number, that is, each number in 0~9 is separately screened out. Four candidate regions, and finally 40 candidate regions were selected. The target recognition network further determines four candidate regions with the highest probability value from the selected 40 candidate regions, and identifies the four candidate regions with the highest probability value as The four-digit year number on the coin corresponds to the target area. Finally, the target recognition network outputs the coordinates of the four target areas and the names of the corresponding year numbers.
[0107] 在本发明一具体实施例中, 基于上述 Faster RCNN模型的具体结构, S02可以通 过如图 6所示的 S021~S025实现, 具体如下:  [0107] In a specific embodiment of the present invention, based on the specific structure of the Faster RCNN model, S02 can be implemented by S021~S025 as shown in FIG. 6, which is as follows:
[0108] S021: 根据预训练得到的特征提取模型的参数值对所述特征提取网络的参数值 进行初始化, 对所述区域提取网络的参数值进行随机初始化, 并采用初始化后 的所述特征提取网络和所述区域提取网络从每张所述硬币图像中提取候选区域  [0108] S021: Initialize parameter values of the feature extraction network according to parameter values of the feature extraction model obtained by pre-training, randomly initialize parameter values of the region extraction network, and adopt the feature extraction after initialization a network and the region extraction network extract candidate regions from each of the coin images
[0109] 在本实施例中, 终端获取预训练得到的特征提取模型, 并根据预训练得到的特 征提取模型的参数值对特征提取网络的参数进行初始化。 [0109] In this embodiment, the terminal acquires the feature extraction model obtained by the pre-training, and initializes the parameters of the feature extraction network according to the parameter values of the feature extraction model obtained by the pre-training.
[0110] 其中, 特征提取模型是基于 ImageNet训练得到的特征提取模型。 ImageNet是目 前世界上用于图像识别的最大图像数据库。  [0110] wherein the feature extraction model is a feature extraction model based on ImageNet training. ImageNet is the largest image database used for image recognition in the world.
[0111] 在实际应用中, 特征提取网络可以采用 VGG16网络。 请一并参阅表 2, 表 2示出 了本实施例提供的一种 VGG16网络的参数。  [0111] In practical applications, the feature extraction network may adopt a VGG16 network. Please refer to Table 2 together. Table 2 shows the parameters of a VGG16 network provided by this embodiment.
[0112] 其中, VGG16网络包括 13个卷积层、 4个池化层, 每层卷积核的大小和个数分 别如表 2所示。  [0112] The VGG16 network includes 13 convolution layers and 4 pooling layers. The size and number of convolution kernels in each layer are shown in Table 2.
[0113] 表 2  Table 2
[] []
\¥0 2019/127075 卩(:17 \2017/118891 \¥0 2019/127075 卩(:17 \2017/118891
[表 2] [Table 2]
Figure imgf000016_0001
Figure imgf000016_0001
[0114] 在本实施例中, 终端设备可以从网络上获取预训练得到的 0016模型的参数值 , 并采用预训练得到的 0016模型的参数值对 0016的参数值进行初始化。 其 中, 0016的参数值包括但不限于卷积核个数、 卷积核大小以及卷积核中各个 元素对应的值。  [0114] In this embodiment, the terminal device may obtain the parameter value of the pre-trained 0016 model from the network, and initialize the parameter value of 0016 by using the parameter value of the pre-trained 0016 model. Among them, the parameter values of 0016 include, but are not limited to, the number of convolution kernels, the size of the convolution kernel, and the values corresponding to the respective elements in the convolution kernel.
[0115] 同时, 终端设备对 RPN的参数值进行随机初始化。 对 RPN的参数值进行初始化 是指对 RPN中包含的每个卷积核中的各个元素的值进行初始化。 [0116] 在对区域提取网络中的特征提取网络的参数值以及 RPN的参数值进行初始化后 , 终端设备可以采用初始化后的特征提取网络和 RPN从每张硬币图像中提取候选 区域, 并将所提取出的候选区域的坐标输出至目标识别网络。 [0115] Meanwhile, the terminal device randomly initializes the parameter values of the RPN. Initializing the parameter value of the RPN means initializing the value of each element in each convolution kernel included in the RPN. After initializing the parameter value of the feature extraction network and the parameter value of the RPN in the area extraction network, the terminal device may extract the candidate area from each coin image by using the initialized feature extraction network and the RPN, and The coordinates of the extracted candidate regions are output to the target recognition network.
[0117] S022: 根据从每张所述硬币图像中提取出的候选区域以及每张所述硬币图像中 的硬币的年份数字信息对所述目标识别网络进行第一次训练。  [0117] S022: Perform the first training on the target recognition network according to the candidate region extracted from each of the coin images and the year digital information of the coins in each of the coin images.
[0118] 终端设备根据从每张硬币图像中提取出的候选区域以及每张硬币图像中的硬币 上的年份数字信息对目标识别网络进行第一次训练。  [0118] The terminal device performs the first training on the target recognition network based on the candidate region extracted from each coin image and the year digital information on the coin in each coin image.
[0119] 具体的, 终端设备将从每张硬币图像中提取出的候选区域的坐标作为目标识别 网络的输入, 将每张硬币图像中的硬币上的年份数字信息作为目标识别网络的 输出, 以对目标识别网络进行第一次训练。  [0119] Specifically, the terminal device uses the coordinates of the candidate region extracted from each coin image as the input of the target recognition network, and uses the year digital information on the coin in each coin image as the output of the target recognition network, The first training is performed on the target recognition network.
[0120] 在对目标识别网络进行第一次训练后, 得到目标识别网络的初始参数值。 其中 , 目标识别网络的初始参数值指目标识别网络中的卷积核中各个元素的初始参 数值。  [0120] After the first training of the target recognition network, an initial parameter value of the target recognition network is obtained. The initial parameter value of the target recognition network refers to the initial parameter value of each element in the convolution kernel in the target recognition network.
[0121] S023: 根据第一次训练后的所述目标识别网络的初始参数值对所述区域提取网 络的参数值进行更新, 并采用初始化后的所述特征提取网络和更新后的所述区 域提取网络再次从每张所述硬币图像中提取候选区域。  [0121] S023: Update parameter values of the area extraction network according to initial parameter values of the target identification network after the first training, and adopt the initialized feature extraction network and the updated area. The extraction network again extracts candidate regions from each of the coin images.
[0122] 终端设备根据第一次训练后的目标网络的初始参数值对 RPN的参数值进行更新 , 并采用更新后的区域提取网络再次从每张硬币图像中提取候选区域, 并将再 次提取出的候选区域的坐标输出至目标识别网络。  [0122] The terminal device updates the parameter value of the RPN according to the initial parameter value of the target network after the first training, and extracts the candidate region from each coin image again by using the updated region extraction network, and extracts the candidate region again. The coordinates of the candidate regions are output to the target recognition network.
[0123] S024: 根据再次从每张所述硬币图像中提取出的候选区域以及每张所述硬币图 像中的硬币的年份数字信息对所述目标识别网络进行第二次训练。  [0123] S024: Perform a second training on the target recognition network according to the candidate region extracted from each of the coin images and the year digital information of the coins in each of the coin images.
[0124] 终端设备根据再次从每张硬币图像中提取出的候选区域以及每张硬币图像中的 硬币上的年份数字信息对经第一次训练后的目标识别网络进行第二次训练。 具 体的, 终端设备将再次从每张硬币图像中提取出的候选区域的坐标作为目标识 别网络的输入, 将每张硬币图像中的硬币上的年份数字信息作为目标识别网络 的输出, 以对目标识别网络进行第二次训练。  [0124] The terminal device performs the second training on the target recognition network after the first training based on the candidate region extracted from each coin image and the year digital information on the coin in each coin image. Specifically, the terminal device will again use the coordinates of the candidate region extracted from each coin image as the input of the target recognition network, and use the year digital information on the coin in each coin image as the output of the target recognition network to target the target. Identify the network for a second training session.
[0125] 在对目标识别网络进行第二次训练后, 得到目标识别网络的最终参数值。 其中 , 目标识别网络的最终参数值指目标识别网络中的卷积核中各个元素的最终参 \¥0 2019/127075 卩(:17 \2017/118891 数值。 [0125] After the second training of the target recognition network, the final parameter value of the target recognition network is obtained. Wherein, the final parameter value of the target recognition network refers to the final parameter of each element in the convolution kernel in the target recognition network. \¥0 2019/127075 卩(:17 \2017/118891 value.
[0126] 8025: 将由初始化后的所述特征提取网络、 更新后的所述区域提取网络以及第 二次训练后的所述目标识别网络组成的所述FaSter RCNN模型识别为硬币年份识 别模型。 [0126] 8025: Identify, by the initialized feature extraction network, the updated region extraction network, and the target training network after the second training, the Fa S t er RCNN model as a coin year identification. model.
[0127] 终端设备更新后的区域提取网络以及经第二次训练后的目标识别网络组成的 8^3· RCNN模型确定为硬币年份识别模型, 并将硬币年份识别模型进行存储。 当 需要对硬币的年份进行识别时, 终端调用该硬币年份识别模型。  [0127] The 8^3· RCNN model composed of the updated area extraction network of the terminal device and the target recognition network after the second training is determined as a coin year recognition model, and the coin year identification model is stored. When the year of the coin needs to be identified, the terminal calls the coin year identification model.
[0128] 需要说明的是, 当终端首次接收到硬币年份识别指令时, 才执行上述训练硬币 年份模型的步骤, 即301~302。 当终端非首次接收到硬币年份识别指令时, 不再 执行训练硬币年份模型的步骤, 直接执行311~313。  [0128] It should be noted that, when the terminal receives the coin year identification instruction for the first time, the steps of training the coin year model, that is, 301 to 302, are executed. When the terminal does not receive the coin year identification command for the first time, the steps of training the coin year model are not executed, and 311~313 are directly executed.
[0129] 以上可以看出, 本实施例提供的一种识别硬币年份的方法通过预先构建
Figure imgf000018_0001
[0129] As can be seen from the above, the method for identifying the year of the coin provided by the embodiment is pre-built.
Figure imgf000018_0001
RCNN模型, 并采用由多组硬币图像及硬币年份数字信息构成的训练样本集对?&
Figure imgf000018_0002
型进行训练, 进而得到硬币年份识别模型。 由于 FaSter RCNN模型对 目标的检测及定位速率较快, 准确率较高, 因此采用对 FaSter RCNN模型进行训 练得到的硬币年份模型来对硬币的年份进行识别, 不仅提高了硬币年份识别的 效率, 而且提高了硬币年份识别的准确率。 且由于训练样本集中包含的多张硬 币图像中硬币的位置及姿态是随机的, 因而基于该训练样本集训练出的硬币年 份识别模型能够对各种不同规格的硬币图像中的硬币的年份进行有效识别。
RCNN model, and using training set of images by groups of coins and coin Year of digital information constituted? &
Figure imgf000018_0002
The type is trained to obtain a coin year recognition model. Because the Fa S t er RCNN model detects and locates the target faster and has higher accuracy, the coin year model obtained by training the Fa S er RCNN model is used to identify the year of the coin, which not only improves the coin. The efficiency of the year identification, and the accuracy of the coin year identification. And since the positions and postures of the coins in the plurality of coin images included in the training sample set are random, the coin year recognition model trained based on the training sample set can be effective for the years of the coins in the coin images of different specifications. Identification.
[0130] 请参阅图 7 , 图 7是本发明实施例提供的一种终端设备的结构示意图。 终端设备 700可以为智能手机、 平板电脑等移动终端设备, 还可以为其他终端设备, 此处 不做限制。 本实施例的终端设备 700包括的各单元用于执行图 1对应的实施例中 的各步骤, 具体请参阅图 1以及图 1对应的实施例中的相关描述, 此处不赘述。 如图 7所示, 本实施例的终端设备 700包括第一获取单元 71、 模型调用单元 72及 年份确定单元 73。  [0130] Please refer to FIG. 7. FIG. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present invention. The terminal device 700 can be a mobile terminal device such as a smart phone or a tablet computer, and can also be other terminal devices, and is not limited herein. Each unit included in the terminal device 700 of this embodiment is used to perform the steps in the embodiment corresponding to FIG. 1. For details, refer to the related description in the embodiment corresponding to FIG. 1 and FIG. 1 , and details are not described herein. As shown in FIG. 7, the terminal device 700 of this embodiment includes a first obtaining unit 71, a model calling unit 72, and a year determining unit 73.
[0131] 第一获取单元 71用于获取待识别的目标硬币图像。  [0131] The first acquisition unit 71 is configured to acquire a target coin image to be identified.
[0132] 模型调用单元 72用于将所述目标硬币图像输入至训练好的硬币年份识别模型。  [0132] The model invoking unit 72 is configured to input the target coin image to the trained coin year recognition model.
[0133] 年份确定单元 73用于根据所述硬币年份识别模型输出的年份数字信息确定所述 目标硬币图像中的硬币的年份; 其中, 所述年份数字信息用于表征硬币的年份 \¥0 2019/127075 卩(:17 \2017/118891 [0133] The year determining unit 73 is configured to determine a year of the coin in the target coin image according to the year number information output by the coin year identification model; wherein the year number information is used to represent the year of the coin \¥0 2019/127075 卩(:17 \2017/118891
[0134] 可选的, 在本发明一具体实施例中, 所述年份数字信息包括所述目标硬币图像 中的硬币上的四位年份数字的名称及坐标; 年份确定单元 73具体用于: 根据所 述目标硬币图像中的硬币上的四位年份数字的坐标以及预设排序策略对所述四 位年份数字进行排序, 得到所述硬币的年份。 [0134] Optionally, in a specific embodiment of the present invention, the year digital information includes a name and a coordinate of a four-digit year number on the coin in the target coin image; the year determining unit 73 is specifically configured to: The coordinates of the four-digit year number on the coin in the target coin image and the preset sorting strategy sort the four-digit year number to obtain the year of the coin.
[0135] 可选的, 在本发明一具体实施例中, 年份确定单元 73具体用于:  [0135] Optionally, in a specific embodiment of the present invention, the year determining unit 73 is specifically configured to:
[0136] 采用背景差分法对所述目标硬币图像进行处理, 得到所述目标硬币图像中的硬 币所在的圆形显示区域, 确定所述圆形显示区域的中心点的坐标;  [0136] processing the target coin image by using a background difference method to obtain a circular display area where the coin in the target coin image is located, and determining coordinates of a center point of the circular display area;
[0137] 根据所述圆形显示区域的中心点的坐标以及所述硬币上的四位年份数字的坐标 , 确定所述四位年份数字在所述圆形显示区域中的位置;  [0137] determining a position of the four-digit year number in the circular display area according to coordinates of a center point of the circular display area and coordinates of four-digit year numbers on the coin;
[0138] 若所述四位年份数字均位于所述圆形显示区域的下半部分, 则按照第一预设顺 序对所述四位年份数字进行排序, 得到所述硬币的年份;  [0138] if the four digits are located in the lower half of the circular display area, the four digits are sorted according to the first preset order to obtain the year of the coin;
[0139] 若所述四位年份数字均位于所述圆形显示区域的上半部分, 则按照第二预设顺 序对所述四位年份数字进行排序, 得到所述硬币的年份;  [0139] if the four digits are located in the upper half of the circular display area, the four digits are sorted according to a second preset order to obtain a year of the coin;
[0140] 若所述四位年份数字均位于所述圆形显示区域的右半部分, 则按照第三预设顺 序对所述四位年份数字进行排序, 得到所述硬币的年份;  [0140] if the four digits are located in the right half of the circular display area, the four digits are sorted according to a third preset order to obtain the year of the coin;
[0141] 若所述四位年份数字均位于所述圆形显示区域的左半部分, 则按照第四预设顺 序对所述四位年份数字进行排序, 得到所述硬币的年份。  [0141] If the four digits are located in the left half of the circular display area, the four digits are sorted according to a fourth preset order to obtain the year of the coin.
[0142] 以上可以看出, 本实施例提供的一种终端设备通过获取待识别的目标硬币图像 ; 将所述目标硬币图像输入至训练好的硬币年份识别模型; 根据所述硬币年份 识别模型输出的年份数字信息确定所述目标硬币图像中的硬币的年份。 由于通 过预先训练好的硬币年份识别模型对待识别的硬币的年份进行识别, 从而无需 人工根据硬币的年份对硬币进行分类, 不仅提高了硬币回收的效率, 而且节省 了人工成本。  [0142] It can be seen that the terminal device provided by the embodiment obtains the target coin image to be identified; the target coin image is input to the trained coin year recognition model; and the model is output according to the coin year identification model. The year number information determines the year of the coin in the target coin image. Since the year of the coin to be identified is recognized by the pre-trained coin year recognition model, it is not necessary to manually classify the coin according to the year of the coin, which not only improves the efficiency of coin recovery but also saves labor costs.
[0143] 请参阅图 8 , 图 8是本发明另一实施例提供的一种终端设备的结构示意图。 本实 施例的终端设备 700包括的各单元用于执行图 3对应的实施例中的各步骤, 具体 请参阅图 3以及图 3对应的实施例中的相关描述, 此处不赘述。 如图 8所示, 相对 于图 7对应的实施例, 本实施例中的终端设备 700还包括第二获取单元 74、 模型 \¥0 2019/127075 卩(:17 \2017/118891 训练单元 75。 Referring to FIG. 8, FIG. 8 is a schematic structural diagram of a terminal device according to another embodiment of the present invention. Each unit included in the terminal device 700 of this embodiment is used to perform the steps in the embodiment corresponding to FIG. 3. For details, refer to the related description in the embodiment corresponding to FIG. 3 and FIG. 3, and details are not described herein. As shown in FIG. 8, the terminal device 700 in this embodiment further includes a second acquiring unit 74 and a model, with respect to the embodiment corresponding to FIG. \¥0 2019/127075 卩(:17 \2017/118891 Training unit 75.
[0144] 第二获取单元 74用于获取训练样本集; 其中, 所述训练样本集中的每组样本数 据均由硬币图像以及所述硬币图像中的硬币的年份数字信息构成, 所述硬币的 年份数字信息包括所述硬币上的四位年份数字的名称及坐标。  [0144] The second obtaining unit 74 is configured to acquire a training sample set; wherein each set of sample data in the training sample set is composed of a coin image and year digital information of coins in the coin image, the year of the coin The digital information includes the name and coordinates of the four digits of the year on the coin.
[0145] 模型训练单元 75用于采用所述训练样本集对预先构建的基于区域的快速卷积神 经网络
Figure imgf000020_0001
RCNN模型进行训练, 将训练好的所述
Figure imgf000020_0002
RCNN模型确定为硬币 年份识别模型; 其中, 所述硬币年份识别模型用于识别硬币的年份。
[0145] The model training unit 75 is configured to adopt the training sample set pair to construct a pre-constructed region-based fast convolutional neural network
Figure imgf000020_0001
RCNN model is trained, will be trained
Figure imgf000020_0002
The RCNN model is determined to be a coin year identification model; wherein the coin year identification model is used to identify the year of the coin.
[0146] 可选的, 在本发明一具体实施例中, 第二获取单元 74具体包括图像获取单元 74 1、 坐标标定单元 742、 数字坐标确定单元 743、 数字名称确定单元 744、 样本集 确定单元 745。  [0146] Optionally, in a specific embodiment of the present invention, the second obtaining unit 74 specifically includes an image obtaining unit 74 1 , a coordinate calibration unit 742 , a digital coordinate determining unit 743 , a digital name determining unit 744 , and a sample set determining unit. 745.
[0147] 图像获取单元 741用于获取用于训练模型的硬币图像。  [0147] The image acquisition unit 741 is for acquiring a coin image for training the model.
[0148] 坐标标定单元 742用于确定用户在每张所述硬币图像中的硬币上框选出的四个 矩形区域的坐标; 其中, 所述矩形区域用于表征所述硬币上的年份数字所占的 显示区域。  [0148] The coordinate calibration unit 742 is configured to determine coordinates of four rectangular regions selected by the user on the coin in each of the coin images; wherein the rectangular region is used to represent the year number on the coin Occupied display area.
[0149] 数字坐标确定单元 743用于将所述硬币图像中的四个矩形区域的坐标分别确定 为所述硬币图像中的硬币上的四位年份数字的坐标。  [0149] The digital coordinate determining unit 743 is for determining the coordinates of the four rectangular regions in the coin image as the coordinates of the four-digit year number on the coin in the coin image, respectively.
[0150] 数字名称确定单元 744用于确定每张所述硬币图像中的硬币上的四位年份数字 的名称。  [0150] The number name determining unit 744 is for determining the name of the four-digit year number on the coin in each of the coin images.
[0151] 样本集确定单元 745用于将每张所述硬币图像、 每张所述硬币图像中的硬币上 的年份数字的名称及坐标进行关联存储, 得到训练样本集。  The sample set determining unit 745 is configured to store the name and the coordinates of the year number on each of the coin images and the coins in each of the coin images to obtain a training sample set.
[0152] 可选的, 在本发明一具体实施例中, 坐标标定单元 742具体包括区域获取单元 和区域坐标确定单元。  Optionally, in a specific embodiment of the present invention, the coordinate calibration unit 742 specifically includes a region obtaining unit and a region coordinate determining unit.
[0153] 区域获取单元用于获取用户在每张所述硬币图像中的硬币上框选出的四个矩形 区域。  [0153] The area obtaining unit is configured to acquire four rectangular areas selected by the user on the coins in each of the coin images.
[0154] 区域坐标确定单元用于根据预设的坐标标定策略, 确定每个所述矩形区域的预 设对角线的两个端点的坐标, 将每个所述矩形区域的预设对角线的两个端点的 坐标确定为所述矩形区域的坐标。  [0154] The area coordinate determining unit is configured to determine coordinates of two end points of the preset diagonal of each of the rectangular areas according to a preset coordinate calibration strategy, and preset a diagonal of each of the rectangular areas The coordinates of the two endpoints are determined as the coordinates of the rectangular region.
[0155] 可选的, 在本发明一具体实施例中, 所述 Faster RCNN模型包括特征提取网络 \¥0 2019/127075 卩(:17 \2017/118891 [0155] Optionally, in a specific embodiment of the present invention, the Faster RCNN model includes a feature extraction network \¥0 2019/127075 卩(:17 \2017/118891
、 区域提取网络及目标识别网络; 所述区域提取网络的输入端和所述目标识别 网络的输入端均与所述特征提取网络的输出端连接, 所述目标识别网络的输入 端还与所述区域提取网络的输出端连接; 模型训练单元 75具体包括: 参数初始 化单元 751、 第一训练单元 752、 参数更新单元 753、 第二训练单元 754及模型确 定单元 755。 And an area extraction network and a target identification network; an input end of the area extraction network and an input end of the target identification network are both connected to an output end of the feature extraction network, and an input end of the target identification network is further The output of the area extraction network is connected. The model training unit 75 specifically includes: a parameter initialization unit 751, a first training unit 752, a parameter update unit 753, a second training unit 754, and a model determination unit 755.
[0156] 参数初始化单元 751用于根据预训练得到的特征提取模型的参数值对所述特征 提取网络的参数值进行初始化, 对所述区域提取网络的参数值进行随机初始化 , 并采用初始化后的所述特征提取网络和所述区域提取网络从每张所述硬币图 像中提取候选区域。  [0156] The parameter initialization unit 751 is configured to initialize a parameter value of the feature extraction network according to a parameter value of the feature extraction model obtained by pre-training, randomly initialize a parameter value of the region extraction network, and adopt an initialized The feature extraction network and the region extraction network extract candidate regions from each of the coin images.
[0157] 第一训练单元 752用于根据从每张所述硬币图像中提取出的候选区域以及每张 所述硬币图像中的硬币的年份数字信息对所述目标识别网络进行第一次训练。  [0157] The first training unit 752 is configured to perform the first training on the target recognition network based on the candidate regions extracted from each of the coin images and the year digital information of the coins in each of the coin images.
[0158] 参数更新单元 753用于根据第一次训练后的所述目标识别网络的初始参数值对 所述区域提取网络的参数值进行更新, 并采用初始化后的所述特征提取网络和 更新后的所述区域提取网络再次从每张所述硬币图像中提取候选区域。  [0158] The parameter updating unit 753 is configured to update the parameter value of the area extraction network according to the initial parameter value of the target identification network after the first training, and adopt the initialized feature extraction network and the updated The region extraction network again extracts candidate regions from each of the coin images.
[0159] 第二训练单元 754用于根据再次从每张所述硬币图像中提取出的候选区域以及 每张所述硬币图像中的硬币的年份数字信息对所述目标识别网络进行第二次训 练。  [0159] The second training unit 754 is configured to perform the second training on the target recognition network according to the candidate region extracted from each of the coin images and the year digital information of the coins in each of the coin images. .
[0160] 模型确定单元 755用于将由初始化后的所述特征提取网络、 更新后的所述区域 提取网络以及第二次训练后的所述目标识别网络组成的所述 FaSter RCNN模型识 别为硬币年份识别模型。 [0160] The model determining unit 755 is configured to identify the Fa S t er RCNN model composed of the initialized feature extraction network, the updated region extraction network, and the target training network after the second training. Identify the model for the coin year.
[0161] 以上可以看出, 本实施例提供的一种终端设备通过预先构建
Figure imgf000021_0001
RCNN模型
[0161] As can be seen from the above, a terminal device provided by this embodiment is pre-built
Figure imgf000021_0001
RCNN model
, 并采用由多组硬币图像及硬币年份数字信息构成的训练样本集对
Figure imgf000021_0002
RCNN 模型进行训练, 进而得到硬币年份识别模型。
Figure imgf000021_0003
目标的检 测及定位速率较快, 准确率较高, 因此采用对 FaSter RCNN模型进行训练得到的 硬币年份模型来对硬币的年份进行识别, 不仅提高了硬币年份识别的效率, 而 且提高了硬币年份识别的准确率。 且由于训练样本集中包含的多张硬币图像中 硬币的位置及姿态是随机的, 因而基于该训练样本集训练出的硬币年份识别模 型能够对各种不同规格的硬币图像中的硬币的年份进行有效识别。 [0162] 图 9是本发明再一实施例提供的终端设备的示意图。 如图 9所示, 该实施例的终 端设备 900包括: 处理器 90、 存储器 91以及存储在所述存储器 91中并可在所述处 理器 90上运行的计算机程序 92。 所述处理器 90执行所述计算机程序 92时实现上 述各个方法实施例中的步骤, 例如图 1所示的 S 11至 S 13。 或者, 所述处理器 90执 行所述计算机程序 92时实现上述各终端设备实施例中各单元 /单元的功能, 例如 图 7所示单元 71至 73的功能。
And using a training sample set consisting of multiple sets of coin images and coin year digital information
Figure imgf000021_0002
The RCNN model is trained to obtain a coin year recognition model.
Figure imgf000021_0003
The target detection and positioning rate is faster and the accuracy is higher. Therefore, the coin year model obtained by training the Fa S t er RCNN model is used to identify the year of the coin, which not only improves the efficiency of the coin year recognition, but also improves the efficiency. The accuracy of the coin year identification. And since the positions and postures of the coins in the plurality of coin images included in the training sample set are random, the coin year recognition model trained based on the training sample set can be effective for the years of the coins in the coin images of different specifications. Identification. 9 is a schematic diagram of a terminal device according to still another embodiment of the present invention. As shown in FIG. 9, the terminal device 900 of this embodiment includes: a processor 90, a memory 91, and a computer program 92 stored in the memory 91 and operable on the processor 90. The processor 90, when executing the computer program 92, implements the steps in the various method embodiments described above, such as S11 through S13 shown in FIG. Alternatively, when the processor 90 executes the computer program 92, the functions of the units/units in the above-described respective terminal device embodiments are implemented, for example, the functions of the units 71 to 73 shown in FIG.
[0163] 示例性的, 所述计算机程序 92可以被分割成一个或多个单元 /单元, 所述一个 或者多个单元 /单元被存储在所述存储器 91中, 并由所述处理器 90执行, 以完成 本发明。 所述一个或多个单元 /单元可以是能够完成特定功能的一系列计算机程 序指令段, 该指令段用于描述所述计算机程序 92在所述终端设备中的执行过程 。 例如, 所述计算机程序 92可以被分割成第一获取单元、 模型调用单元及年份 确定单元, 各单元具体功能如下: [0163] Illustratively, the computer program 92 may be partitioned into one or more units/units, which are stored in the memory 91 and executed by the processor 90. To complete the present invention. The one or more units/units may be a series of computer program instruction segments capable of performing a particular function, the instruction segments being used to describe the execution of the computer program 92 in the terminal device. For example, the computer program 92 can be divided into a first obtaining unit, a model calling unit, and a year determining unit, and the specific functions of each unit are as follows:
[0164] 第一获取单元用于获取待识别的目标硬币图像。  [0164] The first acquisition unit is configured to acquire a target coin image to be identified.
[0165] 模型调用单元用于将所述目标硬币图像输入至训练好的硬币年份识别模型。  [0165] The model calling unit is configured to input the target coin image to the trained coin year recognition model.
[0166] 年份确定单元用于根据所述硬币年份识别模型输出的年份数字信息确定所述目 标硬币图像中的硬币的年份; 其中, 所述年份数字信息用于表征硬币的年份。  [0166] The year determining unit is configured to determine a year of the coin in the target coin image according to the year number information output by the coin year identification model; wherein the year number information is used to represent the year of the coin.
[0167] 终端设备 900可以是桌上型计算机、 笔记本、 掌上电脑及云端服务器等计算设 备。 所述终端设备 900可包括, 但不仅限于, 处理器 90、 存储器 91。 本领域技术 人员可以理解, 图 9仅仅是终端设备的示例, 并不构成对终端设备 900的限定, 可以包括比图示更多或更少的部件, 或者组合某些部件, 或者不同的部件, 例 如所述终端设备还可以包括输入输出设备、 网络接入设备、 总线等。  [0167] The terminal device 900 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The terminal device 900 can include, but is not limited to, a processor 90, a memory 91. It will be understood by those skilled in the art that FIG. 9 is merely an example of a terminal device, and does not constitute a limitation on the terminal device 900, and may include more or less components than those illustrated, or combine some components, or different components. For example, the terminal device may further include an input/output device, a network access device, a bus, and the like.
[0168] 所称处理器 90可以是中央处理单元 (Central Processing Unit, CPU) , 还可以是其 他通用处理器、 数字信号处理器 (Digital Signal Processor, DSP)、 专用集成电路 (Application Specific Integrated Circuit, ASIC)、 现成可编程门阵列  The processor 90 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-to-use programmable gate array
(Field-Programmable Gate Array, FPGA)或者其他可编程逻辑器件、 分立门或者 晶体管逻辑器件、 分立硬件组件等。 通用处理器可以是微处理器或者该处理器 也可以是任何常规的处理器等。  (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
[0169] 所述存储器 91可以是所述终端设备的内部存储单元, 例如终端设备的硬盘或内 存。 所述存储器 91也可以是所述终端设备的外部存储设备, 例如所述终端设备 上配备的插接式硬盘, 智能存储卡 (Smart Media [0169] The memory 91 may be an internal storage unit of the terminal device, such as a hard disk or a terminal of the terminal device. Save. The memory 91 may also be an external storage device of the terminal device, for example, a plug-in hard disk provided on the terminal device, and an intelligent memory card (Smart Media)
Card, SMC) , 安全数字 (Secure Digital, SD) 卡, 闪存卡 (Flash Card) 等。 进一步地, 所述存储器 91还可以既包括所述终端设备的内部存储单元也包括外 部存储设备。 所述存储器 91用于存储所述计算机程序以及所述终端设备所需的 其他程序和数据。 所述存储器 91还可以用于暂时地存储已经输出或者将要输出 的数据。  Card, SMC), Secure Digital (SD) card, Flash Card, etc. Further, the memory 91 may also include both an internal storage unit of the terminal device and an external storage device. The memory 91 is used to store the computer program and other programs and data required by the terminal device. The memory 91 can also be used to temporarily store data that has been output or is about to be output.
[0170] 所属领域的技术人员可以清楚地了解到, 为了描述的方便和简洁, 仅以上述各 功能单元、 单元的划分进行举例说明, 实际应用中, 可以根据需要而将上述功 能分配由不同的功能单元、 单元完成, 即将所述终端设备的内部结构划分成不 同的功能单元或单元, 以完成以上描述的全部或者部分功能。 实施例中的各功 能单元、 单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一个单元中, 上述集成的单元既可以采用硬 件的形式实现, 也可以采用软件功能单元的形式实现。 另外, 各功能单元、 单 元的具体名称也只是为了便于相互区分, 并不用于限制本申请的保护范围。 上 述系统中单元、 单元的具体工作过程, 可以参考前述方法实施例中的对应过程 , 在此不再赘述。  [0170] It will be clearly understood by those skilled in the art that, for convenience and brevity of description, only the division of each functional unit and unit described above is exemplified. In practical applications, the above functions may be assigned differently according to needs. The functional unit and the unit are completed, that is, the internal structure of the terminal device is divided into different functional units or units to complete all or part of the functions described above. Each functional unit and unit in the embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the integrated unit may be implemented by hardware. Formal implementation can also be implemented in the form of software functional units. In addition, the specific names of the functional units and units are only for the purpose of distinguishing from each other, and are not intended to limit the scope of protection of the present application. For the specific working process of the unit and the unit in the above system, refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
[0171] 在上述实施例中, 对各个实施例的描述都各有侧重, 某个实施例中没有详述或 记载的部分, 可以参见其它实施例的相关描述。  [0171] In the above embodiments, the descriptions of the various embodiments are all focused, and the parts that are not detailed or described in the specific embodiments may be referred to the related descriptions of other embodiments.
[0172] 本领域普通技术人员可以意识到, 结合本文中所公开的实施例描述的各示例的 单元及算法步骤, 能够以电子硬件、 或者计算机软件和电子硬件的结合来实现 。 这些功能究竟以硬件还是软件方式来执行, 取决于技术方案的特定应用和设 计约束条件。 专业技术人员可以对每个特定的应用来使用不同方法来实现所描 述的功能, 但是这种实现不应认为超出本发明的范围。  [0172] Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
[0173] 在本发明所提供的实施例中, 应该理解到, 所揭露的终端设备 /系统和方法, 可以通过其它的方式实现。 例如, 以上所描述的终端设备 /系统实施例仅仅是示 意性的, 例如, 所述单元或单元的划分, 仅仅为一种逻辑功能划分, 实际实现 时可以有另外的划分方式, 例如多个单元或组件可以结合或者可以集成到另一 个系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间 的耦合或直接耦合或通讯连接可以是通过一些接口, 终端设备或单元的间接耦 合或通讯连接, 可以是电性, 机械或其它的形式。 [0173] In the embodiments provided by the present invention, it should be understood that the disclosed terminal devices/systems and methods may be implemented in other manners. For example, the terminal device/system embodiment described above is only illustrative. For example, the division of the unit or unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units. Or components can be combined or can be integrated into another Systems, or some features can be ignored, or not executed. Alternatively, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, terminal device or unit, and may be in electrical, mechanical or other form.
[0174] 所述作为分离部件说明的单元可以是或者也可以不是物理上分开的, 作为单元 显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可 以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或者全部单元 来实现本实施例方案的目的。  [0174] The units described as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place, or may be distributed to multiple networks. On the unit. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
[0175] 另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可 以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一个单元中。 上述集成的单元既可以采用硬件的形式实现, 也可以采用软件功能单元的形式 实现。  [0175] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0176] 所述集成的单元 /单元如果以软件功能单元的形式实现并作为独立的产品销售 或使用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发 明实现上述实施例方法中的全部或部分流程, 也可以通过计算机程序来指令相 关的硬件来完成, 所述的计算机程序可存储于一计算机可读存储介质中, 该计 算机程序在被处理器执行时, 可实现上述各个方法实施例的步骤。 其中, 所述 计算机程序包括计算机程序代码, 所述计算机程序代码可以为源代码形式、 对 象代码形式、 可执行文件或某些中间形式等。 所述计算机可读介质可以包括: 能够携带所述计算机程序代码的任何实体或终端设备、 记录介质、 U盘、 移动硬 盘、 磁碟、 光盘、 计算机存储器、 只读存储器 (Read-Only Memory, ROM) 、 随机存取存储器 (Random Access Memory , RAM) 、 电载波信号、 电信信号以 及软件分发介质等。 需要说明的是, 所述计算机可读介质包含的内容可以根据 司法管辖区内立法和专利实践的要求进行适当的增减, 例如在某些司法管辖区 , 根据立法和专利实践, 计算机可读介质不包括是电载波信号和电信信号。  [0176] The integrated unit/unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the present invention implements all or part of the processes in the foregoing embodiments, and may also be completed by a computer program to instruct related hardware. The computer program may be stored in a computer readable storage medium. The steps of the various method embodiments described above may be implemented when the program is executed by the processor. The computer program includes computer program code, and the computer program code may be in the form of a source code, an object code, an executable file, or some intermediate form. The computer readable medium may include: any entity or terminal device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read only memory (Read-Only Memory, ROM) ), Random Access Memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable media It does not include electrical carrier signals and telecommunication signals.
[0177] 以上所述实施例仅用以说明本发明的技术方案, 而非对其限制; 尽管参照前述 实施例对本发明进行了详细的说明, 本领域的普通技术人员应当理解: 其依然 可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分技术特征进 行等同替换; 而这些修改或者替换, 并不使相应技术方案的本质脱离本发明各 \¥0 2019/127075 ?€1^2017/118891 实施例技术方案的精神和范围, 均应包含在本发明的保护范围之内。 The above-described embodiments are only for explaining the technical solutions of the present invention, and are not intended to be limiting thereof; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently replaced; and the modifications or substitutions do not deviate from the essence of the corresponding technical solutions. \¥0 2019/127075 ?€1^2017/118891 The spirit and scope of the embodiments of the present invention are all included in the scope of protection of the present invention.

Claims

\¥0 2019/127075 卩(:17 \2017/118891 权利要求书 \¥0 2019/127075 卩(:17 \2017/118891 Claims
[权利要求 1] 一种识别硬币年份的方法, 其特征在于, 包括:  [Claim 1] A method for identifying a year of a coin, comprising:
获取待识别的目标硬币图像;  Obtaining a target coin image to be identified;
将所述目标硬币图像输入至训练好的硬币年份识别模型;  Inputting the target coin image into the trained coin year recognition model;
根据所述硬币年份识别模型输出的年份数字信息确定所述目标硬币图 像中的硬币的年份; 其中, 所述年份数字信息用于表征硬币的年份。  Determining a year of the coin in the target coin image based on the year number information output by the coin year identification model; wherein the year number information is used to characterize the year of the coin.
[权利要求 2] 根据权利要求 1所述的方法, 其特征在于, 所述年份数字信息包括所 述目标硬币图像中的硬币上的四位年份数字的名称及坐标; 所述根据所述硬币年份识别模型输出的年份数字信息确定所述目标硬 币图像中的硬币的年份, 包括:  [Claim 2] The method according to claim 1, wherein the year number information includes a name and a coordinate of a four-digit year number on a coin in the target coin image; The year number information of the recognition model output determines the year of the coin in the target coin image, including:
根据所述目标硬币图像中的硬币上的四位年份数字的坐标以及预设排 序策略对所述四位年份数字进行排序, 得到所述硬币的年份。  The four-digit year number is sorted according to the coordinates of the four-digit year number on the coin in the target coin image and the preset sorting strategy to obtain the year of the coin.
[权利要求 3] 根据权利要求 2所述的方法, 其特征在于, 所述根据所述目标硬币图 像中的硬币上的四位年份数字的坐标以及预设排序策略对所述四位年 份数字进行排序, 得到所述硬币的年份, 包括: 采用背景差分法对所述目标硬币图像进行处理, 得到所述目标硬币图 像中的硬币所在的圆形显示区域, 确定所述圆形显示区域的中心点的 坐标;  [Claim 3] The method according to claim 2, wherein the four-digit year number is performed according to coordinates of a four-digit year number on a coin in the target coin image and a preset sorting strategy Sorting, obtaining the year of the coin, comprising: processing the target coin image by using a background difference method, obtaining a circular display area where the coin in the target coin image is located, determining a center point of the circular display area coordinate of;
根据所述圆形显示区域的中心点的坐标以及所述硬币上的四位年份数 字的坐标, 确定所述四位年份数字在所述圆形显示区域中的位置; 若所述四位年份数字均位于所述圆形显示区域的下半部分, 则按照第 一预设顺序对所述四位年份数字进行排序, 得到所述硬币的年份; 若所述四位年份数字均位于所述圆形显示区域的上半部分, 则按照第 二预设顺序对所述四位年份数字进行排序, 得到所述硬币的年份; 若所述四位年份数字均位于所述圆形显示区域的右半部分, 则按照第 三预设顺序对所述四位年份数字进行排序, 得到所述硬币的年份; 若所述四位年份数字均位于所述圆形显示区域的左半部分, 则按照第 四预设顺序对所述四位年份数字进行排序, 得到所述硬币的年份。 \¥0 2019/127075 卩(:17 \2017/118891 Determining a position of the four-digit year number in the circular display area according to coordinates of a center point of the circular display area and coordinates of four-digit year numbers on the coin; if the four-digit year number All located in the lower half of the circular display area, the four year digits are sorted according to a first preset order to obtain the year of the coin; if the four digits are located in the circle Displaying the upper half of the area, then sorting the four digits in the second preset order to obtain the year of the coin; if the four digits are located in the right half of the circular display area And sorting the four-digit year number according to a third preset order to obtain a year of the coin; if the four-digit year number is located in the left half of the circular display area, according to the fourth pre- The four year digits are sorted in order to obtain the year of the coin. \¥0 2019/127075 卩(:17 \2017/118891
[权利要求 4] 根据权利要求 1所述的方法, 其特征在于, 所述获取待识别的目标硬 币图像之前, 还包括: [Claim 4] The method according to claim 1, wherein before the acquiring the target coin image to be identified, the method further includes:
获取训练样本集; 其中, 所述训练样本集中的每组样本数据均由硬币 图像以及所述硬币图像中的硬币的年份数字信息构成, 所述硬币的年 份数字信息包括所述硬币上的四位年份数字的名称及坐标; 采用所述训练样本集对预先构建的基于区域的快速卷积神经网络?&81 61 RCNN模型进行训练, 将训练好的所述
Figure imgf000027_0001
RCNN模型确定为硬 币年份识别模型; 其中, 所述硬币年份识别模型用于识别硬币的年份
Obtaining a training sample set; wherein each set of sample data in the training sample set is composed of a coin image and year digital information of coins in the coin image, and the year digital information of the coin includes four digits on the coin The name and coordinates of the year number; using the training sample set to train the pre-built region-based fast convolutional neural network & 81 61 RCNN model, which will be trained
Figure imgf000027_0001
The RCNN model is determined as a coin year identification model; wherein the coin year recognition model is used to identify the year of the coin
[权利要求 5] 根据权利要求 4所述的方法, 其特征在于, 所述获取训练样本集, 包 括: [Claim 5] The method according to claim 4, wherein the acquiring a training sample set comprises:
获取用于训练模型的硬币图像;  Obtaining a coin image for training the model;
确定用户在每张所述硬币图像中的硬币上框选出的四个矩形区域的坐 标; 其中, 所述矩形区域用于表征所述硬币上的年份数字所占的显示 区域;  Determining a coordinate of four rectangular regions selected by a user on a coin in each of the coin images; wherein the rectangular region is used to represent a display region occupied by a year number on the coin;
将所述硬币图像中的四个矩形区域的坐标分别确定为所述硬币图像中 的硬币上的四位年份数字的坐标;  Determining the coordinates of the four rectangular regions in the coin image as the coordinates of the four-digit year number on the coin in the coin image;
确定每张所述硬币图像中的硬币上的四位年份数字的名称; 将每张所述硬币图像、 每张所述硬币图像中的硬币上的年份数字的名 称及坐标进行关联存储, 得到训练样本集。  Determining a name of a four-digit year number on a coin in each of the coin images; associating each coin image, a name and a coordinate of a year number on a coin in each of the coin images, to obtain training Sample set.
[权利要求 6] 根据权利要求 5所述的方法, 其特征在于, 所述确定用户在每张所述 硬币图像中的硬币上框选出的四个矩形区域的坐标, 包括: 获取用户在每张所述硬币图像中的硬币上框选出的四个矩形区域; 根据预设的坐标标定策略, 确定每个所述矩形区域的预设对角线的两 个端点的坐标, 将每个所述矩形区域的预设对角线的两个端点的坐标 确定为所述矩形区域的坐标。  [Claim 6] The method according to claim 5, wherein the determining coordinates of four rectangular regions selected by the user on the coins in each of the coin images comprises: acquiring a user at each The four rectangular regions selected by the upper frame of the coin in the coin image; determining the coordinates of the two end points of the preset diagonal of each of the rectangular regions according to a preset coordinate calibration strategy, The coordinates of the two end points of the preset diagonal of the rectangular area are determined as the coordinates of the rectangular area.
[权利要求 7] 根据权利要求 4至 6任一项所述的方法, 其特征在于, 所述 ?&[Claim 7] The method according to any one of claims 4 to 6, wherein the ? &
RCNN模型包括特征提取网络、 区域提取网络及目标识别网络; 所述 \¥0 2019/127075 卩(:17 \2017/118891 区域提取网络的输入端和所述目标识别网络的输入端均与所述特征提 取网络的输出端连接, 所述目标识别网络的输入端还与所述区域提取 网络的输出端连接; The RCNN model includes a feature extraction network, a region extraction network, and a target recognition network; \¥0 2019/127075 卩(:17 \2017/118891 The input end of the area extraction network and the input end of the target identification network are both connected to the output end of the feature extraction network, and the input end of the target recognition network is further Connected to an output of the area extraction network;
所述采用所述训练样本集对预先构建的基于区域的快速卷积神经网络
Figure imgf000028_0001
, RCNN模型确定为 硬币年份识别模型, 包括:
Pre-constructed region-based fast convolutional neural network using the training sample set
Figure imgf000028_0001
The RCNN model is determined as a coin year identification model, including:
根据预训练得到的特征提取模型的参数值对所述特征提取网络的参数 值进行初始化, 对所述区域提取网络的参数值进行随机初始化, 并采 用初始化后的所述特征提取网络和所述区域提取网络从每张所述硬币 图像中提取候选区域;  Initializing the parameter values of the feature extraction network according to the parameter values of the feature extraction model obtained by the pre-training, randomly initializing the parameter values of the region extraction network, and adopting the initialized feature extraction network and the region Extracting a network to extract candidate regions from each of the coin images;
根据从每张所述硬币图像中提取出的候选区域以及每张所述硬币图像 中的硬币的年份数字信息对所述目标识别网络进行第一次训练; 根据第一次训练后的所述目标识别网络的初始参数值对所述区域提取 网络的参数值进行更新, 并采用初始化后的所述特征提取网络和更新 后的所述区域提取网络再次从每张所述硬币图像中提取候选区域; 根据再次从每张所述硬币图像中提取出的候选区域以及每张所述硬币 图像中的硬币的年份数字信息对所述目标识别网络进行第二次训练; 将由初始化后的所述特征提取网络、 更新后的所述区域提取网络以及 第二次训练后的所述目标识别网络组成的所述
Figure imgf000028_0002
型识别 为硬币年份识别模型。
Performing a first training on the target recognition network based on candidate regions extracted from each of the coin images and year digital information of coins in each of the coin images; according to the target after the first training Identifying an initial parameter value of the network, updating a parameter value of the area extraction network, and extracting a candidate area from each of the coin images by using the initialized feature extraction network and the updated area extraction network; Performing a second training on the target recognition network based on the candidate region extracted again from each of the coin images and the year digital information of the coins in each of the coin images; the feature extraction network to be initialized And the updated area extraction network and the target recognition network composition after the second training
Figure imgf000028_0002
The type is identified as a coin year recognition model.
[权利要求 8] 一种终端设备, 其特征在于, 包括用于执行如权利要求 1-7任一项所 述的方法的单元。  [Claim 8] A terminal device, comprising: means for performing the method according to any one of claims 1-7.
[权利要求 9] 一种终端设备, 包括存储器、 处理器以及存储在所述存储器中并可在 所述处理器上运行的计算机程序, 其特征在于, 所述处理器执行所述 计算机程序时实现如权利要求 1-7任一项所述方法的步骤。  [Claim 9] A terminal device comprising a memory, a processor, and a computer program stored in the memory and operable on the processor, wherein the processor is implemented when the computer program is executed The steps of the method of any of claims 1-7.
[权利要求 10] 一种计算机可读存储介质, 所述计算机可读存储介质存储有计算机程 序, 其特征在于, 所述计算机程序被处理器执行时实现如权利要求 1- 7任一项所述方法的步骤。  [Claim 10] A computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the method of any one of claims 1 to 7. The steps of the method.
PCT/CN2017/118891 2017-12-27 2017-12-27 Method for identifying coin year, terminal device, and computer readable storage medium WO2019127075A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/118891 WO2019127075A1 (en) 2017-12-27 2017-12-27 Method for identifying coin year, terminal device, and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/118891 WO2019127075A1 (en) 2017-12-27 2017-12-27 Method for identifying coin year, terminal device, and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2019127075A1 true WO2019127075A1 (en) 2019-07-04

Family

ID=67062785

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/118891 WO2019127075A1 (en) 2017-12-27 2017-12-27 Method for identifying coin year, terminal device, and computer readable storage medium

Country Status (1)

Country Link
WO (1) WO2019127075A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112150496A (en) * 2020-09-24 2020-12-29 平安科技(深圳)有限公司 Photo processing method and device, electronic equipment and readable storage medium
CN112329845A (en) * 2020-11-03 2021-02-05 深圳云天励飞技术股份有限公司 Method and device for replacing paper money, terminal equipment and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104464079A (en) * 2014-12-29 2015-03-25 北京邮电大学 Multi-currency-type and face value recognition method based on template feature points and topological structures of template feature points
CN104658097A (en) * 2015-03-11 2015-05-27 华中科技大学 RMB paper currency denomination identification method based on histogram matching of images
CN104866868A (en) * 2015-05-22 2015-08-26 杭州朗和科技有限公司 Metal coin identification method based on deep neural network and apparatus thereof
CN105243729A (en) * 2015-10-27 2016-01-13 深圳怡化电脑股份有限公司 Method and system for identifying banknote version
US20160210529A1 (en) * 2015-01-19 2016-07-21 Megachips Corporation Feature image generation apparatus, classification apparatus and non-transitory computer-readable memory, and feature image generation method and classification method
CN108256520A (en) * 2017-12-27 2018-07-06 中国科学院深圳先进技术研究院 A kind of method, terminal device and computer readable storage medium for identifying the coin time

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104464079A (en) * 2014-12-29 2015-03-25 北京邮电大学 Multi-currency-type and face value recognition method based on template feature points and topological structures of template feature points
US20160210529A1 (en) * 2015-01-19 2016-07-21 Megachips Corporation Feature image generation apparatus, classification apparatus and non-transitory computer-readable memory, and feature image generation method and classification method
CN104658097A (en) * 2015-03-11 2015-05-27 华中科技大学 RMB paper currency denomination identification method based on histogram matching of images
CN104866868A (en) * 2015-05-22 2015-08-26 杭州朗和科技有限公司 Metal coin identification method based on deep neural network and apparatus thereof
CN105243729A (en) * 2015-10-27 2016-01-13 深圳怡化电脑股份有限公司 Method and system for identifying banknote version
CN108256520A (en) * 2017-12-27 2018-07-06 中国科学院深圳先进技术研究院 A kind of method, terminal device and computer readable storage medium for identifying the coin time

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112150496A (en) * 2020-09-24 2020-12-29 平安科技(深圳)有限公司 Photo processing method and device, electronic equipment and readable storage medium
CN112150496B (en) * 2020-09-24 2023-06-02 平安科技(深圳)有限公司 Photo processing method, device, electronic equipment and readable storage medium
CN112329845A (en) * 2020-11-03 2021-02-05 深圳云天励飞技术股份有限公司 Method and device for replacing paper money, terminal equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
WO2020125216A1 (en) Pedestrian re-identification method, device, electronic device and computer-readable storage medium
CN109961009B (en) Pedestrian detection method, system, device and storage medium based on deep learning
WO2020199468A1 (en) Image classification method and device, and computer readable storage medium
KR20180104609A (en) Method, system, apparatus and readable storage medium for realizing insurance claims fraud prevention based on a plurality of image correspondence
CN108197250B (en) Picture retrieval method, electronic equipment and storage medium
CN108256520B (en) Method for identifying coin year, terminal equipment and computer readable storage medium
CN109948397A (en) A kind of face image correcting method, system and terminal device
WO2021012494A1 (en) Deep learning-based face recognition method and apparatus, and computer-readable storage medium
CN107832794B (en) Convolutional neural network generation method, vehicle system identification method and computing device
US11886492B2 (en) Method of matching image and apparatus thereof, device, medium and program product
WO2018210047A1 (en) Data processing method, data processing apparatus, electronic device and storage medium
CN103353881B (en) Method and device for searching application
CN110852311A (en) Three-dimensional human hand key point positioning method and device
WO2019033570A1 (en) Lip movement analysis method, apparatus and storage medium
CN109348731A (en) A kind of method and device of images match
WO2016106966A1 (en) Character labelling method, terminal and storage medium
CN111666905B (en) Model training method, pedestrian attribute identification method and related device
CN108961183A (en) Image processing method, terminal device and computer readable storage medium
CN112132812B (en) Certificate verification method and device, electronic equipment and medium
CN109740417A (en) Invoice type recognition methods, device, storage medium and computer equipment
WO2024077781A1 (en) Convolutional neural network model-based image recognition method and apparatus, and terminal device
WO2020248848A1 (en) Intelligent abnormal cell determination method and device, and computer readable storage medium
CN113111880A (en) Certificate image correction method and device, electronic equipment and storage medium
WO2019127075A1 (en) Method for identifying coin year, terminal device, and computer readable storage medium
CN112348008A (en) Certificate information identification method and device, terminal equipment and storage medium

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: 17936651

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS (EPO FORM 1205A DATED 012.11.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17936651

Country of ref document: EP

Kind code of ref document: A1