# Discrepancy in CreateML annotations JSON file

**URL:** <https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863>\
**Category:** 🤝  Community Help\
**Tags:** bugs, formats\
**Created:** [August 5, 2023, 5:31pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863 "2023-08-05T17:31:55Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [August 5, 2023, 5:31pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/1 "2023-08-05T17:31:55Z")

</div>

I’m trying to export a dataset I have created on Roboflow for local training with Apple’s CreateML application to create a CoreML model.

The dataset is quite large; it’s based off this Coco dataset from Universe. The only difference is I’m only using the following classes in the pre-processing step:

- backpack
- book
- cell phone
- chair
- clock
- cup
- dining table
- handbag
- keyboard
- laptop
- microwave
- mouse
- person
- remote
- refrigerator
- potted plant
- scissors
- sofa
- suitcase
- tv monitor

When I add the data to CreateML, I see that there are 3 classes in the Training Data section, and 20 in the Validation Data section. These should be the same number of classes.  
 ![image](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/4/4ff817336e7d85704d9f7195c7724135ed7f38b2.png)

When I look at the respective `_annotations.createml.json` files, they do reflect this class difference.

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [August 5, 2023, 5:55pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/3 "2023-08-05T17:55:34Z")

</div>

There are many under represented classes as shown here, but, I’m only using a few compared to the total number. This is again from the original Microsoft coco dataset I linked above.

 ![CleanShot 2023-08-05 at 10.54.31](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/5/5646af9108f8e148e8a857ceebf2d30a2825b6d1.jpeg)

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [August 5, 2023, 9:39pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/4 "2023-08-05T21:39:41Z")

</div>

Hi Nick,

Are you filtering null images as well? Can you confirm that there’s definitely more than three classes tagged in the training dataset images?

I’m sure it’s highly unlikely, but if you didn’t filter out null images, I can imagine a scenario where only the three classes that you filtered (and the other ones that aren’t) made it into your training dataset.

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [August 7, 2023, 3:12pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/5 "2023-08-07T15:12:29Z")

</div>

@leo It looks like I’m not filtering out null images.

I can confirm, weirdly, that classes that are present in the `Valid` set are not present in the `Train` set - see the difference in the two screenshots below:

 ![CleanShot 2023-08-07 at 08.12.50](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/e/e525d66f128e25ecf3304daf32f72eb0e0bdebb2.png)

 ![CleanShot 2023-08-07 at 08.13.00](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/2/25d27f4a81abd4fc4a1e61e21d2eb97c765ecbed.jpeg)

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [August 7, 2023, 11:45pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/6 "2023-08-07T23:45:49Z")

</div>

Hi Nick,

Could you try filtering out null images and rebalancing your dataset to see if that solves your issues?

 ![Screenshot 2023-08-08 at 8.44.31 AM](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/d/d07ae03dc6e6d354aaccc0547193d1deaaadc242.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [August 7, 2023, 11:57pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/7 "2023-08-07T23:57:52Z")

</div>

@leo dumb question, but, how do I filter out the null images?

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [August 8, 2023, 9:58am UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/8 "2023-08-08T09:58:27Z")

</div>

Hi @Nick_Arner

No worries at all. Null filtering is a preprocessing feature. Here’s how to enable it:

1. When generating a new version, during step 3 “Preprocessing”, add a new preprocessing step  

2. Select Filter Null and select the percentage of null images you’d like to remove from that version of your dataset.

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [August 8, 2023, 10:16pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/9 "2023-08-08T22:16:05Z")

</div>

Thank you @leo

I tried both those things, but still getting the same result as before

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [August 9, 2023, 11:24pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/10 "2023-08-09T23:24:54Z")

</div>

Hi Nick,

Could you share the project Universe link (if public) or the workspace and project ID? Is it the COCO dataset Universe link you shared? (I can’t seem to click on it)

Was it the same number of classes that were getting added to a specific split, or a different number?

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [August 9, 2023, 11:37pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/11 "2023-08-09T23:37:37Z")

</div>

Hey @leo; workspace is “Stitch”; project is “stitch-coco”

> Was it the same number of classes that were getting added to a specific split, or a different number?  
> I think the same number

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [August 10, 2023, 9:26am UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/12 "2023-08-10T09:26:25Z")

</div>

Hey @Nick_Arner, let me look into this for you and I’ll let you know when I have an update.

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [August 10, 2023, 2:04pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/13 "2023-08-10T14:04:59Z")

</div>

Awesome; thank you kindly

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [August 16, 2023, 2:57pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/14 "2023-08-16T14:57:51Z")

</div>

Hey @leo just wanted to see if you had any news on your end - thank you!

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [August 20, 2023, 9:03am UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/15 "2023-08-20T09:03:50Z")

</div>

Hi @Nick_Arner

We’re still working on it. Can you confirm that you already tried to rebalance your dataset?

> [@leo](#):
>
> Could you try filtering out null images and rebalancing your dataset to see if that solves your issues?

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [August 22, 2023, 9:52pm UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/16 "2023-08-22T21:52:00Z")

</div>

@leo thank you, Leo  
Yes, I did try filtering out null images and rebalancing the dataset

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [September 6, 2023, 10:11am UTC](https://discuss.roboflow.com/t/discrepancy-in-createml-annotations-json-file/2863/17 "2023-09-06T10:11:50Z")

</div>

Hi @Nick_Arner

Still working on your issue and haven’t found a clear cause or solution yet. In the meantime, I’ve filed a bug report so the team can take a deeper look.
