Difference between revisions of "Team:HUST-China/Micronucleus Counter"

(Created page with "<!-- # TODO: #6 Fix table caption font--><!-- # TODO: #7 Fix citations links font size--><html lang="en"><head><meta charset="utf-8"/><meta content="width=device-width,initial...")
 
Line 1: Line 1:
<!-- # TODO: #6 Fix table caption font--><!-- # TODO: #7 Fix citations links font size--><html lang="en"><head><meta charset="utf-8"/><meta content="width=device-width,initial-scale=1" name="viewport"/><link href="https://2021.igem.org/Template:HUST-China/css/contentCSS?action=raw&amp;ctype=text/css" rel="stylesheet"/><title>Micronucleus Counter | iGEM HUST-China</title><script>MathJax={tex:{inlineMath: [['$', '$'], ['\(', '\)']],packages: {'[+]': ['mhchem']},loader: {load: ['[tex]/mhchem']},};</script><link href="https://2021.igem.org/Template:HUST-China/css/contentCSS?action=raw&amp;ctype=text/css" rel="stylesheet"/></head><body><!-- # TODO: #6 Fix table caption font--><!-- # TODO: #7 Fix citations links font size--><nav class="navbar navbar-expand-xl fixed-top"><div class="container d-flex justify-content-between"><a class="navbar-brand" href="https://2021.igem.org/Team:HUST-China"><i class="navbar-logo-left"></i><span>HUST-China</span></a><button aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler" data-target="#navbarNav" data-toggle="collapse" type="button"><span class="navbar-toggler-icon"></span></button><div class="collapse navbar-collapse" id="navbarNav"><ul class="navbar-nav ml-auto"><li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarProjectDropdown" role="button">Project</a><div aria-labelledby="navbarProjectDropdown" class="dropdown-menu"><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Description">Description</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Design">Design</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Proof_Of_Concept">Proof of Concept</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Safety">Safety</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Implementation">Proposed Implementation</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Contribution">Contribution</a></div></li><li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarHuman PracticesDropdown" role="button">Human Practices</a><div aria-labelledby="navbarHuman PracticesDropdown" class="dropdown-menu"><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Human_Practices">Overview</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Human_Practices_01">Part 1</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Human_Practices_02">Part 2</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Collaborations">Part 3</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Education">Part 4</a></div></li><li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarModelingDropdown" role="button">Modeling</a><div aria-labelledby="navbarModelingDropdown" class="dropdown-menu"><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Model">Overview</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Gene_Pathway">Gene Pathway</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Dye_color_forecast">Dye color forecast</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Micronucleus_Counter">Micronucleus Counter</a></div></li><li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarProductsDropdown" role="button">Products</a><div aria-labelledby="navbarProductsDropdown" class="dropdown-menu"><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Products">Overview</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Software">Software</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Hardware">Hardware</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Another_Area">Another Area</a></div></li><li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarExperimentsDropdown" role="button">Experiments</a><div aria-labelledby="navbarExperimentsDropdown" class="dropdown-menu"><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Experiments">Overview</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Parts">Parts</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Engineering">Engineering Success</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Results">Results</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Protocol">Protocol</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Notebook">Notebook</a></div></li><li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarPeopleDropdown" role="button">People</a><div aria-labelledby="navbarPeopleDropdown" class="dropdown-menu"><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Team">Team</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Partnership">Partnership</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Attributions">Attributions</a></div></li><li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarAchievementsDropdown" role="button">Achievements</a><div aria-labelledby="navbarAchievementsDropdown" class="dropdown-menu"><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Judging">Judging</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/https:/video.igem.org/w/aMwNT6eBryGs8xG5avXD51">Promotion Video</a><a class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/https:/igem.org/2021_Judging_Form?id=3711">Judging Form</a></div></li></ul></div></div></nav><div class="navbar-extra fixed-top"></div><header class="d-flex justify-content-center align-items-center"><div class="container"><h1 id="Top">Micronucleus Counter</h1><p class="lead pl-1"></p><hr class="my-4"/></div></header><main><div class="container"><div class="row"><div class="sidebar col-lg-3"><div class="nav" id="contents"><h5>Contents</h5><ul></ul></div></div><div class="content col-lg-9"><article><h1>Overview</h1><p>It's <strong>THE WORLD'S FIRST</strong> micronucleus recognition counter for ordinary light microscope photographs. This tool <strong>GREATLY SAVES EXPERIMENTAL COSTS</strong>, both in terms of equipment cost and labor cost.And the evaluation results based on this set of tools are highly consistent with the recognized evaluation standards.</p><h1>PART 1 algorithm structures</h1><p>We choosed the Yolov 5 algorithm framework.</p><p>This algorithm uses Mosaic data enhancement, adaptive anchor frame calculation, adaptive image scaling and other processing methods for input data, and backbone uses Focus architecture and CSP architecture - it is worth mentioning that this algorithm introduces CSP2 architecture in Neck part, thus enhancing the ability of model feature fusion. Finally, GIOU_Loss is used as the loss function of Bounding box at the output end, and NMS non-maximum suppression is used to ensure no double counting.</p><div class="modal-btn"><button class="btn btn-warning pull-right" data-target="#principle" data-toggle="modal" type="button">Read More</button><div aria-hidden="true" aria-labelledby="principleLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="principle" tabindex="-1"><div class="modal-dialog modal-dialog-scrollable modal-dialog-centered modal-xl"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="principleLabel">principle</h5></div><div class="modal-body"><p>The principles are described in the picture below:</p><div class="image"><img alt="Yolov5 Stucture" src="https://static.igem.org/mediawiki/2021/4/43/T--HUST-China--img--model--model-MCN-1.png" style="width: 90%"/><p>Figure 1: Yolov5 Stucture</p></div><p>You can get the further contents and descriptions of the codes from [the author's homepage on Github]. Here we won't conduct a deeper discussion.</p></div><div class="modal-footer"><button class="btn btn-danger" data-dismiss="modal" type="button">Close</button></div></div></div></div></div><h1>PART 2 results</h1><p>Our runtime environment is Pycharm, Python+Tensor, Flow+Torch+Scikit-learn. You could download the source code to get the requirements via requirements.txt. The way to install the requirements is shown below:</p><pre><code>pip install -r requirements.txt
+
<!-- # TODO: #6 Fix table caption font-->
</code></pre><p>Taking our micronucleus counting as an example, we wrote the scripting file <em>run_bat.py</em>.</p><pre><code class="language-python">import os
+
<!-- # TODO: #7 Fix citations links font size-->
 +
<html lang="en">
 +
 
 +
<head>
 +
    <meta charset="utf-8" />
 +
    <meta content="width=device-width,initial-scale=1" name="viewport" />
 +
    <link href="https://2021.igem.org/Template:HUST-China/css/contentCSS?action=raw&amp;ctype=text/css"
 +
        rel="stylesheet" />
 +
    <title>Micronucleus Counter | iGEM HUST-China</title>
 +
    <script>MathJax = { tex: { inlineMath: [['$', '$'], ['\(', '\)']], packages: { '[+]': ['mhchem'] }, loader: { load: ['[tex]/mhchem'] }, };</script>
 +
    <link href="https://2021.igem.org/Template:HUST-China/css/contentCSS?action=raw&amp;ctype=text/css"
 +
        rel="stylesheet" />
 +
</head>
 +
 
 +
<body>
 +
    <!-- # TODO: #6 Fix table caption font-->
 +
    <!-- # TODO: #7 Fix citations links font size-->
 +
    <nav class="navbar navbar-expand-xl fixed-top">
 +
        <div class="container d-flex justify-content-between"><a class="navbar-brand"
 +
                href="https://2021.igem.org/Team:HUST-China"><i
 +
                    class="navbar-logo-left"></i><span>HUST-China</span></a><button aria-controls="navbarNav"
 +
                aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler" data-target="#navbarNav"
 +
                data-toggle="collapse" type="button"><span class="navbar-toggler-icon"></span></button>
 +
            <div class="collapse navbar-collapse" id="navbarNav">
 +
                <ul class="navbar-nav ml-auto">
 +
                    <li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true"
 +
                            class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarProjectDropdown"
 +
                            role="button">Project</a>
 +
                        <div aria-labelledby="navbarProjectDropdown" class="dropdown-menu"><a class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Description">Description</a><a
 +
                                class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Design">Design</a><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Proof_Of_Concept">Proof of Concept</a><a
 +
                                class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Safety">Safety</a><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Implementation">Proposed
 +
                                Implementation</a><a class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Contribution">Contribution</a></div>
 +
                    </li>
 +
                    <li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true"
 +
                            class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"
 +
                            id="navbarHuman PracticesDropdown" role="button">Human Practices</a>
 +
                        <div aria-labelledby="navbarHuman PracticesDropdown" class="dropdown-menu"><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Human_Practices">Overview</a><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Human_Practices_01">Part 1</a><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Human_Practices_02">Part 2</a><a
 +
                                class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Collaborations">Part
 +
                                3</a><a class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Education">Part 4</a></div>
 +
                    </li>
 +
                    <li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true"
 +
                            class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarModelingDropdown"
 +
                            role="button">Modeling</a>
 +
                        <div aria-labelledby="navbarModelingDropdown" class="dropdown-menu"><a class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Model">Overview</a><a class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Gene_Pathway">Gene Pathway</a><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Dye_color_forecast">Dye color forecast</a><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Micronucleus_Counter">Micronucleus
 +
                                Counter</a></div>
 +
                    </li>
 +
                    <li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true"
 +
                            class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarProductsDropdown"
 +
                            role="button">Products</a>
 +
                        <div aria-labelledby="navbarProductsDropdown" class="dropdown-menu"><a class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Products">Overview</a><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Software">Software</a><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Hardware">Hardware</a><a
 +
                                class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Another_Area">Another
 +
                                Area</a></div>
 +
                    </li>
 +
                    <li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true"
 +
                            class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"
 +
                            id="navbarExperimentsDropdown" role="button">Experiments</a>
 +
                        <div aria-labelledby="navbarExperimentsDropdown" class="dropdown-menu"><a class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Experiments">Overview</a><a
 +
                                class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Parts">Parts</a><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Engineering">Engineering Success</a><a
 +
                                class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Results">Results</a><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Protocol">Protocol</a><a
 +
                                class="dropdown-item" href="https://2021.igem.org/Team:HUST-China/Notebook">Notebook</a>
 +
                        </div>
 +
                    </li>
 +
                    <li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true"
 +
                            class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="navbarPeopleDropdown"
 +
                            role="button">People</a>
 +
                        <div aria-labelledby="navbarPeopleDropdown" class="dropdown-menu"><a class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Team">Team</a><a class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Partnership">Partnership</a><a
 +
                                class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Attributions">Attributions</a></div>
 +
                    </li>
 +
                    <li class="nav-item dropdown"><a aria-expanded="false" aria-haspopup="true"
 +
                            class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"
 +
                            id="navbarAchievementsDropdown" role="button">Achievements</a>
 +
                        <div aria-labelledby="navbarAchievementsDropdown" class="dropdown-menu"><a class="dropdown-item"
 +
                                href="https://2021.igem.org/Team:HUST-China/Judging">Judging</a><a class="dropdown-item"
 +
                                href="https://video.igem.org/w/aMwNT6eBryGs8xG5avXD51">Promotion
 +
                                Video</a><a class="dropdown-item"
 +
                                href="https://igem.org/2021_Judging_Form?id=3711">Judging
 +
                                Form</a></div>
 +
                    </li>
 +
                </ul>
 +
            </div>
 +
        </div>
 +
    </nav>
 +
    <div class="navbar-extra fixed-top"></div>
 +
    <header class="d-flex justify-content-center align-items-center">
 +
        <div class="container">
 +
            <h1 id="Top">Micronucleus Counter</h1>
 +
            <p class="lead pl-1"></p>
 +
            <hr class="my-4" />
 +
        </div>
 +
    </header>
 +
    <main>
 +
        <div class="container">
 +
            <div class="row">
 +
                <div class="sidebar col-lg-3">
 +
                    <div class="nav" id="contents">
 +
                        <h5>Contents</h5>
 +
                        <ul></ul>
 +
                    </div>
 +
                </div>
 +
                <div class="content col-lg-9">
 +
                    <article>
 +
                        <h1>Overview</h1>
 +
                        <p>It's <strong>THE WORLD'S FIRST</strong> micronucleus recognition counter for ordinary light
 +
                            microscope photographs. This tool <strong>GREATLY SAVES EXPERIMENTAL COSTS</strong>, both in
 +
                            terms of equipment cost and labor cost.And the evaluation results based on this set of tools
 +
                            are highly consistent with the recognized evaluation standards.</p>
 +
                        <h1>PART 1 algorithm structures</h1>
 +
                        <p>We choosed the Yolov 5 algorithm framework.</p>
 +
                        <p>This algorithm uses Mosaic data enhancement, adaptive anchor frame calculation, adaptive
 +
                            image scaling and other processing methods for input data, and backbone uses Focus
 +
                            architecture and CSP architecture - it is worth mentioning that this algorithm introduces
 +
                            CSP2 architecture in Neck part, thus enhancing the ability of model feature fusion. Finally,
 +
                            GIOU_Loss is used as the loss function of Bounding box at the output end, and NMS
 +
                            non-maximum suppression is used to ensure no double counting.</p>
 +
                        <div class="modal-btn"><button class="btn btn-warning pull-right" data-target="#principle"
 +
                                data-toggle="modal" type="button">Read More</button>
 +
                            <div aria-hidden="true" aria-labelledby="principleLabel" class="modal fade"
 +
                                data-backdrop="static" data-keyboard="false" id="principle" tabindex="-1">
 +
                                <div class="modal-dialog modal-dialog-scrollable modal-dialog-centered modal-xl">
 +
                                    <div class="modal-content">
 +
                                        <div class="modal-header">
 +
                                            <h5 class="modal-title" id="principleLabel">principle</h5>
 +
                                        </div>
 +
                                        <div class="modal-body">
 +
                                            <p>The principles are described in the picture below:</p>
 +
                                            <div class="image"><img alt="Yolov5 Stucture"
 +
                                                    src="https://static.igem.org/mediawiki/2021/4/43/T--HUST-China--img--model--model-MCN-1.png"
 +
                                                    style="width: 90%" />
 +
                                                <p>Figure 1: Yolov5 Stucture</p>
 +
                                            </div>
 +
                                            <p>You can get the further contents and descriptions of the codes from [the
 +
                                                author's homepage on Github]. Here we won't conduct a deeper discussion.
 +
                                            </p>
 +
                                        </div>
 +
                                        <div class="modal-footer"><button class="btn btn-danger" data-dismiss="modal"
 +
                                                type="button">Close</button></div>
 +
                                    </div>
 +
                                </div>
 +
                            </div>
 +
                        </div>
 +
                        <h1>PART 2 results</h1>
 +
                        <p>Our runtime environment is Pycharm, Python+Tensor, Flow+Torch+Scikit-learn. You could
 +
                            download the source code to get the requirements via requirements.txt. The way to install
 +
                            the requirements is shown below:</p>
 +
                        <pre><code>pip install -r requirements.txt
 +
</code></pre>
 +
                        <p>Taking our micronucleus counting as an example, we wrote the scripting file
 +
                            <em>run_bat.py</em>.</p>
 +
                        <pre><code class="language-python">import os
 
for dirname in os.listdir(r'F:\venv\work'):
 
for dirname in os.listdir(r'F:\venv\work'):
 
     os.system('python ./detect.py --weights F:/venv/MCNcounter/runs/train/exp2/weights/best.pt --source F:/venv/work/{0}  --imgsz 2592  --save-txt --name F:/venv/results/{0} --line-thickness 1 &gt;&gt; F:/venv/logs/{0}_log.txt'.format(dirname))
 
     os.system('python ./detect.py --weights F:/venv/MCNcounter/runs/train/exp2/weights/best.pt --source F:/venv/work/{0}  --imgsz 2592  --save-txt --name F:/venv/results/{0} --line-thickness 1 &gt;&gt; F:/venv/logs/{0}_log.txt'.format(dirname))
</code></pre><p>Among this, F:\venv\work is the catalog where the pictures to be analyzed were situated.</p><p>F:\venv\MCNcounter\runs\train\exp2\weights\best.pt is the address of weight file. These contents could all be customized and we would make an instruction about this in PART 3.</p><p>These are the running results:</p><div class="image"><img alt="Left: raw photo, Right: labeled photo" src="https://static.igem.org/mediawiki/2021/2/21/T--HUST-China--img--model--model-MCN-2.png" style="width: 100%"/><p>Figure 2: Left: raw photo, Right: labeled photo</p></div><p>In the installed file, the log.txt and the labeled images are included, which can not only extract the labels directly, but also test if the labels mark the micronuclei accurately.</p><h1>PART 3 Customization of data set</h1><p>Generally, yolov5 framework could be optimized to identify every image to label (or the video read frame by frame). But to improve the efficiency of the model, here it is used as a micronucleus counter, we don't illustrate these customizable file and model files. We would provide the interface of training model when the labels are only "cell" and "micro" (referring to micronucleus) to simplify the explanation of how to customize the data set.</p><p>Still, source codes are provided and you could learn further about how to customize via internet.</p><p>The steps to customize the training set are listed below:</p><ul><li><p>Input this at the command terminal:</p><pre><code>labelimg
+
</code></pre>
</code></pre></li><li><p>If the file "labelimg" isn't installed, please run this beforehand:</p><pre><code>pip3 install labelimg
+
                        <p>Among this, F:\venv\work is the catalog where the pictures to be analyzed were situated.</p>
</code></pre></li><li><p>Put the pictures for training into ./MSNcounter/prepare_data_voc/images, then click "Open Dir" in the surface of lebelimg. Choose the image folder and click "Change Save Dir", and save the label files in the folder ./MSNcounter/prepare_data_voc/Annotations.</p></li><li><p>Choose cell/micronuclei in the inner frame of labelimg, and name it as <em>cell</em>/<em>micro</em></p></li><li><p>Save, and exit the labelimg surface.</p></li><li><p>Run this file under the catalog where voc_label.py is situated:</p><pre><code class="language-bash">python3 ./voc_laebl.py
+
                        <p>F:\venv\MCNcounter\runs\train\exp2\weights\best.pt is the address of weight file. These
</code></pre></li><li><p>As the same, run this file under the catalog where split_train_val.py is situated:</p><pre><code class="language-bash">python3 ./split_train_val.py
+
                            contents could all be customized and we would make an instruction about this in PART 3.</p>
</code></pre></li><li><p>Begin the training:</p><pre><code class="language-bash">python train.py --img 640 --batch 16 --epoch 300 --data data/ab.yaml --cfg models/yolov5s.yaml --weights F:/venv/MCNcounter/runs/train/exp2/weights/best.pt --device '0'
+
                        <p>These are the running results:</p>
</code></pre></li></ul><p>Tips: You can modify the parameters according to the actual configurations. The weight file after training is: ./runs/train/exp*/weights/best.pt</p><ul><li><p>You can run our script directly according to the catalog settings displayed in part 2, or set the attention catalog according to the command below:</p><pre><code class="language-bash">python ./detect.py --weights {weights_file(.pt)} --source {the_dir_of_photos}  --imgsz {the _size_of_photos}  --save-txt --name {the_dir_of_results} --line-thickness 1 &gt;&gt; {the_dir_of_logs}
+
                        <div class="image"><img alt="Left: raw photo, Right: labeled photo"
</code></pre></li></ul><h1>PART 4 Several tips about the data set</h1><p>Here are some advice about data set:</p><ul><li>You should make sure that the samples are collected with the same apparatus and the same parameters:</li><li>The quality of the samples should be specially noticed. Redundant external stains, less interphase cells and uneven dyeing(or most of the part are too pale) could lead to unreliable testing results. In this case, positive and negative control group could only be used as relative reference and the widely acknowledged data standards could not be optimized anymore.</li></ul><div class="row g-0"><div class="col-4 girl"><img src="https://static.igem.org/mediawiki/2021/2/28/T--HUST-China--img--girl.png"/></div><div class="col-5"><div class="dialogbox"><p>Impressive! I believe it will bring convenience to other teams in the future, what do you say? I’m now really excited about their final <a href="https://2021.igem.org/Team:HUST-China/Micronucleus_Counter/Products">products</a>, let’s take a look!</p></div></div></div></article><article id="references"><h1>References</h1><ol><li id="citation1"><p class="author">Allen, M. J., &amp; Sheridan, S. C. (2015).</p><cite>Mortality risks during extreme temperature events (ETEs) using a distributed lag non-linear model.</cite><p><span class="journalTitle">International Journal of Biometeorology</span> <span class="journalInfo">62(1), 57-67.</span></p><a class="in-text" href="https://doi.org/10.1007/s00484-015-1117-4" rel="noopener" target="_blank">CrossRef</a><a class="in-text" href="https://scholar.google.com/scholar?q=Mortality risks during extreme temperature events (ETEs) using a distributed lag non-linear model." rel="noopener" target="_blank">Google Scholar</a><a class="in-text" href="#intext1">Back to text</a></li><li id="citation2"><p class="author">Rosano, A., Bella, A., Gesualdo, F., Acampora, A., Pezzotti, P., Marchetti, S., ... &amp; Rizzo, C. (2019).</p><cite>Investigating the impact of influenza on excess mortality in all ages in Italy during recent seasons (2013/14-2016/17 seasons).</cite><p><span class="journalTitle">International Journal of Infectious Diseases</span> <span class="journalInfo">88, 127-134.</span></p><a class="in-text" href="https://doi.org/10.1016/j.ijid.2019.08.003" rel="noopener" target="_blank">CrossRef</a><a class="in-text" href="https://scholar.google.com/scholar?q=Investigating the impact of influenza on excess mortality in all ages in Italy during recent seasons (2013/14-2016/17 seasons)." rel="noopener" target="_blank">Google Scholar</a><a class="in-text" href="#intext2">Back to text</a></li><li id="citation3"><p class="author">Ingalls, B. P. (2013).</p><cite>Mathematical modeling in systems biology: An introduction.</cite><p><span class="details">MIT Press.</span></p><a class="in-text" href="https://books.google.co.in/books?id=OYr6AQAAQBAJ" rel="noopener" target="_blank">Google Books</a><a class="in-text" href="#intext3">Back to text</a></li><li id="citation4"><p class="author"></p><cite>Agriculture: Crop production: Sugarcane. TNAU Agritech Portal.</cite><p><span class="details">(March 15, 2019). Retrieved on June 22, 2020. from </span><a class="in-text" href="https://google.com" rel="noopener" target="_blank">https://google.com</a></p><a class="in-text" href="#intext4">Back to text</a></li><li id="citation5"><p class="author">Author Name. (n.d.).</p><cite>Agriculture: Crop production: Sugarcane. TNAU Agritech Portal.</cite><p><span class="details">Retrieved on June 22, 2020. from </span><a class="in-text" href="https://google.com" rel="noopener" target="_blank">https://google.com</a></p><a class="in-text" href="#intext5">Back to text</a></li></ol></article></div></div></div></main><footer><div class="container"><div class="row"><div class="col-7"><div class="row justify-content-center"><div class="footer-logo"></div></div><p><span>CONTACT US: </span><a href="mailto:iGEMHUSTChina@163.com">iGEMHUSTChina@163.com</a></p><p>Huazhong University of Sci. &amp; Tech., Wuhan, China</p><p>1037# Luoyu Rd, Wuhan, P.R.China 430074</p><p>Copyright © <span>HUST-China </span>iGEM 2021</p></div><div class="col-5"><div class="row"><div class="footer-xmind"></div></div><div class="row"><div class="footer-snapgene"></div></div><div class="row"><div class="footer-NEBI"></div></div></div></div></div></footer><script src="https://2021.igem.org/Template:HUST-China/content-bundleJS?action=raw&amp;ctype=text/javascript"></script><script src="https://2021.igem.org/Template:HUST-China/mathjax-bundleJS?action=raw&amp;ctype=text/javascript"></script></body></html>
+
                                src="https://static.igem.org/mediawiki/2021/2/21/T--HUST-China--img--model--model-MCN-2.png"
 +
                                style="width: 100%" />
 +
                            <p>Figure 2: Left: raw photo, Right: labeled photo</p>
 +
                        </div>
 +
                        <p>In the installed file, the log.txt and the labeled images are included, which can not only
 +
                            extract the labels directly, but also test if the labels mark the micronuclei accurately.
 +
                        </p>
 +
                        <h1>PART 3 Customization of data set</h1>
 +
                        <p>Generally, yolov5 framework could be optimized to identify every image to label (or the video
 +
                            read frame by frame). But to improve the efficiency of the model, here it is used as a
 +
                            micronucleus counter, we don't illustrate these customizable file and model files. We would
 +
                            provide the interface of training model when the labels are only "cell" and "micro"
 +
                            (referring to micronucleus) to simplify the explanation of how to customize the data set.
 +
                        </p>
 +
                        <p>Still, source codes are provided and you could learn further about how to customize via
 +
                            internet.</p>
 +
                        <p>The steps to customize the training set are listed below:</p>
 +
                        <ul>
 +
                            <li>
 +
                                <p>Input this at the command terminal:</p>
 +
                                <pre><code>labelimg
 +
</code></pre>
 +
                            </li>
 +
                            <li>
 +
                                <p>If the file "labelimg" isn't installed, please run this beforehand:</p>
 +
                                <pre><code>pip3 install labelimg
 +
</code></pre>
 +
                            </li>
 +
                            <li>
 +
                                <p>Put the pictures for training into ./MSNcounter/prepare_data_voc/images, then click
 +
                                    "Open Dir" in the surface of lebelimg. Choose the image folder and click "Change
 +
                                    Save Dir", and save the label files in the folder
 +
                                    ./MSNcounter/prepare_data_voc/Annotations.</p>
 +
                            </li>
 +
                            <li>
 +
                                <p>Choose cell/micronuclei in the inner frame of labelimg, and name it as
 +
                                    <em>cell</em>/<em>micro</em></p>
 +
                            </li>
 +
                            <li>
 +
                                <p>Save, and exit the labelimg surface.</p>
 +
                            </li>
 +
                            <li>
 +
                                <p>Run this file under the catalog where voc_label.py is situated:</p>
 +
                                <pre><code class="language-bash">python3 ./voc_laebl.py
 +
</code></pre>
 +
                            </li>
 +
                            <li>
 +
                                <p>As the same, run this file under the catalog where split_train_val.py is situated:
 +
                                </p>
 +
                                <pre><code class="language-bash">python3 ./split_train_val.py
 +
</code></pre>
 +
                            </li>
 +
                            <li>
 +
                                <p>Begin the training:</p>
 +
                                <pre><code class="language-bash">python train.py --img 640 --batch 16 --epoch 300 --data data/ab.yaml --cfg models/yolov5s.yaml --weights F:/venv/MCNcounter/runs/train/exp2/weights/best.pt --device '0'
 +
</code></pre>
 +
                            </li>
 +
                        </ul>
 +
                        <p>Tips: You can modify the parameters according to the actual configurations. The weight file
 +
                            after training is: ./runs/train/exp*/weights/best.pt</p>
 +
                        <ul>
 +
                            <li>
 +
                                <p>You can run our script directly according to the catalog settings displayed in part
 +
                                    2, or set the attention catalog according to the command below:</p>
 +
                                <pre><code class="language-bash">python ./detect.py --weights {weights_file(.pt)} --source {the_dir_of_photos}  --imgsz {the _size_of_photos}  --save-txt --name {the_dir_of_results} --line-thickness 1 &gt;&gt; {the_dir_of_logs}
 +
</code></pre>
 +
                            </li>
 +
                        </ul>
 +
                        <h1>PART 4 Several tips about the data set</h1>
 +
                        <p>Here are some advice about data set:</p>
 +
                        <ul>
 +
                            <li>You should make sure that the samples are collected with the same apparatus and the same
 +
                                parameters:</li>
 +
                            <li>The quality of the samples should be specially noticed. Redundant external stains, less
 +
                                interphase cells and uneven dyeing(or most of the part are too pale) could lead to
 +
                                unreliable testing results. In this case, positive and negative control group could only
 +
                                be used as relative reference and the widely acknowledged data standards could not be
 +
                                optimized anymore.</li>
 +
                        </ul>
 +
                        <div class="row g-0">
 +
                            <div class="col-4 girl"><img
 +
                                    src="https://static.igem.org/mediawiki/2021/2/28/T--HUST-China--img--girl.png" /></div>
 +
                            <div class="col-5">
 +
                                <div class="dialogbox">
 +
                                    <p>Impressive! I believe it will bring convenience to other teams in the future,
 +
                                        what do you say? I’m now really excited about their final <a
 +
                                            href="https://2021.igem.org/Team:HUST-China/Products">products</a>,
 +
                                        let’s take a look!</p>
 +
                                </div>
 +
                            </div>
 +
                        </div>
 +
                    </article>
 +
                    <article id="references">
 +
                        <h1>References</h1>
 +
                        <ol>
 +
                            <li id="citation1">
 +
                                <p class="author">Allen, M. J., &amp; Sheridan, S. C. (2015).</p><cite>Mortality risks
 +
                                    during extreme temperature events (ETEs) using a distributed lag non-linear
 +
                                    model.</cite>
 +
                                <p><span class="journalTitle">International Journal of Biometeorology</span> <span
 +
                                        class="journalInfo">62(1), 57-67.</span></p><a class="in-text"
 +
                                    href="https://doi.org/10.1007/s00484-015-1117-4" rel="noopener"
 +
                                    target="_blank">CrossRef</a><a class="in-text"
 +
                                    href="https://scholar.google.com/scholar?q=Mortality risks during extreme temperature events (ETEs) using a distributed lag non-linear model."
 +
                                    rel="noopener" target="_blank">Google Scholar</a><a class="in-text"
 +
                                    href="#intext1">Back to text</a>
 +
                            </li>
 +
                            <li id="citation2">
 +
                                <p class="author">Rosano, A., Bella, A., Gesualdo, F., Acampora, A., Pezzotti, P.,
 +
                                    Marchetti, S., ... &amp; Rizzo, C. (2019).</p><cite>Investigating the impact of
 +
                                    influenza on excess mortality in all ages in Italy during recent seasons
 +
                                    (2013/14-2016/17 seasons).</cite>
 +
                                <p><span class="journalTitle">International Journal of Infectious Diseases</span> <span
 +
                                        class="journalInfo">88, 127-134.</span></p><a class="in-text"
 +
                                    href="https://doi.org/10.1016/j.ijid.2019.08.003" rel="noopener"
 +
                                    target="_blank">CrossRef</a><a class="in-text"
 +
                                    href="https://scholar.google.com/scholar?q=Investigating the impact of influenza on excess mortality in all ages in Italy during recent seasons (2013/14-2016/17 seasons)."
 +
                                    rel="noopener" target="_blank">Google Scholar</a><a class="in-text"
 +
                                    href="#intext2">Back to text</a>
 +
                            </li>
 +
                            <li id="citation3">
 +
                                <p class="author">Ingalls, B. P. (2013).</p><cite>Mathematical modeling in systems
 +
                                    biology: An introduction.</cite>
 +
                                <p><span class="details">MIT Press.</span></p><a class="in-text"
 +
                                    href="https://books.google.co.in/books?id=OYr6AQAAQBAJ" rel="noopener"
 +
                                    target="_blank">Google Books</a><a class="in-text" href="#intext3">Back to text</a>
 +
                            </li>
 +
                            <li id="citation4">
 +
                                <p class="author"></p><cite>Agriculture: Crop production: Sugarcane. TNAU Agritech
 +
                                    Portal.</cite>
 +
                                <p><span class="details">(March 15, 2019). Retrieved on June 22, 2020. from </span><a
 +
                                        class="in-text" href="https://google.com" rel="noopener"
 +
                                        target="_blank">https://google.com</a></p><a class="in-text"
 +
                                    href="#intext4">Back to text</a>
 +
                            </li>
 +
                            <li id="citation5">
 +
                                <p class="author">Author Name. (n.d.).</p><cite>Agriculture: Crop production: Sugarcane.
 +
                                    TNAU Agritech Portal.</cite>
 +
                                <p><span class="details">Retrieved on June 22, 2020. from </span><a class="in-text"
 +
                                        href="https://google.com" rel="noopener" target="_blank">https://google.com</a>
 +
                                </p><a class="in-text" href="#intext5">Back to text</a>
 +
                            </li>
 +
                        </ol>
 +
                    </article>
 +
                </div>
 +
            </div>
 +
        </div>
 +
    </main>
 +
    <footer>
 +
        <div class="container">
 +
            <div class="row">
 +
                <div class="col-7">
 +
                    <div class="row justify-content-center">
 +
                        <div class="footer-logo"></div>
 +
                    </div>
 +
                    <p><span>CONTACT US: </span><a href="mailto:iGEMHUSTChina@163.com">iGEMHUSTChina@163.com</a></p>
 +
                    <p>Huazhong University of Sci. &amp; Tech., Wuhan, China</p>
 +
                    <p>1037# Luoyu Rd, Wuhan, P.R.China 430074</p>
 +
                    <p>Copyright © <span>HUST-China </span>iGEM 2021</p>
 +
                </div>
 +
                <div class="col-5">
 +
                    <div class="row">
 +
                        <div class="footer-xmind"></div>
 +
                    </div>
 +
                    <div class="row">
 +
                        <div class="footer-snapgene"></div>
 +
                    </div>
 +
                    <div class="row">
 +
                        <div class="footer-NEBI"></div>
 +
                    </div>
 +
                </div>
 +
            </div>
 +
        </div>
 +
    </footer>
 +
    <script
 +
        src="https://2021.igem.org/Template:HUST-China/content-bundleJS?action=raw&amp;ctype=text/javascript"></script>
 +
    <script
 +
        src="https://2021.igem.org/Template:HUST-China/mathjax-bundleJS?action=raw&amp;ctype=text/javascript"></script>
 +
</body>
 +
 
 +
</html>

Revision as of 01:02, 22 October 2021

Micronucleus Counter | iGEM HUST-China

Micronucleus Counter


Overview

It's THE WORLD'S FIRST micronucleus recognition counter for ordinary light microscope photographs. This tool GREATLY SAVES EXPERIMENTAL COSTS, both in terms of equipment cost and labor cost.And the evaluation results based on this set of tools are highly consistent with the recognized evaluation standards.

PART 1 algorithm structures

We choosed the Yolov 5 algorithm framework.

This algorithm uses Mosaic data enhancement, adaptive anchor frame calculation, adaptive image scaling and other processing methods for input data, and backbone uses Focus architecture and CSP architecture - it is worth mentioning that this algorithm introduces CSP2 architecture in Neck part, thus enhancing the ability of model feature fusion. Finally, GIOU_Loss is used as the loss function of Bounding box at the output end, and NMS non-maximum suppression is used to ensure no double counting.

PART 2 results

Our runtime environment is Pycharm, Python+Tensor, Flow+Torch+Scikit-learn. You could download the source code to get the requirements via requirements.txt. The way to install the requirements is shown below:

pip install -r requirements.txt

Taking our micronucleus counting as an example, we wrote the scripting file run_bat.py.

import os
for dirname in os.listdir(r'F:\venv\work'):
    os.system('python ./detect.py --weights F:/venv/MCNcounter/runs/train/exp2/weights/best.pt --source F:/venv/work/{0}  --imgsz 2592  --save-txt --name F:/venv/results/{0} --line-thickness 1 >> F:/venv/logs/{0}_log.txt'.format(dirname))

Among this, F:\venv\work is the catalog where the pictures to be analyzed were situated.

F:\venv\MCNcounter\runs\train\exp2\weights\best.pt is the address of weight file. These contents could all be customized and we would make an instruction about this in PART 3.

These are the running results:

Left: raw photo, Right: labeled photo

Figure 2: Left: raw photo, Right: labeled photo

In the installed file, the log.txt and the labeled images are included, which can not only extract the labels directly, but also test if the labels mark the micronuclei accurately.

PART 3 Customization of data set

Generally, yolov5 framework could be optimized to identify every image to label (or the video read frame by frame). But to improve the efficiency of the model, here it is used as a micronucleus counter, we don't illustrate these customizable file and model files. We would provide the interface of training model when the labels are only "cell" and "micro" (referring to micronucleus) to simplify the explanation of how to customize the data set.

Still, source codes are provided and you could learn further about how to customize via internet.

The steps to customize the training set are listed below:

  • Input this at the command terminal:

    labelimg
    
  • If the file "labelimg" isn't installed, please run this beforehand:

    pip3 install labelimg
    
  • Put the pictures for training into ./MSNcounter/prepare_data_voc/images, then click "Open Dir" in the surface of lebelimg. Choose the image folder and click "Change Save Dir", and save the label files in the folder ./MSNcounter/prepare_data_voc/Annotations.

  • Choose cell/micronuclei in the inner frame of labelimg, and name it as cell/micro

  • Save, and exit the labelimg surface.

  • Run this file under the catalog where voc_label.py is situated:

    python3 ./voc_laebl.py
    
  • As the same, run this file under the catalog where split_train_val.py is situated:

    python3 ./split_train_val.py
    
  • Begin the training:

    python train.py --img 640 --batch 16 --epoch 300 --data data/ab.yaml --cfg models/yolov5s.yaml --weights F:/venv/MCNcounter/runs/train/exp2/weights/best.pt --device '0'
    

Tips: You can modify the parameters according to the actual configurations. The weight file after training is: ./runs/train/exp*/weights/best.pt

  • You can run our script directly according to the catalog settings displayed in part 2, or set the attention catalog according to the command below:

    python ./detect.py --weights {weights_file(.pt)} --source {the_dir_of_photos}  --imgsz {the _size_of_photos}  --save-txt --name {the_dir_of_results} --line-thickness 1 >> {the_dir_of_logs}
    

PART 4 Several tips about the data set

Here are some advice about data set:

  • You should make sure that the samples are collected with the same apparatus and the same parameters:
  • The quality of the samples should be specially noticed. Redundant external stains, less interphase cells and uneven dyeing(or most of the part are too pale) could lead to unreliable testing results. In this case, positive and negative control group could only be used as relative reference and the widely acknowledged data standards could not be optimized anymore.

Impressive! I believe it will bring convenience to other teams in the future, what do you say? I’m now really excited about their final products, let’s take a look!

References

  1. Allen, M. J., & Sheridan, S. C. (2015).

    Mortality risks during extreme temperature events (ETEs) using a distributed lag non-linear model.

    International Journal of Biometeorology 62(1), 57-67.

    CrossRefGoogle ScholarBack to text
  2. Rosano, A., Bella, A., Gesualdo, F., Acampora, A., Pezzotti, P., Marchetti, S., ... & Rizzo, C. (2019).

    Investigating the impact of influenza on excess mortality in all ages in Italy during recent seasons (2013/14-2016/17 seasons).

    International Journal of Infectious Diseases 88, 127-134.

    CrossRefGoogle ScholarBack to text
  3. Ingalls, B. P. (2013).

    Mathematical modeling in systems biology: An introduction.

    MIT Press.

    Google BooksBack to text
  4. Agriculture: Crop production: Sugarcane. TNAU Agritech Portal.

    (March 15, 2019). Retrieved on June 22, 2020. from https://google.com

    Back to text
  5. Author Name. (n.d.).

    Agriculture: Crop production: Sugarcane. TNAU Agritech Portal.

    Retrieved on June 22, 2020. from https://google.com

    Back to text

CONTACT US: iGEMHUSTChina@163.com

Huazhong University of Sci. & Tech., Wuhan, China

1037# Luoyu Rd, Wuhan, P.R.China 430074

Copyright © HUST-China iGEM 2021